-modulate and windows syntax

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
f2b
Posts: 12
Joined: 2016-04-02T14:01:02-07:00
Authentication code: 1151

-modulate and windows syntax

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -modulate and windows syntax

Post 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?
snibgo's IM pages: im.snibgo.com
f2b
Posts: 12
Joined: 2016-04-02T14:01:02-07:00
Authentication code: 1151

Re: -modulate and windows syntax

Post 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
f2b
Posts: 12
Joined: 2016-04-02T14:01:02-07:00
Authentication code: 1151

Re: -modulate and windows syntax

Post 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"
f2b
Posts: 12
Joined: 2016-04-02T14:01:02-07:00
Authentication code: 1151

Re: -modulate and windows syntax

Post 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!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -modulate and windows syntax

Post 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.
snibgo's IM pages: im.snibgo.com
f2b
Posts: 12
Joined: 2016-04-02T14:01:02-07:00
Authentication code: 1151

Re: -modulate and windows syntax

Post by f2b »

thanks ! ;)
Post Reply