[magick-users] Help with syntax

Alessandro Polverini alex at nibbles.it
Mon Feb 25 01:20:50 PST 2008


Anthony Thyssen wrote:
> It should be very posible to do all the steps in one command.
>
> But before I do, what is the 'multiply' step trying to achieve.
>
> It is it just a dimming of the image to a specific color, why not
> just use -colorize directly.
>   
I suppose it is and I need to mantain the transparence.

> Also why use 'atop' which as your starting image is JPEG, there is no
> transparency involved, so it is equivelent to a 'over' the default
> composition operation.
>   
Source Image is a jpg but it's composed with an image (src2) that has 
*only* the transparence channel.

> An example image or explaination what your actually want, prehaps with
> small sample images, would be helpful.
>   
I put two image examples here:
http://nibby.nibbles.it/imagemagick/src1.jpg
http://nibby.nibbles.it/imagemagick/src2.png

> In any case here is YOUR commands as a single command.
> Note multiply is associative, image order does not matter when that are
> the same size.
>
>   convert src1.jpg \( +clone +matte -fill "#RRGGBB" -colorize 100% \) \
>           -compose multiply -composite \
>           src2.png  -compose atop  -composite   output.jpg
>
> I can not test this without sample images.
>   
That works fine, thanks so much.

I've a lot of difficulties to grasp the syntax, tough :(
I would be pleased to understand the processing of this example...

On a related note I tried to simplify another process that is very 
similar to the thing you describe at the beginning of the message: 
colorize the transparent image with a certain color.

I now do these two steps:

convert src2.png +matte -fill "#ff0000" -colorize 100% color.gif
composite -compose atop src2.png color.gif output.jpg

I tried to adapt the example above in this way:

convert src2.png \( +clone +matte -fill "#FF0000" -colorize 100% \) 
-compose atop -composite output.jpg

but it does not work: I just get a filled red box instead.
That's what I mean when I say I can't understand the way the input line 
is processed :-(

Thanks for any help!
Alex



More information about the Magick-users mailing list