How to open "raw" images using PIL?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to open "raw" images using PIL?

pontissimo
I have some "raw" images shot from a Canon DSLR that I'd like to manipulate using the PIL. I know I can convert them using another program, but if possible I'd like to do so directly using PIL.

Is this possible with the PIL?

Currently I get something like:

f = "IMG_0025.CR2"
im = Image.open(f)

Traceback (most recent call last):
  File "C:/test.py", line 7, in ?
    im = Image.open(f, mode = "r")
  File "C:\Python24\lib\site-packages\PIL\Image.py", line 1916, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file



_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: How to open "raw" images using PIL?

Fredrik Lundh
On Tue, Jun 16, 2009 at 2:17 AM, Alec Bennett<[hidden email]> wrote:

> I have some "raw" images shot from a Canon DSLR that I'd like to manipulate
> using the PIL. I know I can convert them using another program, but if
> possible I'd like to do so directly using PIL.
>
> Is this possible with the PIL?
>
> Currently I get something like:
>
> f = "IMG_0025.CR2"
> im = Image.open(f)
>
> Traceback (most recent call last):
>   File "C:/test.py", line 7, in ?
>     im = Image.open(f, mode = "r")
>   File "C:\Python24\lib\site-packages\PIL\Image.py", line 1916, in open
>     raise IOError("cannot identify image file")
> IOError: cannot identify image file

"raw" files (or rather, camera-specific formats) is a big topic, and
there's no standard support in current versions of PIL.  I suspect you
have to use external converters for most major cameras (but
contributions are welcome).

</F>
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig