

A YCbCr image also has three channels, but it stores all of the brightness information in one channel (Y) while splitting the colour information between the other two (Cb and Cr). To do this, JPEG uses some math to convert the image’s colour space from RGB to YCbCr. Remember that brightness is more important than colour, so we’ll want to isolate brightness from the colour information so we can deal with it separately. The problem, as far as JPEG is concerned, is that the image’s brightness information is spread evenly through the R, G, and B channels. On the left side of the left-hand illustration, you can see the red, green, and blue parts of your selected image split out into three separate channels. For this reason, it is called an RGB image. Each pixel is stored as three numbers, representing the amount of red, green, and blue light needed to reproduce that pixel’s colour. Typical computer images are made up from a grid of tiny coloured squares called pixels. Start by choosing an input image to compress. You can play with the encoding settings and see how it affects the results. In this article, we explore the process step-by-step, using real images and following them through the entire encoding (saving as JPEG) and decoding (loading from JPEG) process. As a final step, the information that is left is compressed with traditional lossless compression to pack the end result into the smallest space possible. Then some of the less important information is discarded. In each case, the image data is transformed to give easier access to the kind of information needed (either brightness or frequency information). JPEG compression applies each of these ideas in turn. Camouflage works in part because higher-frequency patterns disrupt the lower-frequency edges of the thing camouflaged. It is less accurate at judging high-frequency light changes, like the fine detail in a busy pattern or texture. The human eye is good at judging low-frequency light changes, like the edges of objects.
#NEAT IMAGE COMPRESSION HOW TO#
How to decide what to keep? Science! In the case of image compression, you start by understanding which parts of an image are important to human perception, and which aren’t. The trick to good lossy compression is to throw away information that nobody cares about: burning the books that nobody ever reads. It’s not the notes you play, it’s the notes you don’t play. If she burns some of the books, that’s lossy compression. If she replaces some of the books with digital or microfiche copies, that’s lossless compression. Suppose a librarian has run out of shelf space and needs room for more books. Lossy compression means that you reduce file size by throwing away some of the information.

For this reason, JPEG and many other media formats use something called lossy compression. The problem with images and sound is that this data is usually too noisy to find good abbreviations. Video, still images, and audio don’t usually compress well. It’s like using an abbreviation or acronym to stand in for a longer word or phrase. Compression methodsĬompression techniques look for repeated patterns in the data and then replace those patterns with shorter ones. Why has it been so successful? This article presents the key ideas behind JPEG in plain language and includes an interactive JPEG compressor right on the page so you can play along at home. It’s humbling to think that the 1992 JPEG image standard is still going strong despite being more than 5 “forevers” old. In the world of technology, “forever” means about 5 years.
