sokol icon indicating copy to clipboard operation
sokol copied to clipboard

sokol_app.h macOS: investigate 'implicit' color space conversions

Open floooh opened this issue 2 years ago • 1 comments

From @hb3p8 via Twitter:

We have noticed a while back that colors on screen (on macos using sokol_app) are different from the colors from the same framebuffer saved to file (and opened in photo viewer).

It looks like by default macos interprets colors produced by application as encoded with P3 colorspace and not sRGB (at least for OpenGL backend).

We have added this line to window init code and colors look fine now: [_sapp.macos.window setColorSpace:[NSColorSpace sRGBColorSpace]];

At least for me it was unexpected that system expects me to write P3 color by default, so maybe it needs some treatment at sokol_app level?

floooh avatar Sep 03 '22 17:09 floooh

A bit more context, solution is actually from here: https://github.com/google/filament/blob/main/libs/filamentapp/src/NativeWindowHelperCocoa.mm

hb3p8 avatar Sep 05 '22 16:09 hb3p8