Page 1 of 1

Image "pile" cutting off on edges

Posted: 2017-11-09T11:25:32-07:00
by chowbok
I'm using ImageMagick 6.9.9-22 Q16 on Linux. I'm trying to create an image that looks like a pile or stack of images. I'm using a variation of the command found at http://www.imagemagick.org/Usage/thumbnails/#polaroid :

Code: Select all

convert 0195.png \
   -bordercolor none -background none -rotate $(convert null: -format '%[fx:rand()*30-15]' info:) +repage \
   \( 0194.png -bordercolor none -background none -rotate $(convert null: -format '%[fx:rand()*30-15]' info:) +repage \) -gravity center -composite \
   \( 0193.png -bordercolor none -background none -rotate $(convert null: -format '%[fx:rand()*30-15]' info:) +repage \) -gravity center -composite \
   \( 0192.png -bordercolor none -background none -rotate $(convert null: -format '%[fx:rand()*30-15]' info:) +repage \) -gravity center -composite \ 
   +repage -flatten +repage -background black \( +clone -shadow 60x4+4+4 \) +swap -background none -flatten stack.png
This almost does what I want, but it's cutting off the left and right edges and I'm not sure why. How can I change this command so that it makes the resulting canvas as wide as is necessary?

Re: Image "pile" cutting off on edges

Posted: 2017-11-09T11:30:25-07:00
by chowbok
In case it's relevant: the source images will always have a height of 300px, but the widths will vary.

Re: Image "pile" cutting off on edges

Posted: 2017-11-09T11:57:46-07:00
by snibgo
Without looking in detail, I notice you "-composite" each image. The output of "-composite" will have the same dimensions as the first input. Is that what you want? If not, perhaps "-layer merge" is more suitable. See http://www.imagemagick.org/script/comma ... php#layers

Re: Image "pile" cutting off on edges

Posted: 2017-11-09T12:50:20-07:00
by chowbok
Perfect! (It's -layers, not -layer, though.) Thanks so much!

Re: Image "pile" cutting off on edges

Posted: 2017-11-09T13:36:24-07:00
by snibgo
Ha, yes, "-layers", sorry.