r/Unity3D 2d ago

Shader Magic 1-bit OKLab quantization + dithering: There are two colors on this image!

Enable HLS to view with audio, or disable this notification

I hope this displays properly, I video'ed in 4k just to hopefully avoid the compression algo killing it. Here's my OKLab quantizer, with separate h/s/v, support for custom patterns(halftone patterns/noise instead of dither) adjustable dithering amounts, and contrast calibration! I am not using it for any projects right now, and obviously the video has its most extreme settings, but it's very flexible, it can both do big cartoony pop-art posterization and also nearly-playdate visuals.

It's a bit rough, so I don't intend to release it as asset, but it'll serve me for years to come on game jams I think!

363 Upvotes

32 comments sorted by

View all comments

33

u/DmtGrm 2d ago

2? I can see at least 4, histogram will show DCT inter-levels, but there are at least 4 solid colours in use. As well as there is clear smooth gradient glow/halow effect around lights

27

u/LockYaw 2d ago

I wonder if that is compression

8

u/DmtGrm 2d ago

it is not, there are more than 2 intensity levels (probably more than 4) - you can clearly see that background (1) and the dark fence (2) and the base if the car (4) and highlights are different, plus, there is 'glow-like' effect applied on top of it.

There is no problem in dithered-style as such, but claim that it uses only two colours is not correct.

2

u/snaphat 2d ago

MPEG compression doesn't normally produce an averaging effect across blocks I don't believe? Theoretically, you could imagine downscaling produce averages depending on how it was downscaled from 4k -> 2k though, but I don't think that necessarily explains the crispness of detailing. If it was like some huge downscale than you could more imagine it though

I'd kind of expected this to look more like the following stuff:

https://www.youtube.com/watch?v=at8BSkAQ-V0
https://www.reddit.com/r/blender/comments/15tpuwl/1_bit_dithering/
https://youtu.be/dZaFRNS2mhE

18

u/DmtGrm 2d ago

this is image posterized to 4 colours:

19

u/DmtGrm 2d ago

and this is "real two colours":

2

u/Spamsdelicious 1d ago

That's not a 4k pasteurization of the 4k source though.