On Jan 5, 2006, at 11:49, Count László de Almásy wrote:
> Greetings,
>
> I'm new to PIL, and am wondering if the following is
possible.
>
> I want to resize an image by only specifying the width,
but not the
> height. The height should be expanded or contracted
automatically to
> fit the width value while maintaining the aspect ratio
of the image.
>
> Second, I want to be able to specify the JPEG
compression level.
>
> If you are familiar with ImageMagick, these would be
accomplished
> using the following for example:
>
> % mogrify -quality 95 -resize 500x big.jpg
>
> I can't figure out whether these things are possible
from the PIL
> documentation or not. Any ideas?
i.thumbnail ( (128,128), Image.ANTIALIAS )
this will create a thumbnail that is no more than 128x128,
but will
keep the original geometry.
--
("`-/")_.-'"``-._ Chris Cogdon
<chris cogdon.org>
. . `; -._ )-;-,_`)
(v_,)' _ )`-. ``-'
_.- _..-_/ / ((.'
((,.-' ((,/ fL
_______________________________________________
Image-SIG maillist - Image-SIG python.org
htt
p://mail.python.org/mailman/listinfo/image-sig
|