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

C

Chris Colbert

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
 
S

Stefan Behnel

Chris said:
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
 
C

Chris Colbert

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

Ned Deily

Chris Colbert said:
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.
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top