Page 1 of 1

Shifting "-fill x.png"

Posted: 2016-01-21T07:33:59-07:00
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?

Re: Shifting "-fill x.png"

Posted: 2016-01-21T10:00:08-07:00
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.

Re: Shifting "-fill x.png"

Posted: 2016-01-23T17:33:36-07:00
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..

Re: Shifting "-fill x.png"

Posted: 2016-01-23T17:41:42-07:00
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

Re: Shifting "-fill x.png"

Posted: 2016-01-23T17:52:06-07:00
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