During World War II mechanical computers were used to calculate bomb trajectory and navigation, engineers noticed that these computers (boxes filled w

256 Colours are all you need

submited by
Style Pass
2024-07-05 15:30:05

During World War II mechanical computers were used to calculate bomb trajectory and navigation, engineers noticed that these computers (boxes filled with hundreds of gears) performed more accurately on planes than on the ground. The vibration of the plane reduced the error of the gears, which instead of sticking, moved more smoothly! That’s why small vibrating motors were built into computers of that epoch, their vibration was called dither.

Shouldn’t this be a post about digital images? Well, dithering is the name of an actual technique used in digital image processing to increase the quality of images after quantization, let’s dive into the problem.

True-colour images use 24bit per pixel, which means that each pixel has three channels of 8bit, one for red, one for green and one for blue. The possible colours that can be displayed are 256³ = 16.777.216, wow… do we need all these colours in each image? The short answer is no.

We can put all the colours that our image needs inside an indexed table (palette), and each pixel will save the index of the corresponding colour instead of the 24bit for the colour. If we consider that an average image has between 10.000 and 100.000 colours we need 17bit per pixel.

Leave a Comment