Dithering in Gamma vs. Linear Space

Here is some public domain image, originally created by Ricardo Cancho Niemietz. Conversion to R4G4B4A4, without application of dithering, yields a rather unsightly result. Note the significant color banding on the gradients, which results in the Mach band optical illusion. There is some heavy color banding of the parrot's plumage as well. Dithering improves the […]

Fast and Accurate Color Depth Conversion

When converting between low-bit color color formats (R4G4B4A4, R5G6B6, R8G8B8A8, and so on), the conversion routines used often don't map to the nearest color channel values in the target bit depth. For example, when converting 8bit to 4bit colors, this is typically done by simply the discarding the lower 4 bits of each channel. This […]

Investigating SSE Cross Product Performance

Today‚Äôs little snippet shows a variant of the usual cross product implementation in your average SSE vector library. In pseudo-code, we can express the cross product formula as This is reasonably straightforward to implement as an SSE2 function, named cross_4shuffles because of reasons that will become apparent soon: At first glance, there doesn't seem to […]