# Improved circle drawing algorithm?

## Recommended Posts

Hey everyone. First off I'd like to thank everyone involved in the development of Paint.NET for making such a great piece of software. You guys rock. However I do have a very nitpicky problem with the ellipse drawing algorithm:

As you can see, circles often end up asymmetrical and discontinuous. This isn't noticeable at larger sizes, but can be important to people working with a smaller area (pixel artists for instance).

I think the solution to this would be to implement some sort of octant-mirroring solution as described here. I've used this technique myself in a couple of small applications and it works great.

Thanks!

##### Share on other sites

Does that also happen when you hold shift while using the ellipse tool?

##### Share on other sites

One thing that I observe on the web page linked to,

is that the circle drawn is always formed with an odd number

of pixels as diameter.

This allows for an even number of pixels on either side of both

the vertical and horizontal center lines.

Your posted image is on a 16x16 canvas, even numbered.

When I make a circle to fill a 16x16 canvas it tends to be asymmetrical.

When I make a circle to fill either a 15x15 or 17x17 canvas

it's always symmetrical.

##### Share on other sites

Does that also happen when you hold shift while using the ellipse tool?

Depends on the size of the ellipse. I thought it might only be with odd numbered dimensions, but a quick test shows that it still affects some even numbered dimensions (14x16 for instance).

One thing that I observe on the web page linked to,

is that the circle drawn is always formed with an odd number

of pixels as diameter.

This allows for an even number of pixels on either side of both

the vertical and horizontal center lines.

Your posted image is on a 16x16 canvas, even numbered.

When I make a circle to fill a 16x16 canvas it tends to be asymmetrical.

When I make a circle to fill either a 15x15 or 17x17 canvas

it's always symmetrical.

That's a good point. I've never had that problem using the algorithm myself, perhaps it'd make sense to check for even numbered dimensions and then apply symmetry.

##### Share on other sites

Hi everyone,

I'm with the thread creator on this one. I love PDN but circle shapes and selections are the only thing that bothers me.

Can you remake it so that a circle is horizontally AND vertically symetric please?

Here are some screenshots of the problem:

Thanks a lot!

Edited by OrangePikmin

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×