I load a CMYK image, which I know had no compression,
It is ok, for I can visualize it.
Then, I try to save it compressed, and get an IOError
If I enable debuging setting Image.DEBUG=1 I get some more info
The error occurs in
TIFFWriteScanline: ECI2002_ccitt.tif: Must set "PlanarConfiguration before writing data.
Traceback (most recent call last):
"PIL\Image.py", line 1464, in save
save_handler(self, fp, filename)
"PIL\TiffImagePlugin.py", line 1073, in _save
raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file
Info from the file
- compression: raw
- photometric_interpretation: 5
- planar_configuration: 1
- fill_order: 1
- size: (3509, 4677)
format key: ('II', 5, 1, 1, (8, 8, 8, 8), ())
- raw mode: CMYK
- pil mode: CMYK
tiles: [('raw', (0, 0, 3509, 4677), 182, ('CMYK', 0, 1))]
Code I am executing
im=Image.open("ECI2002.tif")
im.show()
im.save("ECI2002_ccitt.tif",compression="tiff_ccitt")
I load a CMYK image, which I know had no compression,
It is ok, for I can visualize it.
Then, I try to save it compressed, and get an IOError
If I enable debuging setting Image.DEBUG=1 I get some more info
The error occurs in
TIFFWriteScanline: ECI2002_ccitt.tif: Must set "PlanarConfiguration before writing data.
Traceback (most recent call last):
"PIL\Image.py", line 1464, in save
save_handler(self, fp, filename)
"PIL\TiffImagePlugin.py", line 1073, in _save
raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file
Info from the file
format key: ('II', 5, 1, 1, (8, 8, 8, 8), ())
tiles: [('raw', (0, 0, 3509, 4677), 182, ('CMYK', 0, 1))]
Code I am executing
im=Image.open("ECI2002.tif")
im.show()
im.save("ECI2002_ccitt.tif",compression="tiff_ccitt")