[Zope] PIL, ImageTag, compression, antialias and mode

Ausum Studio ausum_studio@hotmail.com
Wed, 20 Nov 2002 10:13:03 -0500


For PIL specific questions you may want to search the Image-SIG list,
searchable through ActiveState's ASPN:
http://aspn.activestate.com/ASPN/Mail/Archives/image-sig/

Information and suscription:
http://mail.python.org/mailman/listinfo/image-sig

As it was treated here before, it is known that current PIL's antialiasing
is not as good as ImageMagick's, when compared one to one. For smoother
results and better overall image quality, try IM instead.



Ausum




----- Original Message -----
From: "Jaroslav Lukesh" <lukesh@k-net.cz>
To: <zope@zope.org>
Sent: Wednesday, November 20, 2002 9:21 AM
Subject: [Zope] PIL, ImageTag, compression, antialias and mode


> Hi all,
>
> I was done thumbnail images. I find that ABSOLUTELLY BEST ONE and
UNIVERSAL
> is ImageTag (called) "hotfix" (I was walk through whole zope mailinglist
> archive too).
>
> For those like me, creating+auto_caching of thumbnails are:
> <img src="image.jpg/thumb?width=150&height=300">
>
> But I do not know how:
>
> * I can give compression level and compression type (huffman_optimized,
> progressive level) for JPEG files
>
> * I want to add antialiasing (I have PIL 1.1.3/W32 installed)
> im.resize((width,height),PIL.Image.ANTIALIAS)
> = it does not work for me with image.thumbnail :((
> but I can do something wrong, I'm not familiar with Python (it is not 8048
> assembler 8-))
>
> * I want original file format (last line from codes below)
>
> * If I will update source image, how to tell to Cache for Invalidate?
>
> Original part from ImageTag "hotfix" __init__.py:
>         #create a thumbnail image file
>         original_file=StringIO(str(self.data)) #use str() in case data is
> Pdata
>         image=PIL.Image.open(original_file)
>         image=image.convert('RGB')
>         image.thumbnail((keys['width'],keys['height']))
>         thumbnail_file=StringIO()
>         image.save(thumbnail_file, "JPEG")
>
> I would be very happy if you could help me with corrections and add
> compression level option:
>
>         #create a thumbnail image file
>         original_file=StringIO(str(self.data)) #use str() in case data is
> Pdata
>         image=PIL.Image.open(original_file)
>         image=image.convert('RGB')
>
image.thumbnail((keys['width'],keys['height']),PIL.Image.ANTIALIAS)
>         thumbnail_file=StringIO()
>         image.save(thumbnail_file, image_type)
>
>
> Many thanks for your kindly assistance.
>
> J. Lukesh
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>