Strange "add" behaviour

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

Re: Strange "add" behaviour

Post by snibgo »

There are many ways of making an image grayscale (ie removing the colours). One is to lower the saturation: "-modulate 100,0,100".

For example:

Code: Select all

convert in.png -modulate 100,0,100 out.png

Code: Select all

convert %1 ( %2 -modulate 100,0,100 ) ( %3 +level 0,80% ) -compose Over -composite %4
snibgo's IM pages: im.snibgo.com
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Thank you again. :)

convert %1 ( %2 -modulate 100,0,100 ) ( %3 +level 0,80%% ) -compose Over -composite %4

This special command line doesn´t work as intended, it results in a greyscaled camo pattern. ;)

But I changed it a little so it composes a greyscaled image of itself onto the coloured original. It patches "grayscale" instead of camo onto the tank. And that I can paste coloured camo on as usual. It´s not as elegant but it works. :)

convert %1 ( %1 -modulate 100,0,100 ) %3 -compose Over -composite %4

It seems all that easy when you folks do it. To me it´s all mystery and sorcery. Image
Post Reply