[magick-users] GetFillColor and extract_info

Rick Mabry rmabry at sport.rr.com
Thu Dec 21 00:08:00 CST 2006


> Setting a tile pattern in this way just does not seem effect the offset
> of the pattern.

It can, but it didn't work the way I expected. The following show some 
effects that give enough of a clue how it works:

convert -size 640x480 xc:blue -tile logo:[640x480+100+100] \
	-draw "polygon 20,20 619,20 619,459 20,459" drawtest.png

Then try the same with -100-100 in place of +100+100.
Both give something different than an offset-less tile.

>From omicronpersei8 in the first reply:

> >  why not post a few lines of code of how you'd like to take advantage of
> a pattern offset and we'll figure out a way to define new members to the
> draw_info structure and a way to set the members in Magick++. 

What I had in mind was something like

convert -size 640x480 xc:blue -tile logo: -offset +200-100 \
	-draw "polygon 20,20 619,20 619,459 20,459" drawtest.png

or, in PerlMagick,

$image->Draw(primitive=>'polygon', points=>"20,20 619,20 619,459 20,459",
	offset => "+200-100", tile=>$tile); 

to achieve the result equivalent to doing a -roll operation on the -tile 
image, but without the overhead.

This is  a bit  beside the point, but even doing it with a roll is awkward 
from the command line; I haven't found a way to do it as a one-liner. I 
thought this would work but it doesn't:

convert -size 640x480 xc:blue ( -tile logo: -roll -200+100 ) \
	-draw "polygon 20,20 619,20 619,459 20,459" drawtest.png

In any case, in PerlMagick I can do a RollImage prior to the DrawImage but it 
is still not the best way, since it makes no sense to have to move pixels 
around  in the $tile image. A drawing offset is just right, very efficient. 

Rick



More information about the Magick-users mailing list