wx and pil conversion

Discussion in 'Python' started by azrael, Mar 13, 2008.

  1. azrael

    azrael Guest

    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.
     
    azrael, Mar 13, 2008
    #1
    1. Advertising

  2. azrael wrote:

    > 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
     
    Diez B. Roggisch, Mar 13, 2008
    #2
    1. Advertising

  3. azrael

    azrael Guest

    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.



    On Mar 13, 5:09 pm, "Diez B. Roggisch" <> wrote:
    > azrael wrote:
    > > 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
     
    azrael, Mar 13, 2008
    #3
  4. azrael wrote:

    > 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
     
    Diez B. Roggisch, Mar 13, 2008
    #4
  5. azrael

    azrael Guest

    On Mar 13, 6:57 pm, "Diez B. Roggisch" <> wrote:
    > azrael wrote:
    > > 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


    thnx. i did't think about that. i totaly forgot png.
     
    azrael, Mar 13, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paradox

    Python Image Conversion with PIL

    Paradox, Jul 14, 2003, in forum: Python
    Replies:
    0
    Views:
    379
    Paradox
    Jul 14, 2003
  2. Raaijmakers, Vincent (IndSys,GE Interlogix)

    PIL and jpg -> png conversion

    Raaijmakers, Vincent (IndSys,GE Interlogix), Nov 17, 2003, in forum: Python
    Replies:
    1
    Views:
    334
    Erik Max Francis
    Nov 17, 2003
  3. Raaijmakers, Vincent (IndSys,GE Interlogix)

    RE: PIL and jpg -> png conversion, do I really need java for this???

    Raaijmakers, Vincent (IndSys,GE Interlogix), Nov 19, 2003, in forum: Python
    Replies:
    3
    Views:
    373
    Tobias Pfeiffer
    Nov 20, 2003
  4. Raaijmakers, Vincent (IndSys,GE Interlogix)

    RE: PIL and jpg -> png conversion, do I really need java for this???

    Raaijmakers, Vincent (IndSys,GE Interlogix), Nov 20, 2003, in forum: Python
    Replies:
    1
    Views:
    390
  5. Sverre
    Replies:
    2
    Views:
    3,702
    Sverre
    Dec 17, 2009
Loading...

Share This Page