A
A
Alexey Kartashov2014-12-18 02:55:50
ImageMagick
Alexey Kartashov, 2014-12-18 02:55:50

How to replicate the result of a Vibrance/Saturation filter from Photoshop in ImageMagick?

Hello!
The task was to automatically "improve" the images, namely to increase the saturation.
I took photoshop and started experimenting.
Original image
93fa1c3e37114651bc9a2e43aa1f6ca0.jpg
There are 2 filters in Photoshop to increase the saturation of the image:
Hue/Saturation and Vibrance .
Here is the result of the first filter:
25bd80bf286741fd8f0b8d1d7b30fab9.jpg( together with the settings )
Here is the second :
6a1d8a102dd043c1a5d0c04bc9efc745.jpg( together with the settings )
It can be seen with the naked eye that there is a significant difference (just compare both options in adjacent tabs). In the second case, the colors are richer, softer, less artifacts and "acidity". Azure sky, blue sea, green grass, pale yellow sand... It's like being in paradise!
At higher values ​​in the first variant, the acidity only increases, the colors are distorted, and artifacts fill the entire image plane.
But secondly - even with the value "100" there are practically no artifacts.
Although it would seem - the same name, the same range of values ​​- but still the result is different.
And this Saturation from the Vibrance filter sunk into my soul. Yes, so much so that the usual hs(+40)l is no longer happy at all.
I took ImageMagick and tried to repeat the result.
And no matter how much I fought, no matter how much I googled, nothing like that even came close.
And tried like this :

convert tmp.jpg -colorspace HSL \
  -channel B -evaluate multiply 1 \
  -channel G -evaluate multiply 1.40 \
  +channel -colorspace sRGB result.jpg

and like this:
convert tmp.jpg -set option:modulate:colorspace hsl -modulate 100,140 result.jpg

and even like this:
convert i.jpg -sigmoidal-contrast 1x10% -alpha off i_contrast.jpg

convert -set option:modulate:colorspace HSB \( i_contrast.jpg -modulate 100,140,100 \) \
  \( -clone 0 \( -clone 0 -modulate 100,100,100 \) -compose difference -composite -auto-level -negate \) \
  -compose CopyOpacity -composite i_saturation_mask.jpg

composite i_saturation_mask.jpg i_contrast.jpg result.jpg

And all this is not that, all this is somehow .. no way.
This is the closest option :
convert tmp.jpg -color-matrix "1.329212 -0.32496 -0.004252 -0.070788 1.07504 -0.004252 -0.070788 -0.32496 1.395748" result.jpg

And everything seems to be fine, but the "azure" of the sky and water could not be repeated. And this is the most important thing for me.
How to be? Isn't even the almighty ImageMagick capable of repeating such a miracle? After all, I feel that I am capable, only I can’t find it in any way ..
Gentlemen and ladies, who came across? Who knows? Who will tell? I really want this effect. It is because of the "azure", because it falls like a glove on the subject of photographs.
It seems to me that I need to experiment with the color-matrix, but picking it up manually - you can sit for a week ..
I really hope for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
derian1337, 2018-10-11
@derian1337

I advise you to use the site of these guys https://filtruem.ru everyone will tell, everyone will show)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question