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

后端 未结 5 1606
天命终不由人
天命终不由人 2021-01-05 13:58

I need to generate thumbnail and medium sized images from large photos. These smaller photos are for display in an online gallery. Many of the photographers are submitting

相关标签:
5条回答
  • 2021-01-05 14:10

    Take a look at ColorConvertedBitmap class.

    0 讨论(0)
  • 2021-01-05 14:11

    On the server side you could call out to ImageMagick and let it do the conversion for you.

    Here's a link to the -colorspace command line option

    I haven't used this particular option, but it seems to do what you want.

    0 讨论(0)
  • 2021-01-05 14:13

    You should use the ImageMagic -profile option, I believe that -colorspace option will not help you there.

    convert image.jpg -profile sRGB.icc rgb_image.jpg
    

    Alternatively you can look for little color management engine

    0 讨论(0)
  • 2021-01-05 14:19

    Have a look at The bitmap transform classes which has a short sample of using the ColorconvertedBitmap class with a profile.

    0 讨论(0)
  • 2021-01-05 14:25

    Background info: Jpg files have 8 bits of red, green, and blue, whether sRGB,Adobe RGB, or plain ol' RGB. The ICC descriptor determines the color space. Sometimes this is embedded in the jpg file. Sometimes there is a flag to designate sRGB, Exif Colorspace tag a001 = 1. There is no standard flag for Adobe RGB, but some applications and cameras use 65535 (uncalibrated) for Adobe RGB in the exif tag A001.

    To convert a jpg file from from one ICC profile (colorspace) to another, you can use CreateColorTransform to create a transorm between the color spaces. You will need to provide the ICC profile for the source (Adobe RGB) and destination (sRGB) color spaces.

    After you have the transform, use TranslateBitmapBits to adjust the pixels. It may be easier to work with the image as a DIBSection.

    This may be a bit complex to write in .asp, so it might be easier to use a graphics library that does this.

    0 讨论(0)
提交回复
热议问题