Author Topic: Are perfectly symmetrical circles impossible to create?  (Read 11887 times)

0 Members and 1 Guest are viewing this topic.

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #20 on: December 20, 2007 »

I have considered anti aliased circles but those crazy nit-picking pixel artists like to have full control of every pixel. I myself like to use low color counts in my images just for the challenge. Most of the time I try to keep individual colors in an image down to below 12 or so, just crazy self imposed rules. There is a certain charm to working within frustrating constraints. I myself don't usually dither but many of my fellow pixel artists will spend hours hand dithering an image with no mathematical understanding. The same goes for anti aliasing.


You can poke around a bit here : http://www.pixeljoint.com/default.asp

Be forewarned that the forum section is full of retards with loud mouths and faulty opinions and most of the mods are not much better.
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #21 on: December 20, 2007 »
[Offtopic, hopes its alright] Which drawing program are you using now, and what kind of drawing program do you need this circle code for?  I have been thinking about doing a DeluxePaint like windows version with fixed palette (256 colors and less) and geared towards pixel pushing, but I do not know if there is any need for such program. I have the basic framework for it coded, but still needs various tools coded.

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #22 on: December 20, 2007 »
Ah ok, I see now.

For the antialiasing I had to check which of each pixels corners were within the circles radius and have come up with a similar idea for what you're looking for:

Code: [Select]
sub draw_circle(byval cx as single,byval cy as single,byval rad as single,byval argb as unsigned integer)
   
    dim as single s=int(rad+1.0)
    dim as single rad2=rad*rad
    dim as single dy=cy-int(cy-0.5)
    dim as single dx=cx-int(cx-0.5)

    dim as integer corner_count

    for y as single =-s-dy to s-dy step 1.0
        for x as single =-s-dx to s-dx step 1.0
   
            corner_count=0

            if (x*x+y*y)<=rad2 then corner_count+=1
            if ((x+1.0)*(x+1.0)+y*y)<=rad2 then corner_count+=1
            if (x*x+(y+1.0)*(y+1.0))<=rad2 then corner_count+=1
            if ((x+1.0)*(x+1.0)+(y+1.0)*(y+1.0))<=rad2 then corner_count+=1
   
            if (corner_count and 2) then pset(int(x+cx),int(y+cy)),argb

        next
    next
   
end sub

« Last Edit: December 21, 2007 by Stonemonkey »

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #23 on: December 20, 2007 »
[Offtopic, hopes its alright] Which drawing program are you using now, and what kind of drawing program do you need this circle code for?  I have been thinking about doing a DeluxePaint like windows version with fixed palette (256 colors and less) and geared towards pixel pushing, but I do not know if there is any need for such program. I have the basic framework for it coded, but still needs various tools coded.

Naw this is still on the topic I think. There is quite a need for this. MS Paint does everything I want except draw proper circles every time. If you really wanted to add some cool feaures you might look into making some pixel art isometric construction tecniques. Things like constructing an isometric cube or perhaps inscribing an isometric ellipse within the faces of said cube. The biggest complaint in isometric is the lack of good circles. Nobody quite knows how to construct them well. They just poke around and guess at what they might look like. I made a program that drew rotated ellipses but again they came out like my horrid polygonal and malformed circles. Some default dithering fills would be cool too. The biggest aspect of pixel art is visual correctness over mathmatical accuracy. The circles being a prime example. The isometric grid has lines that go up one pixel and over two the angle formed might repeat I don't know but it is best to just think in terms of rise and run rather than the angle formed.

Thoughts

Most images are saved as .png (lossless formats only)
Sometimes artists use hue shifts within light gradients (could be tinkered with in a color chooser)
Shape tools cannot produce clusters of three or more pixels except at intersections


Probably more little things too here is a simple (very) scene based on the pixel artist's isometric projection

The grid lines have a projected slope of 1/2. It would be really cool to have a tool that produced isometric circles, many times you might want to make a pipe coming out of a wall or other such things and it is very hard to freehand correctly. Imagine a cube drawin in this perspective with a circle on each face. I've solved the code myself but sadly the isometric circles always had clusters of pixels because I was using a polygon with center point algorithem. An isometric ellipse has an axis ratio of 2:1. Paint can do everything I need as a pixel artist except produce some isometric calculation and circles. Should you build such a pixel art program you may he hailed as some sort of a diety by thousands. So basically your paint program should be like MS Paint with some artist friendly features built in.

Annnnnnyyyyyywayyyyyy the scene:



« Last Edit: December 20, 2007 by Pixel_Outlaw »
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #24 on: December 20, 2007 »
The Christmas holiday is coming up, 11 days off from work :)  I might look into getting back to that Dpaint program after all. Its something I had been thinking about doing years back, but never got around to do. And I have done other programs with pixel editing and effects. Perhaps you are right, perhaps there is a need for a specialized iso-pixel drawing tool. I am really amazed at what some of those pixel artists can produce. It must take forever to draw, especially those huge drawings with part of cities and such. I will give this some thought and I might end up taking some time out during the vacation to work on this. Its not like I have other plans anyways, only on christmas eve and new years, so I still have 9 days to kill.

One question to begin with would be: Do you think people would want a fixed palette (eg. containing 256 colors picked by themselves as an example via a color gradient tool), or should it be true color with all colors available at any time?

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #25 on: December 20, 2007 »
Well most people like their million color choices. I personally would like 256 color mode. Which brings me to another must have, savable color palettes. Paint never allows to save the palette which is very frustrating. I would advise that you have savable palettes that could be loaded independantly of images. Also it might be cool to have some palette options like converting an image into a palette and forcing a palette to an image. Many ideas here. :D I think you might start a new project thread where we can focus on features. This way there won't be walls of text to slog through.
Challenge Trophies Won:

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #26 on: December 26, 2007 »
Draw 90 degrees of the circle and then just mirror it.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Are perfectly symmetrical circles impossible to create?
« Reply #27 on: December 26, 2007 »
Combine that with Bresenham's Circle Algorithm and you will get perfect circles every time.

Jim
Challenge Trophies Won: