working with raw image files

Wanderer wanderer at dialup4less.com
Mon Jun 13 17:28:43 EDT 2011


On Jun 13, 4:58 pm, kafooster <dmoze... at gmail.com> wrote:
> On 13 Cze, 22:52, Wanderer <wande... at dialup4less.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Jun 13, 4:41 pm, kafooster <dmoze... at gmail.com> wrote:
>
> > > Wanderer: by *.raw I mean images with .raw extension, pure pixel data
> > > without headerhttp://en.wikipedia.org/wiki/Raw_image_format
>
> > > That is a clear and nice code however I think Image.open cannot
> > > handle .raw since i get error
>
> > >     image1 = Image.open("hand.raw", "rb")
> > >   File "D:\Python27\lib\site-packages\PIL\Image.py", line 1947, in
> > > open
> > >     raise ValueError("bad mode")
> > > ValueError: bad mode
>
> > Try dropping the "rb". I don't use it in my code. I copied it from the
> > OP.
>
> I tried it, then it cannot identify image file

You're right raw is not a supported file format.

http://www.pythonware.com/library/pil/handbook/index.htm



More information about the Python-list mailing list