Can't get colorpalette from some images

P

Piotrekk

Hi

I am trying to get color palette of image and change it:

Image tmpImg = pictureBox1.Image;
// Here tmpImg.Palette sometimes has 0 entries and sometimes has some
entries

However when i debug it i can see that Palette has zero entries for
some images
Does anyone of you know what could be the problem?

Iam trying to get color palette of:

http://mion.elka.pw.edu.pl/~pkolodzi/1.jpg

and change it to:

http://mion.elka.pw.edu.pl/~pkolodzi/2.bmp

On the above example:
Iam able to get color palette of the BMP file here - and unable for
JPG. In different example i CAN get palette of JPG and cant - BMP.

Thanks
PK
 
P

Peter Duniho

Piotrekk said:
I am trying to get color palette of image and change it:

Image tmpImg = pictureBox1.Image;
// Here tmpImg.Palette sometimes has 0 entries and sometimes has some
entries

Not all images have a palette. Only images with indexed pixels values
will. Images with a pixel format where the pixel data is itself the
color information, rather than being index to a table of color
information, will not have a palette.

What palette, for example, should be returned for a 24-bit RGB image?
Should you get a palette with 16 million entries? That's a pretty big
palette.

Pete
 
P

Piotrekk

Not all images have a palette. Only images with indexed pixels values
will. Images with a pixel format where the pixel data is itself the
color information, rather than being index to a table of color
information, will not have a palette.

What palette, for example, should be returned for a 24-bit RGB image?
Should you get a palette with 16 million entries? That's a pretty big
palette.

Pete

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top