wx and pil conversion

A

azrael

A little problem.

Can I directly show Pil objects "image.open("bla.jpg") in Wx or do I
have to transform them.

If I have to transofm them How can I do it. Pixel by pixel or is there
somethin built in in pil or wx or python.
pilj->wx and wx->pil.
 
D

Diez B. Roggisch

azrael said:
A little problem.

Can I directly show Pil objects "image.open("bla.jpg") in Wx or do I
have to transform them.

If I have to transofm them How can I do it. Pixel by pixel or is there
somethin built in in pil or wx or python.
pilj->wx and wx->pil.

PIL doesn't depend on wx, so if anything then wx knows about PIL. But I
doubt it. Instead, use cStringIO and save a PIL-Image to memory, then use
that as file-argument to something that works for wx - no idea what, but
there should be means to load JPEGs and so forth.

If file-objects aren't enough, create a temp-file. No, that's not to slow.

Diez
 
A

azrael

I thought of using Temp files but I am afraid of the JPG destorsion
while saving because of the compresion.I am looking for a way to
directly transform it.
 
D

Diez B. Roggisch

azrael said:
I thought of using Temp files but I am afraid of the JPG destorsion
while saving because of the compresion.I am looking for a way to
directly transform it.

Then don't use JPEG, use PNG. It's lossless.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top