Detect colorspace in Image

  • Thread starter Thread starter Dennis Myrén
  • Start date Start date
D

Dennis Myrén

Hi.
I have already posted this question once, but this repost is to ensure
no gurus missed it, who might be able to help me out here;

I would like to know whether it is possible - without manually reading the
raw image stream -
to determine the colorspace used in an image as represented by a
System.Drawing.Image.

I want to be able to detect whether images uses the RGB, CMYK or another
color space.

Thank you.

Dennis
 
Hi Dennis,
Hi.
I have already posted this question once, but this repost is to ensure
no gurus missed it, who might be able to help me out here;

I would like to know whether it is possible - without manually reading the
raw image stream -
to determine the colorspace used in an image as represented by a
System.Drawing.Image.

I want to be able to detect whether images uses the RGB, CMYK or another
color space.

Thank you.

Dennis

With all my knowledge, i don't know about other color representation
in .NET than RGB and eventualy HSV (Hue, Saturation
& Brightness) retrieved from RGB.

If you get *PixelFormat* from an *Image*, then you'll see that
there are RGB pixel color versions.
Indexed formats have RGB colors but these are stored in
*Image.Palette*.

So You can easlily get images *PixelFormat* e.g.:
Image.FromFile("c:\\mybitmap.bmp").PixelFormat
, but *colorspace* other than RGB cannot be retrieved.

Regards

Marcin
 

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

Back
Top