Page 1 of 1

composing while distorting multiple images

Posted: 2011-06-18T23:09:46-07:00
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

Re: composing while distorting multiple images

Posted: 2011-06-19T01:12:42-07:00
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.

Re: composing while distorting multiple images

Posted: 2011-06-19T10:43:13-07:00
by javismiles
thank you very much Anthony, will give it a try
and see how it goes
thank u :)