[Image-SIG] How to open "raw" images using PIL?

Fredrik Lundh fredrik at pythonware.com
Tue Jun 16 17:46:12 CEST 2009

On Tue, Jun 16, 2009 at 2:17 AM, Alec Bennett<wrybread at gmail.com> 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).


More information about the Image-SIG mailing list