python image library making dotty gifs
lard at tardis.ed.ac.molar.uk
Fri Jun 25 13:33:02 CEST 2004
I'm using python image library 1.1.4 (http://www.pythonware.com/products/pil/)
to plot images.
However, when I save an image to a gif file, it comes out very dotty/ithered
looking, even if it's a picture consisting only of one colour!
Here's some example code that produces a dotty gif:
# pymand joy!
im = Image.new("RGB", (imageWidth, imageHeight))
draw = ImageDraw.Draw(im)
for y in range (0,imageHeight):
for x in range (0, imageWidth):
draw.point((x, y), (128,128,128))
# saving as a gif comes out dotty/dithered looking!
you can see the output gif here:
what causes the dottyness, anyone know?
More information about the Python-list