Most of you are probably relatively familiar with the most common image formats like JPEG,
PNG, and GIF [Pronounced JIF]. But there's plenty of other uncommon
formats you may have seen before but weren't sure what they do. I'll talk
about those as well as some very strange formats that you probably have never seen
before and those I think are the most interesting so we can start with those.
But if you do want to see a more detailed comparison about when to use JPEG vs PNG,
I have another video I made recently, I'll have it pop out but also remind you at the
end so you can watch it next. The first two are file extensions I've seen before
and wondered what the heck they're about and that is JPEG-Large and PNG-Large.
And turns out that this is basically a made up file extension that only Twitter
used for some reason, where this might not even be the case anymore,
but at one point if you downloaded a image file from Twitter that was deemed
as a large resolution for some reason it would save as JPG-Large or PNG-Large and
it was no difference from a regular JPG or PNG extension. So that's that.
Next up while you may have heard of PNG, have you ever heard of JNG which stands for JPEG
Network Graphics. This format basically uses the PNG file structure but the actual image data is
encoded with the JPEG compression algorithm. But what's interesting is JNG allows the embedding of
a second whole image really, that can be used as a transparency mask whereas regular JPEG can't.
Now next you might be surprised to know that there are a whole bunch of variations
and extensions of the JPEG format. If you go on jpeg.org you can see a list of all
these variations that have been tried out. Although basically none of them have ever
taken off. Though here is a comparison table that I made in Excel if you want
to see all the details of all these, but I'm just going to focus on a few of them.
The first is JPEG 2000 which was created in 2000. It has a lot more features than
JPEG and even though you almost never see it, it is probably the most well supported
I would say. The file extension is usually JP2 and it's pretty much supported by really
all image software but it's not supported by Chrome and Firefox and many other browsers,
so because of that is a major reason it's not ever used.
But it does have many features over a regular JPEG. For example it supports transparency,
it has a ton of additional possible color channels, a way higher bit depth,
it supports something called tiling and region of interest. Tiling basically means
you just divide the image into little squares that are all the same size,
but you could also literally make the whole image one tile, and each tile is encoded separately and
the reason for that is then you can use a lot less memory when you go to encode or decode the image
because instead of having to decode the whole thing at once you just do each tile at a time.
And a Region of Interest allows you to embed some metadata about different regions of the
image that are notable, and you can label them and even for example have different
compression qualities for different parts of the image. So if there's a main subject of the image
you can encode that with higher quality and less compression quality for the rest of it.
Another JPEG format I want to mention is JPEG-XT and the reason for this is
because it highly focuses on backwards compatibility so the idea is even if
you use this it has a bunch of extra features that you can add on that JPEG doesn't support,
but any old JPEG viewing software could still view it just without the extra features whereas a lot
of the other formats if it doesn't support the new JPEG format extension you can't view it at all.
Now this is not actually really supported by anything that I'm aware of, but I figured I'd
still include it because theoretically you could just use it yourself and then you could benefit
from all the features if you converted all your images to it and then if you went and sent the
images to someone else they'd still be able to use the basic 8-bit viewing of it without any problems
it's just that only you'd be able to get the better stuff, but I mean you still could use it.
Now thirdly I want to talk about the JPEG-XL format which has the extension JXL. JPEG-XL
is the latest and most capable edition of JPEG and it has the features we talked about before
like tiling and region of interest. But it also has stuff like HDR and even animation support.
Now JPEG-XL is not very well supported at all but there is some support for it.
One big thing is Chrome does not support it. Strangely there was a set of versions since
like Chrome 90 I think, where they did and it was behind a flag so you had to go into the
experimental settings to enable, it it wasn't by default. But then for some reason they took it out
later. For Firefox if you use the nightly version, which is basically like a beta version, there's
also support in there but again behind a flag. So there's not really much default support for it.
However Safari does actually support JPEG-XL by
default and also Adobe Raw and Photoshop by extension if you go into the settings,
there's an experimental option where you can enable support for HDR formats which includes
JPEG-XL and then you can actually save those as that format, and you can also input it too.
And there is actually a push to make JPEG-XL the replacement of JPEG. Partly because it
is way more efficient than the old JPEG algorithm. It can compress things a lot
more better than even WebP for example. However that's really gonna depend on what software ends
up supporting it. Another contender for what might replace JPEG, if JPEG even gets replaced,
is AVIF and that is short for AV1 Image File Format. And AV1 is actually a video codec,
it's a new one that's royalty free that is very good actually, it's probably going to replace
h.264 because it does a lot better compression with the same file size. And effectively an AVIF
image is just one single frame equivalent of an AV1 video, so it's same type of compression.
However even though there is a push to make AVIF a standard, I think it's dead in the
water for one major reason which is it's maximum image resolution. Basically because it's based
on the video codec which has a max resolution of 8k it has that same max resolution which is only
like 8193 by 4320. And yeah while it is somewhat rare to see images higher than that resolution,
I don't think it completely will replace JPEG with that because there are some out there.
So again we'll see if either of those end up replacing JPEG at all. Next we can go over
several formats that you may have seen before but are somewhat uncommon but you might wonder
what they do. One is bitmap or .bmp, this one actually is more common I'm sure many of you
have heard of it at least. And this is a really really simple method of encoding. Typically it's
uncompressed and is literally just a 2D array of the pixel and what color goes on to it. So
there's not really any special compression like PNG and JPEG does. It's literally just,
really at a software level, a list of the pixels, what color they are,
of course the resolution too, a little bit of basic metadata, and that's it.
But it can also use indexed color where it's limited to 8 bits overall,
not just 8 bits per channel and that would be equivalent to 256 colors.
So again if you didn't watch my previous video, basically it would select the 256
most common colors in the image and instead of labeling each individual pixel with the
three color channel information, it would just point to which of those colors it is.
Next we have the icon file format which is .ico or also the cursor file format which is .cur,
they're the same thing just different names. And these are typically used for Windows icons
and cursors. And what's notable about this format is it is a container for multiple
images of the same thing but different sizes, like you would expect with an icon,
you might be displaying it at a higher resolution or where it needs to be smaller. Sometimes they
are very similar looking but sometimes the icon may actually look very different at a
very small version of it and you can see all those in the icon container.
The image types that are actually contained in the file can be either bitmap or png
and they can be really any size from 1x1 pixels all the way up to usually 256x256,
and you can really have any number of those in there. Now technically you can actually
put images in there that are higher than 256, for example here's a game I found on Steam by
just searching my computer for the largest icon files, and this one happens to have a
512 icon in there. But this is pretty rare because Microsoft only recommends you only go up to 256,
so usually it's going to be max 256 but very occasionally you might see higher than that.
Next up we have the DNG file format which is Digital Negative this one's actually
very popular among photographers and archivists who need to store the absolute maximum original
quality that a camera captures. And that's because DNG is a raw file format and designed
to be a universal one. So you might capture a image on a camera that's in raw and usually each
brand is going to have their proprietary raw format, and what's notable about raw formats
is they actually store more information even than a uncompressed lossless format like TIFF.
Now you might be wondering how you can have more information than lossless, so let me
explain. Basically a raw format saves all the raw information from the camera sensor as is,
without processing it in any way. Camera sensors like in consumer cameras basically all use what's
called a Bayer filter where each pixel or sensor site doesn't actually capture the three colors
like you have a monitor, where a monitor each pixel has three sub pixels for RGB,
a camera has it so each pixel is only going to capture either R G or B,
and it's usually going to capture more green than the red and blue because our
eyes are more sensitive to that. But they all capture the brightness level but as for color,
it's limited for each one. And then what the camera will do is basically decide the other
channels of each pixel based on the other surrounding pixels that do use that color.
Now I don't want to get too far into it there's plenty of videos that explain it, this process is
called de-mosaicing and it basically just means that based on the raw sensor data,
it kind of calculates what colors should be and that's what it outputs if you save it in
a regular image format. Whereas if you save the raw format it literally just saves the sensor
data and then when you go to display it it kind of has to do a conversion there. So technically
speaking when you go from raw to even lossless you are losing some information because the lossless
file contains the final calculation of what each pixel should be, and not what information
was used to make that calculation. So that's the benefit of a raw image file over lossless,
though I do need to point out that if you didn't capture the image using a raw format in the first
place, there's no point in using a raw format. It has to be raw from the very beginning, the whole
pipeline. If you even use an uncompressed tiff you can't convert it to a raw format in any meaningful
way, because you're not getting that information back. Finally we could talk about another totally
different type of format which is svg or Scalable Vector Graphics. And like the name suggests this
is a so-called vector file format. You see, a regular image that you're probably familiar with
with pixels is called a "raster" image, where the information is saved as discrete pixels. Whereas
a vector you're not saving image information you're basically saving shape information. So
if you were to open an svg file you would find that it's literally a text file, and at a basic
level it's basically just defining different points and what type of shape is used between
them. And the benefit of this is you can scale it infinitely because imagine you have a line that's
made of pixels if you zoom in then it's made of square pixels whereas a line is just a line,
there's no dimension to it, whereas pixels are 2D. And the same goes for any other shape like
a circle, you can zoom in on the line curve of a circle and there's no pixels that's making it up,
it's literally just the information of where the circle should be, so it's not going to pixelate,
you can make it as big as you want. Though if you do export it as another file format
that is a raster image format like jpeg or png, then yeah if you do zoom in after that it will
get pixelated. And that's called rasterizing or rasterization. A lot of times you'll see vector
images in graphic design, like another format is eps, same idea. A lot of times you'll also
see logos created in a vector format originally so you can scale the logo as big as you want
without it ever getting pixelated. So really vector formats are used whenever they can be,
though sometimes you simply can't. You can't make a vector image out of a photograph, it just
doesn't make sense. But now in any case you should have a better understanding of some very weird or
just uncommon file extensions. If you found this video interesting be sure to let me know down in
the comments what you think and of course you can let me know if i pronounced GIF wrong, I'm sure
many of you will. If you want to keep watching the next video is the one i talked about before,
and which file format should you be using for images, depending on the circumstance. I'll put
that link right there you can click on, so thanks so much for watching and I'll see in the next one