possible bug convert -compose modulate

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug convert -compose modulate

Post by fmw42 »

IM 6.5.8-9 Q16 Mac OSX Tiger

convert ... -compose modulate does not seem to be working the same as composite -watermark.

This works fine:
composite -watermark 50 -gravity center \
rose: \( logo: -resize 50% \) logo_rose_watermark1.gif
Image

This does not and acts the same as the example below it (as if the arg 50 is not being set or is set to the default of 100x100)
convert \( logo: -resize 50% \) rose: -gravity center \
-compose modulate -set option:compose:arg 50 -composite \
logo_rose_watermark2.gif
Image

composite -watermark 100x100 -gravity center \
rose: \( logo: -resize 50% \) logo_rose_watermark100x100.gif
Image
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug convert -compose modulate

Post by anthony »

I know for a fact that -compose modulate and composite -watermark are the same composition method. You even prove it.
Whcih brings us to the question of why the argument was not passed as expected.

The special setting option however is option:compose:args NOTE the 's' in the name!!!!!
As such you are NOT passing the argument to the 'compose' method correctly.

The problem with -set is it is like just setting a variable. You can set any variable name without error, even if that is not the correct variable name.

The method was a recent addition to IM, to allow the use of the more advanced composition methods in "convert".

My original proposal was to include the argument as part of the -compose setting... EG: "-compose modulate,50" But this was vetoed by Cristy ('Magick' on the forums), the IM programming coordinator. As such the "-set option:..." method was used, somthing that is normally only used for 'expert options' and 'overrides'. Not for a setting that is actually 'required' as is the case with the compose arguments. Actually I still prefer the -compose style for this reason, but I can't change this unless Cristy (Magick) OK's it.

Problably an error check should be made at the -composite operator that the 'compose:args' option has been set for the specific compose methods that need such an argument. But currently this is not done.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug convert -compose modulate

Post by fmw42 »

The special setting option however is option:compose:args NOTE the 's' in the name!!!!!
As such you are NOT passing the argument to the 'compose' method correctly.
OOPS :oops: I never noticed that. How embarrassing! I spent quite some time testing and never thought about the plural on args. I think I copied and pasted and missed the final "s". It does work correctly after fixing the spelling on args.

Thanks. Sorry for the false alarm.

Fred
Post Reply