Dear Mom and Dad,
This week, we learned about images and how they are made. First, I’d like to introduce you to the concept of pixels. These are small squares that comprise all electronic imaging. Each pixel represents only one color, and when combined, they form the overall picture. To determine the number of pixels in a picture, you simply need the height and width of your image and multiply the two numbers. For example, if a picture is 200 pixels in height and 500 pixels in width, it would contain 100,000 pixels or 0.1 megapixels. Most digital images you encounter are typically between 5 and 20 megapixels in size.
Now, where does the color come from? Well, each pixel is encoded with its own color. Different types of images have varying color depths; for instance, GIFs only have 256 colors, whereas JPEGs can contain over 16 million colors. So, how does the computer store and process all these colors?
In a GIF, each pixel contains a string of binary numbers (0s and 1s) that is 8 digits long. This allows for 256 different combinations of numbers, with each combination representing a unique color in the picture. But how do JPEGs manage to have over 16 million colors?
In a JPEG, each pixel consists of three sets of the 8-digit binary code mentioned earlier. However, this time, the three separate codes correspond to red, green, and blue. This means there are 256 shades of red, green, and blue available. Colors blend differently when mixed using light compared to paints. For example, with paints, you cannot mix two colors to create yellow. However, with light, yellow is produced from a combination of green and red. This ability to mix up to 256 shades of green, blue, and red is what enables JPEGs to achieve those 16 million colors.
This is also why JPEGs are now more commonly used than GIFs, as the greater number of colors allows for smoother transitions between different shades. Now, take a look at the sunsets on the right and left. The right one is a JPEG, and the left is a GIF. If you examine closely, you’ll notice that the left image has much smoother transitions between colors, thanks to its access to a broader range of colors.
I hope you’ve learned something new. See you next week!
Evan Fuller
This post was proof read and formatted by chatgpt