composing while distorting multiple images

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?".
Locked
javismiles
Posts: 180
Joined: 2010-11-27T01:42:06-07:00
Authentication code: 8675308

composing while distorting multiple images

Post by javismiles »

quick question if possible,
im doing succesfully a distortion of an image combined with many others, like this

$command= 'convert '.$base.' ( '.$source1.' -matte -virtual-pixel transparent +distort Perspective "'.$points.'" ) ( '.$source2.' -matte -virtual-pixel transparent ) ( '.$source3.' -matte -virtual-pixel transparent ) -compose over -layers merge '.$target;

the question is, some of those images i need to compose them using screen or multiply blending modes for example, i know how to use the modes using the operator

composite -compose Screen

but i cannot manage to mix that with the previous command, how can i for example apply the (composite -compose Screen) to the $source1 part of the command ( '.$source1.' -matte -virtual-pixel transparent +distort Perspective "'.$points.'" )
and not to the rest,

cause i know i can add it at the very end to apply it to all of it, but i want to apply for example a screen or multiply just to one of them, how can i do that?

thanks very much
jav

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composing while distorting multiple images

Post by anthony »

The -layers merge basically generates a 'background image' of the appropriate size, then composes each image onto that background using the compose setting that is attached to the images concerned.
This is so it can handle the compose settings attached to images read in from gimp and photoshop saves.

So you can either create a background image and DIY each of the compositions yourself, OR you can assign a -compose setting to each image and then use the layers operator.

However I have not tested assigning different compose settings to each image. This is something that I have planed to look into at some point. but has not been a high priority.

I recommend the DIY approach (compose each image as you create it) as it is more likely to work, and also means you don't have multiple images hanging around in memory until the end.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

javismiles
Posts: 180
Joined: 2010-11-27T01:42:06-07:00
Authentication code: 8675308

Re: composing while distorting multiple images

Post by javismiles »

thank you very much Anthony, will give it a try
and see how it goes
thank u :)

Locked