[Image-SIG] matlab vs Python for Image Processing applications
Alec Bennett
wrybread at gmail.com
Mon Feb 11 11:31:14 CET 2008
Python, of course! Just kidding, I don't know enough about Matlab to answer
that question well. Python's great for image processing though.
As far as your code, my guess is the output of split() when fed a gif isn't
in r g b format? Try running your code on a JPEG, works just fine. But with
a GIF I get the error too. Here's the output of slightly different code:
import Image
im = Image.open("test2.gif")
print im.split()
> (<Image.Image instance at 0x00EF5288>,)
As you can see, it's returning a single item list, so when you assign three
items to the output, you're getting the error.
As far as why the output of split() is so different for a GIF vs. JPEG, I
don't know.
On Mon, Feb 11, 2008 at 12:46 AM, TAN TH <tanthiamhuat at yahoo.com> wrote:
> which is more suitable software for Image Processing
> applications, Matlab or Python?
>
> I have tried something very simple in Python, which is
> from the pdf,
> http://www.pythonware.com/media/data/pil-handbook.pdf
> however, it gives error. anyone able to help?
>
> >>> import Image
> >>> im = Image.open("D:/test.gif")
> >>> print im.format, im.size, im.mode
> GIF (409, 460) P
> >>> r, g, b = im.split()
>
> Traceback (most recent call last):
> File "<pyshell#24>", line 1, in <module>
> r, g, b = im.split()
> ValueError: need more than 1 value to unpack
>
>
>
> ____________________________________________________________________________________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs
> _______________________________________________
> Image-SIG maillist - Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20080211/0ed872ac/attachment-0001.htm
More information about the Image-SIG
mailing list