composing more than 2 images
Posted: 2009-07-21T12:24:08-07:00
I am having some trouble with the -compose syntax, and need a hint.
Here is a modified example of what I want to do:
overlay an image with a vertically compresssed altered copy and a horizontal compressed altered copy of itself
-->
first attempt:
This does of course not work: the first -composite uses the third image on the stack as a mask.
(Using -flatten instead of -composite works, but that ignores the gravity setting, and would not work if I wanted some other composition method like blend or multiply)
This of course does not work either: the -clone 0 clones the already altered image, not the original.
This seems inelegant, the source image has to be read twice. Nevertheless it should work, and it does indeed work if I use the internal "rose:" image, or a png. But if I use a JPG file, I get the error
Here is a modified example of what I want to do:
overlay an image with a vertically compresssed altered copy and a horizontal compressed altered copy of itself
-->
first attempt:
Code: Select all
convert ROSE.JPG
( +clone -scale 10x100% +dither -colors 2 -equalize )
( -clone 0 -scale 100x10% +dither -colors 2 -equalize )
-gravity center -compose copy -composite -composite ROSECROSS.JPG
(Using -flatten instead of -composite works, but that ignores the gravity setting, and would not work if I wanted some other composition method like blend or multiply)
Code: Select all
convert ROSE.JPG
( +clone -scale 10x100% +dither -colors 2 -equalize )
-gravity center -compose copy -composite
( -clone 0 -scale 100x10% +dither -colors 2 -equalize )
-composite ROSECROSS.JPG
Code: Select all
convert ROSE.JPG
( +clone -scale 10x100% +dither -colors 2 -equalize )
-gravity center -compose copy -composite
( ROSE.JPG -scale 100x10% +dither -colors 2 -equalize )
-composite ROSECROSS.JPG
Code: Select all
convert: Cannot quantize to fewer than 8 colors `ROSE.jpg' @ jpeg.c/EmitMessage/231.
convert: missing an image filename `ROSECROSS.JPG' @ convert.c/ConvertImageCommand/2772.