sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
695 stars 105 forks source link

Colorimetry Improvement: Jzazbz #1056

Open torridgristle opened 5 years ago

torridgristle commented 5 years ago

Personally I don't like any of the color matching options in Slade, and I've seen that you weren't particularly convinced by any of them either. Here's where Jzazbz comes in: It's better. https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-25-13-15131&id=368272

I've tested this by converting Doom's palette to Jzazbz and converting a 512x512 LUT to Jzazbz and matching in Photoshop via indexed color (which I assume is just sqrt(Delta Red squared + Delta Green squared + Delta Blue squared) and doesn't seem to react differently to hues), then using it as a LUT and comparing to another LUT made by Slade using CIEDE2000 (likely the most advanced option available in Slade) and it just looks abysmal in comparison.

Jzazbz sports highly uniform MacAdam ellipses of just noticeable differences, improved luminosity calculations, more even spread of Munsell hue rings, and it sounds like you're stuttering Jazz when reading it.

Here's an in-browser GLSL shader showing off Lum / Hue / Chroma in Jzazbz https://thebookofshaders.com/edit.php?log=180722032925 adjust chroma by replacing 0.2 in the line at the end gl_FragColor = vec4(jchz2srgb(vec3(st.y, 0.2, st.x)),1.0);

torridgristle commented 5 years ago

Here's a comparison of various color matching methods: https://cdn.discordapp.com/attachments/475089535563464727/594535784716173323/Comparison.png

The Munsell weighted RGB is an attempt at a simple color difference equation using weighted RGB values based on the distance from D65 white to a ring of Munsell hues. In case you want to add them the weights are Red: 0.80769 Green: 1.00000 Blue: 0.63636

Also, I believe the paper suggests using hue and chroma instead of az and bz in the color difference equation but I've found it works better with az and bz for Doom's palette at least.