Page 2 of 2

I thought each of R,G & B can vary from 0 to ff not ffff.

Posted: 2009-03-25T05:50:29-07:00
by manit
(Q1)I thought each primary colour has 256 variations in intensity so range 0 to ff.Please clarify.

(Q2)What does alpha mean?

(Q3)my .bat file points to exe file in evry command like
"E:\software\image magick\ImageMagick-6.4.8-9\mogrify.exe" -stroke rgb(191,191,191) -fill rgb(191,191,191) -draw "circle 400,300 400,555" e:\circleseries.bmp
Can i write a script which mogrify can take as input

(Q4)I want to draw circle (on a picture)whose inside is completely transparent to allow the picture behind to be fully visible.

Re: is there a way to draw circles with command?

Posted: 2009-03-25T15:29:20-07:00
by Bonzo
1 #00ff is shorthand for #00000000FFFFFFFF ?

2 Alpha is transparency

3 Why are you using mogrify ?

Code: Select all

"convert -stroke rgb(191,191,191) -fill rgb(191,191,191) -draw "circle 400,300 400,555" e:\circleseries.bmp
Above should work if your installation is correct - although you have not set a background/canvas size or colour.

4 Use -fill for the colour

Re: is there a way to draw circles with command?

Posted: 2009-03-25T18:12:34-07:00
by el_supremo
If you specify #00ff as a colour, IM will interpret it as a 4-bit RGBA colour so r=0,g=0,b=f,a=f. If you are using the Q16 version of IM, this will be expanded to R=0000, G=0000, B=ffff, A=ffff so it is #00000000ffffffff. The Q8 version would use r=00,g=00,b=ff,a=ff. If there had only been 3 hex digits IM would have interpreted it as 4-bit RGB.
If you specify 6 or 8 hex digits, IM interprets it as an 8-bit RGB (6 digits) or RGBA (8 digits) specification. Similarly, 12 or 16 hex digits are interpreted as 16-bit RGB or RGBA.

Pete

Re: is there a way to draw circles with command?

Posted: 2009-03-25T18:14:19-07:00
by el_supremo
convert -stroke rgb(191,191,191) -fill rgb(191,191,191) -draw "circle 400,300 400,555" e:\circleseries.bmp
This should be:

Code: Select all

convert e:\circleseries.bmp -stroke rgb(191,191,191) -fill rgb(191,191,191) -draw "circle 400,300 400,555" e:\circleseries.bmp
Pete

Re: is there a way to draw circles with command?

Posted: 2009-03-26T20:56:14-07:00
by manit
Here is the image Image that I created on varying colour from #11ff to #ffff (i.e the first two characters were only changed).

QUESTION
(Q4 CLARIFIED)I meant that I want to draw circle whose inside is completely transparent so that when I draw it over a image then part of image inside circle is also visible.What should be command?
(Q3 CLARIFIED)By script I mean that does any command accept a script whose statements are sequentially applied over specified image.

Re: is there a way to draw circles with command?

Posted: 2009-03-26T21:24:56-07:00
by fmw42

Re: is there a way to draw circles with command?

Posted: 2009-03-26T22:31:04-07:00
by anthony
Just turn off the fill color using the color 'none' and turn on the border or stroke color using the desired color.

Warning If a stroke color is given it will have a thickness that goes both into and out of the area that would normally be covered by fill. If it is not thick enough it may leave 'gaps' between successive circles. Better to fill the circles from outside in, so as to avoid any possible 'gaps' between colors.

For Expert Usage The circle radius is a floating point operation, so you can draw a circle that is say half a pixel smaller that another circle. You may be able to use that to overlay 'stroked' circles of 1 pixel thickness so as to avoid any 'gaps'.

The location of the circles center (or any other coordinate in drawing operations) are also floating point, but are offset by 0.5 units, so that integer locations align with the center of the corresponding pixel.

That is a circle centered at 10,10 is actually centered in the middle of the 10th pixel from the top and left edges, and as such is really located at 10.5,10.5 in image coordinates. This however is generally only important when converting between drawing coordinates and the coordinates used for image distortions.
A novice practices until he gets it right.
An expert practices until he doesn't get it wrong.

Re: is there a way to draw circles with command?

Posted: 2010-05-22T12:44:31-07:00
by fmw42
Sorry, accidentally posted twice. See next post.

Re: is there a way to draw circles with command?

Posted: 2010-05-22T12:45:45-07:00
by fmw42
manit wrote:I want to know how can I write command to draw circle with given center,radius & colour in a particular image.
This works to draw a circle at 50,50 with radius 30:

convert -size 100x100 xc:skyblue -fill white -stroke red -strokewidth 2 \
-draw "translate 50,50 circle 0,0 30" \
tmp_circle1.png
Image

you can also draw a (semi) ellipse using the two radii (30,20) and center at 50,50:

convert -size 100x100 xc:skyblue -fill white \
-draw "translate 50,50 rotate 45 ellipse 0,0 30,20 180,0" \
tmp_ellipse1.png
Image

Thanks to Anthony for helping to figure this out.

Re: is there a way to draw circles with command?

Posted: 2010-05-24T00:07:32-07:00
by anthony
A whole host of circle drawing methods is given in IM Examples, Drawing on Images, Drawing Circles
http://www.imagemagick.org/Usage/draw/#circles

Some of these worked out by Fred (fmw42)