line function doesn't work with 16 bit color

Bug #199695 reported by gilf
Affects Status Importance Assigned to Milestone
James Hancock

Bug Description

I've just been trying to learn Python using "How to Think Like a Computer Scientist". I reached this point where it refers to GASP and provides examples:

Unfortunately Gasp wasn't included in the Ubuntu Python so went to FAQ 31 here, had a few false starts downloading and installing, but finally did.

Then tried the first example on that page above, and the circle drew and the box drew but the line errored out with:

>>> Line((100, 400), (580, 200))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/gasp/", line 87, in __init__
  File "/usr/lib/python2.5/site-packages/gasp/", line 180, in create_line
    (end[0], flip_coords(end[1], obj.sprite.rect)), False)
ValueError: unsupported bit depth for aaline draw (supports 32 & 24 bit)

I don't know if this applies but I use a Thinkpad 600E and it has its graphics mode set to 16 bit color -- I have to do that to be able to run reasonably fast in Ubuntu. Other than GASP's line drawing function, I haven't had a single problem running anything else graphically in Ubuntu -- including vector graphics draw programs, 3D CAD renderers, and videos.

In fact the GASP box and circle functions drew fine -- only the line function had this problem.

Computer:Thinkpad 600E, Ubuntu 7.10, Python, 1024 x 768 x 16 bit color

Jeffrey Elkner (jelkner)
Changed in gasp-code:
assignee: nobody → jlhancock
importance: Undecided → High
milestone: none → 0.2
status: New → Confirmed
Revision history for this message
James Hancock (jlhancock) wrote :

To fix this bug you will need to create a pygame.display.Info() instance and use that to find the bit display of the current display window.

then draw lines(blah...) if it is 16 bit
and aalines(blah) for everything else.

James Hancock

Revision history for this message
Nick Fenger (nick-trilliumcharterschool) wrote :

A vertical line works:
A horizontal line works
But, any diagonal line such as:
gives me the "unsupported bit depth" error

Revision history for this message
Luke Faraone (lfaraone) wrote :


Can you see if this is still a problem in GASP 0.3.1?

Changed in gasp-code:
status: Confirmed → Incomplete
Revision history for this message
odavgrsml (owengreensmile) wrote :

the only way it would work is, if it were double the pixel width.

Revision history for this message
odavgrsml (owengreensmile) wrote :

...but only with 16 bits or lower.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.