Hello everyone! This post will be about image formats, because there are a couple. So, lets get to it! PNG Lets start with the first one, png, a very well known pixel based image format. Even tho png is compressed, the compression algorithm is lossless. What does that mean? Basically lossless = no data lost when converting back and forth, and lossy = data being lost when doing so. This means even a 4k photo can(in the best cases) take only a few kilobytes, while keeping the quality at the highest level, even including the alpha channel(basically how transparent is it), unlike the next format... JPEG JPEG, also known for the .jpg file extension is another pixel based image format, and has been introduced when internet started being a thing, and people didn't wanted to wait minutes or hours to load a single webpage on their fancy dialup connections with the maximum speed of 2^16bytes/s. The aim for it was simple: be small. And thats how the worlds most famous lossy image format was introduced. Unlike png, it didn't had alpha layer support, and the quality just looked bad if you endcoded it and decoded it more than 3x in a row. Why is it still the worlds most popular one tho? Well, you don't commonly notice that its compressed when you're just broswing random memes or similiar. It doesn't really matter if the image is 512p or 1024p when the screen renders it as 240p, is it. Speaking of pixels, introducing something entirely different: SVG SVG, also known as scalable vector graphics is vector based, as the name may imply. And, what is vector based graphics exactly? Instead of saving the pixels in grid like system where you store {255, 242, 0}, {100, 53, 89}... and this until the image data is complete, you instead store it as something like: "square at 0, 0 to 10, 20, circle with radius 50 to 60, 60". Basically you're not telling the computer what does the image look like, but instead giving it as a manual that tells it how to construct such image. This commonly is, but doesn't have to be smaller than the pixel based formats, because it heavily relies on complexity of the image. Is there any other format that also uses this? Indeed there is, and example of it is the TTF(truetype font), which also uses vector graphics, or OBJ for 3d objects, which is also scalable and is basically from shapes. PPM(portable picture format) This is the last of the formats I will mention here, but by far my favorite one. Why? Well, it doesn't use any kindof compression, so its super super simple to write it in code without any libraries. However, ppm is not an image format by itself, there is several generations of it, so lets go over them: PPM1, PPM4: Binary PPM - In this format, each bit is one pixel, so its also black and white only, allowing insane density of 8pixels/byte PPM2, PPM5: Grayscale PPM - In this format, each 1-2 bytes is one pixel, allowing eighter 255 or 65535 grayscale levels PPM3, PPM6: RGB PPM - In this format, each pixel is 3-6bytes, allowing full RGB spectrum with 16Milion colors on your disposal Now, whats the most beatiful thing of this format? You can use both plain text and binary formats. PPM1, PPM2 and PPM3 are all text formats, but PPM4, PPM5 and PPM6 are binary formats. Therefore if you want to write your image by hand - no problem! but if you wanna put it in 8times less space, sure! And how do you write such image? First, you need to write the header for it. This consists of PPM format, newline, dimensions ("X Y") newline, maximum value of a pixel(commonly 255 or 65535) newline and the data So, 320x200x256^3 text image header would look like this: P3 320 200 255 Whats also nice about this format is you dont have to use newlines, but any blank character, like a space (' '), so the header can also look like: P3 320 200 255 Well, thats the beauty of PPM format, and thats the end of it for today. See you next time.