We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5095 - macOS has over-saturated colors when system colorspace isn't sRGB
Summary: macOS has over-saturated colors when system colorspace isn't sRGB
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All Mac OS X (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-15 20:35 UTC by michaeljosephmaltese
Modified: 2020-04-16 17:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michaeljosephmaltese 2020-04-15 20:35:04 UTC
On macOS, the display rendered is over-saturated.

You can see this by e.g. opening a PNG in Preview.app, and then displaying the same image in SDL (using a loader like libpng, libspng, lodepng, stb_image, etc that bypasses the system color management).

There was a previous commit to fix this https://hg.libsdl.org/SDL/rev/e5b39f4935c8 that set the window colorspace to sRGB, but apparently caused performance issues https://hg.libsdl.org/SDL/rev/3a847ed9f8b1https://hg.libsdl.org/SDL/rev/3a847ed9f8b1 .  I couldn't find any other references to this issue, though note that OpenTTD was able to _improve_ performance by setting the colorspace https://github.com/OpenTTD/OpenTTD/issues/7644

If setting the colorspace causes performance issues, then we should figure out another way to do it such that colors are rendered correctly.