Page 1 of 1

-modulate and windows syntax

Posted: 2016-04-29T01:36:23-07:00
by f2b
Hello!

When i try to modulate saturation only, ( -modulate 100,0,100 ) it's ok

But when i try to modulate brightness and saturation at the same time, the resulting image is wrong. For example i can not desaturate the image and lower its brigtness near 0, so it should appear very dark. Actually It appear only a little darker and not desaturated at all...

Here is my syntax:

%imagickPath%convert %file% -modulate 10,0,100 -quality 70 "output.jpg"

Thanks for you help

Re: -modulate and windows syntax

Posted: 2016-04-29T03:51:42-07:00
by snibgo
It works fine for me, on IM v6.9.2-5 on Windows 8.1, eg:

Code: Select all

convert rose: -modulate 10,0,100 -quality 70 r.jpg
The result is, as expected, almost black, with no colour.
What version of IM are you using?

Re: -modulate and windows syntax

Posted: 2016-04-29T03:54:26-07:00
by f2b
In fact, to clarify my last explanation, when i set brightness value below 100 my result become darker untill i decrease to 50

when i set brightness value below 50 the result appear is brighter and more saturated , and so on, untill i set brightness to 0, at this point the result is similar to the input image...

it's very confusing

i use ImageMagick-6.9.3-7-portable-Q16-x64

Re: -modulate and windows syntax

Posted: 2016-04-29T04:05:55-07:00
by f2b
indeed your code works also for me... so i guess something is wrong in my syntax... here is the whole code, i use a mask to apply the modulate effect

%imagickPath%convert "img1.jpg" "layer.psd" -composite ^
^( "img2.tif" -sigmoidal-contrast 3.5 ) -composite ^
^( +clone "mask.psd[1]" -define modulate:colorspace=HSL -modulate 10,0,100 ^) -composite ^
-quality 70 "result.jpg"

Re: -modulate and windows syntax

Posted: 2016-04-29T04:16:03-07:00
by f2b
ok i've found the problem, modulate apply to mask and not image+mask combined... pasted the modulate just after the clone and all is fine!

Re: -modulate and windows syntax

Posted: 2016-04-29T04:18:55-07:00
by snibgo
Good stuff, glad you've solved it. I'll post this anyway:

I suggest you use "+write" to see the intermediate result, eg change the third line to:

Code: Select all

^( +clone "mask.psd[1]" -define modulate:colorspace=HSL -modulate 10,0,100 +write x.png ^)
x.png should look like mask.psd[1] but grayscale, nearly black.

The documentation http://www.imagemagick.org/script/comma ... p#modulate says the colorspace should be set like ths:

Code: Select all

-set option:modulate:colorspace HSL
But the default is HSL, so if yours is wrong, it won't matter.

Re: -modulate and windows syntax

Posted: 2016-04-29T04:41:31-07:00
by f2b
thanks ! ;)