PIL and antialiasing problem

Belyh G.P. g.belyh at grsu.by
Thu Dec 2 06:37:24 EST 2004


Laszlo Zsolt Nagy wrote:

>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...
>
Photoshop cann't normaly resize
http://designasign.biz/applet/GIF/AIRCRAFT/a10per.png 
too.
But  when I resize this image with bgcolor=white  all done well.
Maybe PIL needed  image with bgcolor  for normal resize.




More information about the Python-list mailing list