Page 1 of 1

tiling trouble

Posted: 2011-12-26T07:45:23-07:00
by imaggie
Hi,

I need to tile a new image with a repeated section of a base image. I can't seem to get the right syntax for any of the many ways to do tiling.

So far I can crop the bit I need and create an image with one copy but cannot tile it.

Code: Select all

convert  -size $((5*$wid))x$((5*$ht)) xc:black \
 tile.png  -crop 50%x25%+25%+5% \
 -compose Over -composite \
 tiled-tile.png
Could someone point me in the right direction?

Thanks

Re: tiling trouble

Posted: 2011-12-26T11:29:00-07:00
by fmw42
I am not sure I understand what you are trying to do. Is it that you want to crop the tile.png image and then tile it out over the base black image? Please clarify. In the mean time, see http://www.imagemagick.org/Usage/compose/#tile and http://www.imagemagick.org/Usage/canvas/#tile_memory


try

convert tile.png -crop ... +repage -write mpr:tilepng +delete \
-size ... xc:black tile:mpr:tilepng \
-compose over -composite \
test.png


Also note that geometry offsets (in your -crop) will not be interpreted as %, but as raw coordinates even if you specify the percent sign. This is not the case for width or height, only +X+Y. See http://www.imagemagick.org/script/comma ... p#geometry

Re: tiling trouble

Posted: 2011-12-26T12:52:57-07:00
by imaggie
thanks again.

that's the second biggest problem with IM , the doc is about an anarchistic as the syntax. If found the "doc" for the tile option but it was so brief as to be useless.

http://www.imagemagick.org/script/comma ... .php?#tile

There has clearly been a huge amount of work gone into writing all this stuff but it seems you need to read the whole lot to get anywhere.

-tile links to composite which is so brief it is barely any help and then links back to -tile...

I usually find I have to start googling and sifting through various examples in the hope of _devining_ what the syntax definition of a particular command is.

I'm starting to get a feel for what xc can do but despite a huge amount of reading I have not seen definition nor do I have any idea what why it's called xc.

Finally I found a different way to do my tiling:

Code: Select all

convert \
  tile.png -crop  25%x25%+20%+20%  -write mpr:tile +delete  \
 \( -size $((5*$wid))x$((5*$ht)) tile:mpr:tile \) \
 tiled-tile.png
You'll probably now tell me that the percent only works on the 25 and not the offsets , right ? ;)

Re: tiling trouble

Posted: 2011-12-26T15:35:17-07:00
by fmw42
xc I believe came from x color as many of the names of colors came from X11 colors or CSS colors.

Re: tiling trouble

Posted: 2011-12-26T15:36:02-07:00
by fmw42
xc I believe came from x color as many of the names of colors came from X11 colors or CSS colors. You can also use canvas: in place of xc: on newer IM releases.