Try the following and let us know if one works ( I am not too sure of the proper clone and delete sequences, myself). I am pretty sure the second one will work. Not so sure about the first and third.

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

(The above probably will not work)

or

convert \( src1.jpg +matte -fill "#RRGGBB" -colorize 100% \)  src1.jpg \
        -compose multiply -composite miff: | \
        convert miff: src2.png -compose atop -composite output.jpg

(The above probably will work).

or

convert \( src1.jpg +matte -fill "#RRGGBB" -colorize 100% \)  src1.jpg \
        -compose multiply -composite \
        +clone -delete 0--2 src2.png -compose atop -composite output.jpg

(The above should work if I have the delete sequence correct).



Note you should also be able to replace src1.jpg on the right side of the top line of each with -clone 0

So the last one would be

convert \( src1.jpg +matte -fill "#RRGGBB" -colorize 100% \)  -clone 0 \
        -compose multiply -composite \
        +clone -delete 0--2 src2.png -compose atop -composite output.jpg



see http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#delete
http://www.imagemagick.org/Usage/basics/#clone
http://www.imagemagick.org/Usage/compose/#compose



I'm starting using imagemagick and after a lot of tests I finally
managed to reach the goal I needed.

But I'm creating 2 intermediate files and I would like to know if it's
possible to "optimize" the steps I do and maybe avoid the temporary
images: I'm getting a lot of difficulties to understand the command line
syntax!

These are the steps I actually do, given as input a color and two
images: src1.jpg and src2.png (this one with transparency)

1) create an image of the same size of src1 filled with color:
convert src1.jpg +matte -fill "#RRGGBB" -colorize 100% tmp1.gif

2) blend the two :
composite -compose multiply tmp1.gif src1.jpg tmp2.png

3) and finally put all together
composite -compose atop src2.png tmp2.png output.jpg

The thing works fine but I would be pleased to know if it's possible to
eliminate one or also both the steps so to optimize things and beginning
to learn advanced use of the command line.

Thanks for any help,
Alex
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to