Alessandro Polverini on  wrote...
| Hello,
| 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.
|

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.

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.

An example image or explaination what your actually want, prehaps with
small sample images, would be helpful.

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.

Note also that I read each image once only, so it is posible to read the
images from a pipeline, or network source.


  Anthony Thyssen ( Graphics Enthusiast )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
    A picture may be worth a thousand words,
                        but a thousand words use a lot less disk space!
 -----------------------------------------------------------------------------
         IM Examples               http://www.imagemagick.org/Usage/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to