Open PIL image with less quality

Hi,
    I have a memory/performance problem.

I have in a 2000x3000 sized page more photos, designed with PIL.
I ask if exists a system for draw these images ( some of these are very big ) with PIL with less quality.
On iPhoto MAC suite, when I drag a photo into an image-box, i will see it in bad quality... after 1-2 seconds, this image will return in good quality.

Have someone any idea??

Thanks very much!!!

Mariano Di Felice wrote:

Hi,
    I have a memory/performance problem.

I have in a 2000x3000 sized page more photos, designed with PIL.
I ask if exists a system for draw these images ( some of these are very big ) with PIL with less quality.
On iPhoto MAC suite, when I drag a photo into an image-box, i will see it in bad quality... after 1-2 seconds, this image will return in good quality.

Have someone any idea??

These kind of applications create "thumbnails" or small sized versions of the photo used for quick browsing. iPhoto does this as well, like when you are scrolling quickly through all the images in your library and they are blurred, stop for a while and they are rendered correctly.

So you could make a 320x240 or 640x480 version which you stretch temporarily without antialias into the screen, start a thread which will decode the full 2000x3000 version and rescale it with antialiasing into the correct size.

The user first sees the low resolution version, but when your stretching thread ends, you overwrite the low quality version with the results of the background processing. If the user switched to another photo in the meantime you discard the results.

In a way this involves more memory/performance penalties because you have two versions of the same image, at the cost of making the GUI more responsive.

···

--
     Rastertech España S.A.
  Grzegorz Adam Hankiewicz
/Jefe de Producto TeraVial/

C/ Perfumería 21. Nave I. Polígono industrial La Mina
28770 Colmenar Viejo. Madrid (España)
Tel. +34 918 467 390 (Ext.17) *·* Fax +34 918 457 889
ghankiewicz@rastertech.es *·* www.rastertech.es
<http://www.rastertech.es/&gt;

Hi Mariano,

···

On 5/8/07, Mariano Di Felice wrote:

I have in a 2000x3000 sized page more photos, designed with PIL.
I ask if exists a system for draw these images ( some of these are very
big ) with PIL with less quality.
On iPhoto MAC suite, when I drag a photo into an image-box, i will see
it in bad quality... after 1-2 seconds, this image will return in good
quality.

Have someone any idea??

You might take a look here for ideas:

http://xoomer.alice.it/infinity77/eng/freeware.html#thumbnailctrl

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

Grzegorz Adam Hankiewicz ha scritto:

Mariano Di Felice wrote:

Hi,
    I have a memory/performance problem.

I have in a 2000x3000 sized page more photos, designed with PIL.
I ask if exists a system for draw these images ( some of these are very big ) with PIL with less quality.
On iPhoto MAC suite, when I drag a photo into an image-box, i will see it in bad quality... after 1-2 seconds, this image will return in good quality.

Have someone any idea??

These kind of applications create "thumbnails" or small sized versions of the photo used for quick browsing. iPhoto does this as well, like when you are scrolling quickly through all the images in your library and they are blurred, stop for a while and they are rendered correctly.

So you could make a 320x240 or 640x480 version which you stretch temporarily without antialias into the screen, start a thread which will decode the full 2000x3000 version and rescale it with antialiasing into the correct size.

The user first sees the low resolution version, but when your stretching thread ends, you overwrite the low quality version with the results of the background processing. If the user switched to another photo in the meantime you discard the results.

In a way this involves more memory/performance penalties because you have two versions of the same image, at the cost of making the GUI more responsive.

I have posted this question because i could have in a page 40 images, with differents resolutions. And these images are just thumbnailed into 150x150 size.
Them, my performance/memory problem is about the open/thumbnail process in low quality mode, if exists and if possible.

You (good) idea about a thread that draw first in low quality and after n seconds redraw in normal quality is not appliable for my case.

···

--
/\/\ariano Di Felice
Java PHP Python Ruby programmer
with MySQL, PostgreSql, SQLite and Oracle support
Linux Platform Developer
mariano.difelice@gmail.com
Tel. 0735 703735
Cell +39 339 6407211