Page 1 of 1

Create multiple images on a canvas at once?

Posted: 2017-10-23T00:01:12-07:00
by juman
I'm trying to generate one image by creating multiple images in one command and placing them on a canvas.

So in short what I want to do is define a white background area, create another image and position that on the background and then create another image and then place that on the background and then flatten the whole image and save as one.

So I thought this would work :

Code: Select all

convert -size 4500x4500 xc:white \( -size 400x400 xc:red \) -geometry +500+900 \( -size 400x400 xc:blue -rotate 45 \) -geometry +200+200 -layers flatten a_new.png
In the final result I only see the blue square and it is not positioned at +200+200. Only using the first parentheses I get the red square but not in the right position. Any ideas one what I am missing?

Re: Create multiple images on a canvas at once?

Posted: 2017-10-23T00:27:29-07:00
by snibgo
To position images, "-layers" uses page settings, not geometry.

When using "-geometry", you should do a "-composite" after each geometry.

Re: Create multiple images on a canvas at once?

Posted: 2017-10-23T00:42:11-07:00
by juman
I tried changing geomtry to page instead and now it moved the blue one. But the red one still doesn't appear?

Re: Create multiple images on a canvas at once?

Posted: 2017-10-23T00:56:35-07:00
by snibgo
Use "-repage", not "-page", and put that within the parentheses, like this (bash syntax):

Code: Select all

convert -size 4500x4500 xc:white \( -size 400x400 xc:red -repage +500+900 \)
 \( -size 400x400 xc:blue -rotate 45 -repage +200+200 \) -layers merge x.png

Re: Create multiple images on a canvas at once?

Posted: 2017-10-23T10:26:28-07:00
by fmw42
Please do not post multiple times with the same question.