Page 1 of 1

How can I add a Background Tile to a transparent Image?

Posted: 2013-11-12T00:53:42-07:00
by chris-at
I want to add a tiled background to a transparent image.

According to the docs this should do it:

Code: Select all

convert test.png -texture paper.png result.png
I also tried other variations (with -composite, -flatten, -tile, etc.) but result.png is either still transparent or just gets a white background.

ImageMagick-6.8.7-5 on Windows.

Re: How can I add a Background Tile to a transparent Image?

Posted: 2013-11-12T01:29:12-07:00
by snibgo
I think texture is just for the display program.

To make an image say 600x400 pixels containing paper.png tiled:

Code: Select all

convert -size 600x400 tile:paper.png result.png
See http://www.imagemagick.org/Usage/canvas/#tile

Re: How can I add a Background Tile to a transparent Image?

Posted: 2013-11-12T02:52:56-07:00
by chris-at
Thank you, I got it working with:

Code: Select all

convert -size 4096x4096 tile:paper.png test.png -flatten result.png 
But is it possible to take the size from test.png instead?

Re: How can I add a Background Tile to a transparent Image?

Posted: 2013-11-12T03:59:05-07:00
by snibgo

Code: Select all

convert test.png -tile paper.png -draw "color 0,0 reset" result.png