more-or-less-correctly[*] sets the image's color space to sRGB
results in a correct header, which avoids errors when loading the BMP e.g. with ImageMagick ("invalid chromaticities")
Also fixed (but not tested, as BMP loading doesn't seem to be used): when loading a BMP file, use the file's header to determine how large it is instead of just assuming it's a V4 header.
[*] MacOS Classic doesn't use sRGB (which didn't exist until 1996), but a gamma value of 1.8 instead (sRGB is approximately 2.2). So saving image resources in sRGB color space changes the colors slightly. Technically correct would be to store the color space information in the BMP by writing a V5 header with:
blue: 0.230558096980787, 0.102470265324794, 0.666971637694419 (these values were calculated by opening System 9.0.4's "Generic RGB Profile" in MacOS X's ColorSync assistant, and then using the tristimulus values XYZ shown there to calculate xyz and sRGB's chromacity). As you can see, they don't differ too much from sRGB's.
red, green and blue gamma 1.8
(I hope I got the chromacities right...)
(I'm just noting these values down here so they don't get lost)
This:
Also fixed (but not tested, as BMP loading doesn't seem to be used): when loading a BMP file, use the file's header to determine how large it is instead of just assuming it's a V4 header.
[*] MacOS Classic doesn't use sRGB (which didn't exist until 1996), but a gamma value of 1.8 instead (sRGB is approximately 2.2). So saving image resources in sRGB color space changes the colors slightly. Technically correct would be to store the color space information in the BMP by writing a V5 header with:
(I hope I got the chromacities right...) (I'm just noting these values down here so they don't get lost)