facelessuser / ColorHelper

Sublime plugin that provides helpful color previews and tooltips
https://facelessuser.github.io/ColorHelper/
MIT License
254 stars 30 forks source link

Allow setting a different gamut for previews (Display P3 on macOS for instance) #201

Closed facelessuser closed 2 years ago

facelessuser commented 2 years ago

I haven't experimented yet, but you should be able to embed an ICC profile in images - in our case previews. Assuming Sublime handles this fine, which I assume it can, but we don't know until we try it, it should then be possible to preview colors outside of the sRGB gamut. Ideally, one would set the preview, color space gamut, and we would embed the appropriate ICC profile, and ensure previews are then encoded in the appropriate RGB space. Gamut mapping would also be adjusted to assume display P3.

I think the embedding part shouldn't be too difficult, but I haven't bothered to look into it yet. We'd have to look around a bit and ensure we catch all the fitting locations: blend tool, mix tool, previews, etc.

Theoretically, this would allow even better color previewing, something I'm anxious to get working if possible.

facelessuser commented 2 years ago

I'm not sure how far we'd go with such ICC profiles. I'm not sure we'd let people specify any ICC profile, but maybe. I think we'll at least start small. Get one generic profile set up, move to some generic profiles for the rest of the supported RGB spaces, and if necessary (and probably requested), look into allowing a user to specify a specific ICC profile for a given RGB color space.

Granted, there may be a piece of the puzzle somewhere that I am misunderstanding, so this will definitely be an experiment.

facelessuser commented 2 years ago

Some ICC files we may be able to embed: https://github.com/saucecontrol/Compact-ICC-Profiles.

facelessuser commented 2 years ago

So, this appears completely doable:

p3-gamut

Granted, a lot of refactoring is in order to get this cleanly handled, here we've only patched inline previews.

facelessuser commented 2 years ago

So, the profiles make a difference outside of Sublime, but the truth is that they don't seem to make a difference inside Sublime. The only reason we are seeing a difference in Sublime is that we adjusted sRGB colors relative to Display 3 which make them more accurate. Now Display P3 are the highly saturated colors on the top end, like they should be, and sRGB are not as vibrant. It's more due to our conversion than it is to do with the profiles as the results are the same if we just size the colors and leave out the profile.