[Image-SIG] Re: anyone knows a imlib2 extension for python?

alex alex <nowhere@phobgate.de>
Fri, 23 May 2003 13:56:26 +0200

in pil i missed 2 things:

1. pil doesn't has a blur function. i need blur (or similar) to create 
'shadow' for strings on buttons. example: draw text with transparency of 
30%, blur it, then copy on button. the draw same text (3px left, 3px up to 
posion of shadowed text) and voila: text + shadow (german: schlagschatten)
that's how i did it with imlib2. that's the only use of blur, if there's a 
function in pil to create same effect i'd be happy.

2. pil supports true type fonts only in commercial version. so i tried to 
convert pcf/bdf font to .pil format, but i got this error:

(amsel)[/otto/test] python /usr/local/share/examples/PIL/pilconvert.py 
cour1.pcf cour1.pil
cannot convert image (exceptions.IOError:cannot identify image file)

then i used pcf2bdf to convert .pcf font to .bdf, but again:

(amsel)[/otto/test] python /usr/local/share/examples/PIL/pilconvert.py 
cour1.bdf cour1.pil
cannot convert image (exceptions.IOError:cannot identify image file)

even if it would have converted successfully: i don't know much about 
pcf/bdf fonts, but as far as i can see i have to generate one font file for 
every size of a font i want to use, that's no fun. when using a ttf capable 
image lib i could just upload another .ttf font and use it (with any size) 
right away without having to generate font files for several font sizes and 
then convert them to .pil format.

yes, i know that pil (and the other image libs i tested) can do much more 
than just creating some silly buttons for a web page, but that's the only 
thing i need an image lib right now.


--On Freitag, 23. Mai 2003 13:06 +0200 Fredrik Lundh 
<fredrik@pythonware.com> wrote:

> "alex" <nowhere@phobgate.de> wrote:
>> i'm looking for an python extension to create buttons for a web page on
>> the fly, including ttf support and blur() function, but haven't found
>> one. also i need conversion from jpeg/gif/png/tiff/bmp to jpeg/gif for
>> uploaded images. this way i can upload any images, regardless of it's
>> format.
>> the imlib2 library provides all functions i need (i've used it with php4
>> and c), but haven't found a python extension.
>> i checked the following libraries:
>> - pil
>> - paint library
>> - gd module
>> but they don't fit my requirements.
> given that PIL can do everything you mention (and more), perhaps you
> could explain why it doesn't fit your requirements?
> </F>