[piexwasm] Add BMP image color space support
Chrome and Mozilla support color space information in a BMP image [1], when the BMP has (at least) a 108-byte BITMAPV4HEADER header [2]. Change piex-wasm BMP generation code to use a BITMAPV4HEADER. When the preview image is sRGB, write that to the BITMAPV4HEADER. Otherwise the image is 'adobeRgb' color space: write the RGB CIEXYZ tristimulus (the gamut) and gamma of the AdobeRGB1988 color space, in the encoded forms required by the BITMAPV4HEADER definition. With this change, all images returned by peix-wasm have embedded color space information so rendering these images in a color managed browser like Chrome produces color-correct rendering. [1] https://mzl.la/36S5Fm3 [2] https://bit.ly/30Iag6l Bug: 1132695 Change-Id: Ic53d53f0a68274bb3b4f13fd31c14991d276786b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454891Reviewed-by:Alex Danilo <adanilo@chromium.org> Commit-Queue: Alex Danilo <adanilo@chromium.org> Auto-Submit: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#814565}
Showing
Please register or sign in to comment