Page 1 of 1

Softlight

Posted: 2014-12-07T12:08:03-07:00
by alasdairdf
Hello,

I need to do a transformation with IM that acts like Photoshop's softlight. IM's softlight composite mode gave me a completely different looking result to how Photoshop does it.

Does anyone know what the difference is and how I can imitate a Photoshop-style softlight filter?

The reason for all of this is that I found that if I do an IM -equalize on an image, then put that image on top of the original on Photoshop and apply softlight filter to the top (equalized) layer, the result is like a supremely awesome auto-level (better than Photoshop's autotone). But I need to be able to do this with IM only and the softlight not acting as expected makes it not work. Any ideas?

Thanks,
Alasdair

Re: Softlight

Posted: 2014-12-07T12:34:46-07:00
by Bonzo
I would suggest you upload the result from Photoshop and IM so people could see what the difference is.

Re: Softlight

Posted: 2014-12-07T13:13:42-07:00
by fmw42
Also provide your input image(s). You can upload to some free service such as dropbox.com and post the URLs here.

Re: Softlight

Posted: 2014-12-07T13:35:54-07:00
by fmw42
Seems to work fine for me with IM 6.9.0.0 Q16 Mac OSX

original:
Image

equalize in IM:

Code: Select all

convert zelda3_plevel20.jpg -equalize zelda3_plevel20_eq.png
Image


Softlight compose in IM:

Code: Select all

convert zelda3_plevel20.jpg zelda3_plevel20_eq.png -compose softlight -composite zelda3_plevel20_eq_softlight.png
Image


Softlight compose in PS:
Image

Code: Select all

compare -metric rmse zelda3_plevel20_eq_softlight.png zelda3_plevel20_eq_softlight_ps.png null:
287.83 (0.00439201)

75% softlight effect in IM:

Code: Select all

convert zelda3_plevel20.jpg \
\( zelda3_plevel20_eq.png -alpha set -channel a -evaluate set 75% +channel \) \
-compose softlight -composite zelda3_plevel20_eq_softlight_75.png
Image


What version of IM and platform are you using? Please, always provide this information when asking questions on this form.

Re: Softlight

Posted: 2014-12-07T22:09:25-07:00
by alasdairdf
Oh wow! (Edit: apparently w0w is changed to ???) I feel like a bit of an idiot. What I was typing was:

Code: Select all

convert test.png -compose softlight -composite equalize.png softlight1.png
Instead of:

Code: Select all

convert test.png equalize.png -compose softlight -composite softlight1.png
Thanks a lot for your help Fred!

With a bit of tweaking I got down to the final command:

Code: Select all

convert \( test.png -alpha set -channel a -evaluate set 60% +channel \) \( test.png -equalize \) -compose softlight -composite output.png
Notes:
Softlight gives a better result than pegtoplight. Pegtoplight is a little too bright and softlight seems a bit more natural.
The 60% opacity is on the original, which is the background layer, not on the equalized layer. This normalizes the colors somehow.

I'm not entirely sure why this method works so well for "auto-leveling", but I spent all of yesterday trying all the different ways to auto-level an image and this seems to give the best overall result when unsupervised.

Re: Softlight

Posted: 2014-12-08T10:52:40-07:00
by fmw42
this is more efficient, so that you do not read the input twice

Code: Select all

convert text.png \( -clone 0  -alpha set -channel a -evaluate set 60% +channel \) \( -clone 0 -equalize \) \
-delete 0 -compose softlight -composite output.png
But I think it may be better to use the 60% alpha on the equalized image, since it is harsher. That way you can get a result between the input and the equalized value.

Re: Softlight

Posted: 2014-12-09T04:15:22-07:00
by snibgo
alasdairdf wrote:... I spent all of yesterday trying all the different ways to auto-level an image and this seems to give the best overall result when unsupervised.
I've been working on this for two years, on and off: automatically making the "best" image from a raw camera file. For a while, I favoured a 50% blend of the "best gamma" image and an equalisation. Then I favoured a sigmoid curve that yielded a given standard deviation. I'm currently working on contrast-limited equalisation. It's the first totally unsupervised method I've found that often gives me results I prefer to Nikon JPEGs.

Re: Softlight

Posted: 2014-12-09T04:24:55-07:00
by alasdairdf
this is more efficient, so that you do not read the input twice
Cools, thanks!
I've been working on this for two years, on and off: automatically making the "best" image from a raw camera file. For a while, I favoured a 50% blend of the "best gamma" image and an equalisation. Then I favoured a sigmoid curve that yielded a given standard deviation. I'm currently working on contrast-limited equalisation. It's the first totally unsupervised method I've found that often gives me results I prefer to Nikon JPEGs.
Interesting... are you willing to share your experience? What do you think of my method?

Re: Softlight

Posted: 2014-12-09T05:05:44-07:00
by snibgo
I've published quite a lot on my "Adding zing to photographs" page, but that doesn't yet have the best-gamma, blend-equalize or contrast-limited equalisation processes. It will, when I get around to it.

Re: Softlight

Posted: 2014-12-09T05:42:17-07:00
by alasdairdf
That is some magic. You should patent it and sell it Canon.