Shifting "-fill x.png"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
aleb
Posts: 2
Joined: 2016-01-21T05:14:48-07:00
Authentication code: 1151

Shifting "-fill x.png"

Post by aleb »

This draws a white disc on a blue background:

Code: Select all

convert -size 100x100 xc:skyblue -fill white -stroke black -draw "arc  20,20 80,80  0,360" circle.png
This uses circle.png as a "fill color" when drawing a new larger circle:

Code: Select all

convert -size 100x100 xc:none -fill circle.png -draw "circle 50,50 50,10" x.png


In ImageMagick 6.6.9-7 2014-03-06 Q16 everything in x.png looked centered, but now in ImageMagick 6.9.3-0 Q16 x86_64 2016-01-08 the fill content is shifted +10+10. Any way to force the old behavior, or how could I obtain the old result using the new behavior?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Shifting "-fill x.png"

Post by fmw42 »

-fill circle.png
there is no such command -fill that works on an image. the -fill command needs a color as its argument.
aleb
Posts: 2
Joined: 2016-01-21T05:14:48-07:00
Authentication code: 1151

Re: Shifting "-fill x.png"

Post by aleb »

I tried:
- removing "-fill" and also
- using "-fill red" instead of just "-fill",
but x.png is not created and I don't get an error message. There should be an error printed, at least?

Any idea why circle.png appears shifted in the final x.png? I'll dig some more..
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Shifting "-fill x.png"

Post by fmw42 »

Not sure what you are trying to do. But try

Code: Select all

convert -size 100x100 xc:none -fill circle.png -gravity center -geometry +0+0 -compose over -composite result.png
change +0+0 to where you want it offset from the center
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Shifting "-fill x.png"

Post by snibgo »

The documentation on "-fill" says it must be followed by a colour. See http://www.imagemagick.org/script/comma ... s.php#fill

However, this works for me, v6.9.2-5 on Windows 8.1:

Code: Select all

convert -size 100x100 gradient: g.png

convert -size 100x100 xc:none -fill g.png -draw "circle 50,50 50,10" x.png
x.png is then a gradient-filled circle on a transparent background.

This method with "-tile" is documented, and does the same thing:

Code: Select all

convert -size 100x100 xc:none -tile g.png -draw "circle 50,50 50,10" x.png
snibgo's IM pages: im.snibgo.com
Post Reply