[Pythonmac-SIG] PIL gui with Panther python?

Kevin Altis altis at semi-retired.com
Sun Jul 11 19:49:26 CEST 2004


On Jul 11, 2004, at 10:20 AM, Ronald Oussoren wrote:

>
> On 11-jul-04, at 19:09, David Eppstein wrote:
>
>> On 7/11/04 6:10 PM +0200 Ronald Oussoren <ronaldoussoren at mac.com> 
>> wrote:
>>> PyObjC currently has no support for PIL images.
>>>
>>> BTW. Why do you have to display PIL images? Cocoa has support for
>>> displaying images and transforming them.
>>
>> I guess I don't, but the code I was porting involved using PIL to 
>> resize and display images.  Does Cocoa have routines for rotation, 
>> antialiased downsizing, and saving back out to jpeg?  I didn't see 
>> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe 
>> I was looking in the wrong place.
>
> I don't know about saving, but I have written a tool that rotates and 
> resizes images. That tool uses NSAffineTransformations to do the job.
>
Just for comparison, wxPython can handle rotation, scaling, and saving 
as well. IIRC, PIL has a better looking anti-aliasing downsizing 
algorithm, but as shown earlier, conversion to and from PIL to and from 
wxPython wxImage/wxBitmap is simple and depending on the type of images 
you're dealing with and percentage scaled you might not be able to tell 
the difference. You can read and save images in all the popular 
formats. For the most part, all these types of operations are one-liner 
method calls. The big plus is that whatever code you write will end up 
working the same on Windows and Linux, not just Mac OS X. Okay, I'm 
done plugging for today ;-)

ka
---
Kevin Altis
altis at semi-retired.com
http://altis.pycs.net/
http://www.pythoncard.org/



More information about the Pythonmac-SIG mailing list