Bit depth in line

Asked by gilf

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 downloadinf 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. Please don't obsolete people like us in the name of graphics progress! -- other than GASP's line drawing function, I haven't had a single problem running anything else in Ubuntu -- including videos, and a VMware virtual machine for win98se.

In fact your box and circle drew fine -- only the line had this problem -- if GASP is simple old-style graphics for educational purposes, seems like even 8 bit color ought to work! :) (I used to use a TRS-80, and an Amiga, so I remember -- well, of course even the IBM-PC CGA back then.) Do we really need 24 million shades for a simple line? I don't mind choosing from 65535.


Question information

English Edit question
GASP Core Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Thomas Doggette (tdoggette) said :

Kind Sir,

Please accept our humble apologies, but both GASP and HTTLACS are in a constant state of flux. In fact, GASP is broken at the moment. We will have a functional version (and corresponding documentation in the book) by the end of the PyCon sprint on 20th March.

The GASP team

Revision history for this message
gilf (skiprock) said :

Please don't apologize! You provide a wonderful service ot others in trying to help them to learn to program, and you do it as volunteers. My feeling was only that I wanted to make the (slightly tongue in cheek) case for simple graphics, so my wonderful old computer wasn't left behind in the dust of modern video megaprocessors. I'm sure that wasn't your intent, of course -- sometimes we dramatize our hopes.

But, certainly, no apologies, please for helping others as you do, even if you do decide to drop 16 bit support. I'm still a fan of open source volunteerism.

I'm clicking "problem solved" ,even though I hope you will make it possible to draw 16 bit lines with GASP. The question was still answered.

Should I enter the line request anywhere else?

Revision history for this message
Thomas Doggette (tdoggette) said :

There's little risk of lower-end hardware being left in the dust-- one of our primary targets for this software is the OLPC. As to bit depth, file a bug report: the more feedback, the better, and we'll see what we can do.

Revision history for this message
gilf (skiprock) said :

Thanks. Bug report opened here: