I created my own image in gimp made out of two layers. Mode was set as follows: Image->mode->rgb. Than I saved that as png.
Afterwards, I tried to load this image in python script using PIL.Image. But unfortunately, what was loaded was image with four numbers for every pixel, so I guess, it was loaded as CMYK. Is there any way to restrict that the image will be loaded as rgb, or, is there any way how to really force the convertor to save it as rgb?
Thanks, Tomas.
What you get is not CMYK, but RGBA value, since PNG supports alpha channel. To get 3-value RGB for each pixel try:
im = Image.open('test.png').convert('RGB')