Hello!! I'm trying to use the  ImagePalette class from PIL ( python image
library ) to load a dicom image that I have decoded. I read the official
documentation and many other articles from blogs and webs but many of them
are copies of the official documentation.
I'm trying to use this class to set the right palette to the image because I
think the default palette  don't have  the  necesary   scale  to represent
the image.

To load the image I use this code :
                  imagen=Image.frombuffer( "P",
(self.__width,self.__height), self.__data, "raw", "P", 0, 1)

and the code to treat the bytes of the image is :
                  for i in range(self.__width*self._ _height):
                            self.__data.insert(i,(0xff & img[(2*i)+1]<<8 )|
0xff & img[(2*i)] )

I supose that it is a 16 bits monocrome image.

Someone knows how to set a palette?? or a link to read something about it??
Thanks


Francisco J. Seva


--
blog: www.lacoctelera.com/nupi
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to