Skip to content

plug-ins: bmp import - color profiles

1st draft for loading color profiles from Windows BMPs. Only the last commit in this MR is relevant.

The code to create/apply icc profiles is largely taken from the png plugin.

I know very little about color management and color spaces, and cannot judge if what I did is correct or not.

Similar to PNGs, BMPs can have embedded icc profiles or a set of gamma values and 'endpoint' XYZ values. I haven't found anything meaningful on 'endpoints'. They seem to be chromaticities/primaries and whitepoint all-in-one? Are they simply the XYZ-coordinates of RGB(1,0,0), RGB(0,1,0), RGB(0,0,1)? Is it ok to just convert the XYZ values to xyY for cmsCreateRGBProfile()? (see comment below, now I simply pass the XYZ coordinates and D65 whitepoint to lcms)

The embedded-profile case is straight-forward enough (I just left the grayscale stuff out for now to keep it simpler)

EDIT:

  • Haven't squashed the removal of debugging printf()s yet, might be useful for review
  • Code has some g_printerr()s. Maybe remove these (for now) and add them to my post-stringfreeze warn-on-import-errors project?
Edited by Rupert Weber

Merge request reports

Loading