HenricusMagnus#10499
As discussed in this forum earlier, many digital cameras actually do not embed the color profile with their files. Specially for shots taken in Adobe RGB which never have been opened in Photoshop, it might be hard to detect the real color space. The EXIF "color space information" returns an "uncalibrated" but does not tell the whole truth...
The clue is to check the white point chromacity as well as the chromacity of the Primaries and the color space transformation coefficients. These parameters can truly identify the usage of Adobe RGB.
Here my little solution for a nasty problem - have fun ...
Best regards from German color space
Henricus Magnus 🙂
The clue is to check the white point chromacity as well as the chromacity of the Primaries and the color space transformation coefficients. These parameters can truly identify the usage of Adobe RGB.
Here my little solution for a nasty problem - have fun ...
Dim sRGB as boolean
Dim AdobeRGB as boolean
If _bmSrc.ColorProfile Is Nothing Then
Dim jpegReader As New Aurigma.GraphicsMill.Codecs.JpegReader(pixOrder.Quelle)
Dim exif As Aurigma.GraphicsMill.Codecs.ExifDictionary = jpegReader.Exif
Dim frame As Aurigma.GraphicsMill.Codecs.Frame = CType(jpegReader.LoadFrame(0), Aurigma.GraphicsMill.Codecs.Frame)
frame.GetBitmap(_bmSrc)
frame.Dispose()
jpegReader.Dispose()
AdobeRGB = True
sRGB = False
For Each key As Long In exif.Keys
If LCase$(exif.GetKeyDescription(key)) = "color space information" Then
If exif.GetItemString(key) <> "uncalibrated" Then
AdobeRGB = False
If exif.GetItemString(key) <> "sRGB" Then
sRGB = True
End If
End If
End If
If LCase$(exif.GetKeyDescription(key)) = "white point chromaticity" Then
If exif.GetItemString(key) <> "313/1000 329/1000" Then
AdobeRGB = False
End If
End If
If LCase$(exif.GetKeyDescription(key)) = "chromaticities of primaries" Then
If exif.GetItemString(key) <> "64/100 33/100 21/100 71/100 15/100 6/100" Then
AdobeRGB = False
End If
End If
Next key
If sRGB = True Then
_bmSrc.ColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb()
End If
If AdobeRGB = True Then
_bmSrc.ColorProfile = New Aurigma.GraphicsMill.ColorProfile(Application.StartupPath + "\AdobeRGB1998.icc")
End If
End If
Best regards from German color space
Henricus Magnus 🙂