Writing a "Raw" Image to a File (Win, PIL)

MRAB google at mrabarnett.plus.com
Sat Apr 11 18:38:57 CEST 2009

W. eWatson wrote:
> I have an image of described as:
> Img Info:  {}
>  size:  (640, 480)
>  format:  None
>  mode:  P
>  palette:  <ImagePalette.ImagePalette instance at 0x02393378>
>  bands:  ('P',)
>  type:  <type 'instance'>
> I'd like to write it to a file. Apparently, I need to convert it to a 
> string first. How do I do that? Pickle?

Have you tried the .tostring() method?

More information about the Python-list mailing list