[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Unwanted blue pixels at edges of antialiased circles



I tried, but I cannot reproduce this. Can you provide any more
information about versions and platforms?

Here's mine:

>>> platform.platform()
'Linux-2.6.35-30-generic-x86_64-with-Ubuntu-10.10-maverick'
>>> sys.version
'2.6.6 (r266:84292, Sep 15 2010, 16:22:56) \n[GCC 4.4.5]'
>>> pygame.ver
'1.9.1release'

I rendered a bunch of circles at various sizes and brightness on a
purple background, like your example:

import pygame
import pygame.gfxdraw

width = 640
height = 480

# canvas
screen = pygame.display.set_mode((width, height))

# background
screen.fill([47, 40, 54])

# dot
y = 32
radius = 4
color = [64, 64, 64, 255]
for radius in xrange(4,20):
    y += 2*radius + 2
    for brightness, x in enumerate(xrange(10,700,2*radius+2)):
        color = [brightness, brightness, brightness, 255]
        pygame.gfxdraw.aacircle(screen, x, y, radius, color)
        pygame.gfxdraw.filled_circle(screen, x, y, radius, color)

pygame.display.flip()
pygame.image.save(screen, "screenshot.png")
raw_input()

This is what I got:

https://lh4.googleusercontent.com/-1WIwoTVKZPk/TiLmc5DifmI/AAAAAAAAA_U/uvawJt7daWE/s800/screenshot.png

Nice visualization, by the way. Very smart-looking.

On Sun, Jul 17, 2011 at 1:32 PM, Marian Steinbach <marian@xxxxxxxxxx> wrote:
> Hi!
>
> I'm new to pygame and just used it for the first time for data
> visualization. See the result here: http://vimeo.com/26157684
>
> The visualization consists of anti-aliased dots in various shades of
> gray on a purple background.
>
> Dark grey dots have unwanted blue pixels on their edges, which I
> cannot explain. You can see them especially in the upper part of the
> video.
>
> Here is what I'm doing to draw the background and dots:
>
> # canvas
> screen = pygame.display.set_mode((width, height))
>
> # background
> self.screen.fill([47, 40, 54])
>
> # dot
> radius = 4
> color = [64, 64, 64, 255]
> pygame.gfxdraw.aacircle(screen, x, y, radius, color)
> pygame.gfxdraw.filled_circle(screen, x, y, radius, color)
>
>
>
> Any ideas where the blue pixels come from?
>
> Thanks!
>
> Marian
>