Page 1 of 1
composite three images goes wrong
Posted: 2010-04-09T11:55:12-07:00
by st3v3n
i composite three images together and it works pretty damn well - but i have one big problem...
my command looks like this:
composite image.jpg texture.jpg overlay.jpg -compose hard-light output.jpg
which works very, very good BUT the texture image is 1024x1024 and the image.jpg and the overlay.jpg are 256x256px - the resulting image is the texture image with the two smaller images in the top left corner... any idea how i can tell composite to crop down the texture by the size of image.jpg?
thanks so much!
Re: composite three images goes wrong
Posted: 2010-04-09T13:49:47-07:00
by fmw42
I am not sure I understand what you are doing with 3 image composite. The third must be a mask. see
http://www.imagemagick.org/Usage/compose/#mask
Perhaps you can post links to your input and output images.
However, the only way to get the images the same size is to measure them via
size=`convert image -format "%wx%h" info:`
and then use $size for cropping the image subsequently. Neither composite nor convert will do that automatically during a composite operation to my knowledge
Re: composite three images goes wrong
Posted: 2010-04-09T14:06:32-07:00
by st3v3n
the third is a mask - which turned out to be an empty image because my imagemagick version doesnt support "-alpha extract" (kinda sucky)...
well the best output would be having image1.jpg being overlayed with a texture (bigger image as image1.jpg) with ~40% opacity and being hard-light (only on bright colors) overlayed over image1.jpg...
Re: composite three images goes wrong
Posted: 2010-04-11T23:21:07-07:00
by anthony
For older IM's their are a number of ways to extract alpha....
These are details
http://www.imagemagick.org/Usage/channels/#extract
Included in there is one method dating back to IM v5
Three image composition see..
http://www.imagemagick.org/Usage/compose/#mask
was only finalized with proper 'mask based limits' in IM v6.3.5
Before this the mask image was only meged into the alpha channel of the source image
For details of this old version see
Composite Mask Bug
http://www.imagemagick.org/Usage/bugs/composite_mask/
This also details exactly what it does, and what it previously did.
In may ways the mask is applied in much that same way that -mask works for
Image Modification Operators
In limiting what parts of an image can be modified.