PIL and antialiasing problem

Laszlo Zsolt Nagy gandalf at geochemsource.com
Thu Dec 2 12:03:57 CET 2004


Hi all,

I have a little problem with PIL. I need to display images in a
browser (thumbnails) (this is the selector window).
I also need the original version of the image to be displayed in a
Java applet.

One example:

thumbnail:  http://designasign.biz/applet/GIF_Small/AIRCRAFT/a10per.png
original:   http://designasign.biz/applet/GIF/AIRCRAFT/a10per.png

I made the thumbnail from the original image using PIL this way:


    im = Image.open(fullpath)
    try:
        im.thumbnail(THUMBSIZE,Image.ANTIALIAS)
        im.save(thumbpath)
    finally:
        del im


If I do not use ANTIALIAS, then I get this:

http://designasign.biz/tmp/a10per.png

With the ANTIALIAS-ed version, the problem is that you cannot see the
lines - they are very light gray, almost invisible. I have many cliparts
with thin lines. However, I also have many cliparts like this:

http://designasign.biz/applet/GIF/AFRICA/angel03.png

I tried to posterize or darken the images but I could not find a good
solution. (I also tried to count the number of colors in the image and
use this info.) Can you suggest an image filter and/or method that creates
darker black lines from the original thin lines? Also it would be
great to have it working with those colorful smudged images. It will
be terribly slow to separate them by hand. There are almost 15000 of
them...

-- 
Thanks,
 Laszlo

mailto:gandalf at geochemsource.com
web: http://designasign.biz




More information about the Python-list mailing list