does anyone know how to use libjeg from within memory in python

Discussion in 'Python' started by Chris Colbert, Oct 13, 2009.

  1. Say I use python to talk to a wireless webcamera that delivers images
    via http requests.

    I request an image and read it into a buffer, but the image is in jpeg format.

    I would like to convert this to a simple RGB format buffer to pass to
    numpy. Has anyone managed this using libjpeg or any other lib?

    Cheers!

    Chris
     
    Chris Colbert, Oct 13, 2009
    #1
    1. Advertising

  2. Chris Colbert wrote:
    > Say I use python to talk to a wireless webcamera that delivers images
    > via http requests.
    >
    > I request an image and read it into a buffer, but the image is in jpeg format.
    >
    > I would like to convert this to a simple RGB format buffer to pass to
    > numpy. Has anyone managed this using libjpeg or any other lib?


    According to the docs, the stdlib jpeg module has been removed in Py3:

    http://docs.python.org/library/jpeg.html

    But since you are processing images anyway, what about using an image
    processing library like PIL or ImageMagick?

    Stefan
     
    Stefan Behnel, Oct 13, 2009
    #2
    1. Advertising

  3. Heh, for whatever reason, your post is dated earlier than my response,
    but wasn't here when I sent mine. But yeah, PIL worked.

    On Tue, Oct 13, 2009 at 12:04 PM, Stefan Behnel <> wrote:
    > Chris Colbert wrote:
    >> Say I use python to talk to a wireless webcamera that delivers images
    >> via http requests.
    >>
    >> I request an image and read it into a buffer, but the image is in jpeg format.
    >>
    >> I would like to convert this to a simple RGB format buffer to pass to
    >> numpy. Has anyone managed this using libjpeg or any other lib?

    >
    > According to the docs, the stdlib jpeg module has been removed in Py3:
    >
    > http://docs.python.org/library/jpeg.html
    >
    > But since you are processing images anyway, what about using an image
    > processing library like PIL or ImageMagick?
    >
    > Stefan
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Chris Colbert, Oct 13, 2009
    #3
  4. Chris Colbert

    Ned Deily Guest

    Reply Delays

    In article
    <>,
    Chris Colbert <> wrote:

    > Heh, for whatever reason, your post is dated earlier than my response,
    > but wasn't here when I sent mine. [...]


    It's not always obvious but this "forum" is multiplexed in several
    places. It's available as a Usenet newsgroup (comp.lang.python), as a
    mailing list from python.org
    (http://mail.python.org/mailman/listinfo/python-list), as a Google
    group, and in various formats from consolidators like gmane.org
    (http://dir.gmane.org/gmane.comp.python.general). All of those
    "channels" are bi-directional so there are often latency delays while a
    reply from one channel pushes its way upstream and back out to the
    various other channels. Sometimes those latencies are really long when
    one channel gets a little slow. So, if a fast moving thread, replies
    will often cross in the pipeline, adding another level of confusion
    ("Didn't they read first before posting??"). It's sort of amazing that
    it all works as well as it does.

    --
    Ned Deily,
     
    Ned Deily, Oct 13, 2009
    #4
    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. Replies:
    1
    Views:
    1,487
  2. Andrew James
    Replies:
    2
    Views:
    400
  3. Max Williams
    Replies:
    0
    Views:
    117
    Max Williams
    Jun 14, 2009
  4. Simon Egginton

    LOOK! i just want to know does anyone know...

    Simon Egginton, Jul 26, 2004, in forum: Javascript
    Replies:
    3
    Views:
    180
    Dr John Stockton
    Jul 26, 2004
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    244
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page