This week in class we learned all about how images are represented as 0s and 1s. Digital images are made up of pixels, which is short for picture element. A pixel can only be one color, that color can be picked from 16 million, but any pixel is only one color. The more pixels we have, the better job we can do with representing an image. Computers need a way to understand and store these colors. Each pixel in an image is made up of a binary code. In binary code everything is represented using two digits, 0s and 1s. Each pixel in the image has a unique location like a coordinate on a graph. For each pixel, the computer records the color using binary code. Let’s take the case of a black and white picture. Each pixel can be either black, represented as 0, or white, represented as 1. It gets a little more complicated with colored images. Each pixel of red, green, and blue (RGB) colors rather than just black and white. The computer translates these values into binary code for each color component, which is assigned a number between 0 and 255. In order to represent the color of each pixel in a colorful image, the computer stores three sets of binary numbers – one for red, one for green, and one for blue. The quality of an image is influenced by its resolution, which refers to the density of the pixels within it. In images with low resolution, pixels are larger and spaced farther apart, requiring fewer to fill the space. This often leads to a blocky or pixelated appearance. Conversely, high-resolution images have more pixels packed closely together, resulting in a clearer appearance, especially when zoomed in or stretched. However, the trade-off is that higher resolution images tend to have larger file sizes.

Image on the left is the original portrait found on google. Image on the right is the same portrait but with only 2 colors using GIMP

 I asked chat GPT to “make this sound more interesting”: 

This past week in class, we delved into the captivating world of digital imagery, where the magic happens as intricate patterns of 0s and 1s come together to paint pictures. Imagine this: every image you see on your screen is a mosaic of tiny building blocks called pixels, short for picture elements. Each pixel is like a minuscule dot, capable of showcasing a single color selected from a staggering palette of 16 million possibilities.

But here’s the kicker: despite the vast spectrum of hues available, each pixel can only don one color at a time. So, how does a computer keep track of this symphony of colors? Through the intricate dance of binary code. Picture this: every pixel in an image has its own designated spot, much like a coordinate on a graph. And for each of these pixels, the computer meticulously records its color using the language of 0s and 1s.

Now, if we’re talking black and white pictures, things seem relatively straightforward. A pixel is either black (represented by 0) or white (embodied by 1). But buckle up, because when we venture into the realm of colored images, the plot thickens. Each pixel doesn’t just have to decide between two extremes; it juggles shades of red, green, and blue – the RGB trio. The computer ingeniously translates these color components into binary code, assigning them numerical values ranging from 0 to 255.

So, to encapsulate the vivid spectrum of colors in a single pixel of a colorful image, the computer stores not one, not two, but three sets of binary numbers – one for each primary color. But hold on, there’s more to this tale. The quality of an image isn’t just about the colors it boasts; it’s also about its resolution – the density of pixels within its frame.

Picture this scenario: low-resolution images sport larger, more spaced-out pixels, requiring fewer to fill the canvas. The result? A somewhat blocky, pixelated appearance that can leave something to be desired. On the flip side, high-resolution images pack pixels closer together, creating a crisp, detailed picture that truly pops, especially when zoomed in or stretched.

But, as with most things in life, there’s a trade-off. Higher resolution means more pixels, which means larger file sizes. So, while you might be mesmerized by the clarity of that high-res masterpiece, don’t be surprised if it takes a bit longer to load – after all, greatness often comes at a price.

https://www.bbc.co.uk/bitesize/guides/zpfdwmn/revision/2

Credit: chat GPT 3.5