0

How, in C#, can I define the colorspace a JPG is in? I am trying to create a small app to automatically convert to sRGB any image submitted in AdobeRGB colorspace.

Thank you for your help.

Daniel DiPaolo
  • 55,313
  • 14
  • 116
  • 115
Raf
  • 33
  • 1
  • 6

2 Answers2

1

You may find the content of this question helpful.

It seems to relate to the problem you are having.

Converting JPEG colorspace (Adobe RGB to sRGB) on Windows (.Net)

If you are running a server side component to this application, then making a call to the ImageMagick convert command would be a very easy option.

Community
  • 1
  • 1
gruntled
  • 2,684
  • 19
  • 16
  • 1
    Daniel, before running the conversion, I want to make sure the image is actually in the wrong colorspace. I know how to convert, I just need to find out if the image does indeed need to be converted. – Raf Jun 07 '10 at 22:16
0

I've approached this problem on OSX by shelling out to sips and examining the result:

sips -g space /your/imagePath/here.jpg | tail -n1 | awk '{print $2}'

I compare the second return value to "CMYK" to determine whether I need to convert to RGB.

Not useful if you're on a different OS, though.

AteYourLembas
  • 303
  • 3
  • 12