[Music]
welcome to another video from explaining
computers
this time i'm going to explain the
application of and the differences
between a variety of file formats used
to store photographs diagrams and other
images
so let's launch into the wonderful world
of jpeg png tiff psd ai svg and their
many digital friends
to understand different image file
formats we first need a knowledge of
some key digital imaging concepts
these are the difference between raster
and vector graphics
lossy and lossless compression and
finally color spaces bit depth and alpha
channels
starting with raster versus vector
graphics raster formats store images as
a grid of pixels or what is known as a
bitmap
meanwhile vector formats store each part
of an image as a geometric formula this
means that if you scale up a vector
image it's always sharp
in contrast if we enlarge a raster image
we see the jagged edges of the pixels
because of this raster file formats are
best suited for storing photographs and
other images that are hard to
mathematically define
on the other hand vector formats are
more suitable for images that include
logos text and other elements that must
always remain sharp even when
significantly enlarged
to reduce file size most raster formats
apply lossy or non-lossy compression
lossy compression actually discards data
so reducing image quality
a common lossy compression technique is
discrete cosine transform or dct which
approximates the content of an image
using trigonometric functions
non-lossy compression reduces file size
while retaining all of the information
in an image here a common method is run
length encoding or
rle this works by storing sequences of
identical bytes as a single value
followed by a count
most image formats store data in three
color channels red green and blue or
what is described as an rgb color space
however for professional printing some
formats also offer four channel color
using cyan magenta yellow and black or
cmyk
in addition some formats also support a
single black and white or grayscale
channel
different image formats also store
different quantities of color
information
most formats can support 8 bits per
channel or 8bpc which with a 3 channel
rgb color space delivers what is known
as 24 bit color
whilst this is absolutely sufficient for
most purposes some file formats also
support 16 and even 32 bits per color
channel which provides greater
flexibility in image manipulation
at the other end of the spectrum a few
image formats offer the opportunity to
store just 8-bit color which limits the
number of colors in an image to 256 in
order to save file space
in addition to color values some raster
formats can store individual pixel
transparency using what is known as an
alpha channel so for example an image
stored in an rgb color space with an
alpha channel added becomes rgb a
here in the photo editor i've
loaded in two images one of which has a
white background and is stored in three
colour channels and one of which has a
transparent background and hence has an
additional alpha channel
images with alpha channel transparency
are very useful for things like
overlaying captions in the video editor
so here for example in davinci resolve
i've got an image with a caption which
has got an alpha channel and if i just
drag it down to the timeline you can see
it gets overlaid on the image and we
don't have to apply any additional
keying effect
and here i've also got the image with an
alpha channel from earlier that we can
similarly pull down to the timeline
there and again it's directly overlaid
using the alpha channel
right let's now turn to individual image
file formats the most common of which is
jpeg
this was created by the joint
photographic expert group in 1992 and
can have the file extension jpg or jpeg
jpegs store raster images in either an
rgb or cmyk color space with dct lossy
compression
however an alpha channel cannot be
included and bit depth is limited to
8bpc or 24 bit color
jpeg files can be captured by most
cameras and phones and can be read by
almost all digital imaging and related
software
jpeg is therefore a solid choice for
saving and sharing photographs including
images published on the web this said if
necessary jpegs can be used for print
and other publishing applications
although if this is the case jpeg files
should be saved with high quality
compression at the maximum available
resolution and ideally in the cmyk color
space
png stands for portable network graphic
and was created in 1994.
like jpeg it stores compressed raster
images but here using non-lossy
compression
unlike jpeg png files can also include
an alpha channel which makes them very
useful for things like website logos and
video captions
on the negative side pngs are limited to
either 8-bit or 24-bit color and can
only use an rgb color space png files
that offer 8-bit color are usually
termed png-8 whilst those offering
24-bit color are usually called png-24
finally png 32 files include the alpha
channel allocating 8 bits per pixel to
each of their red green blue and alpha
channels
gif or the graphics interchange format
was created by compuserve in 1987.
again this is a raster-based format here
with lossless compression
however file sizes generally remain
small as a maximum of 8-bit color is
supported as a result gif images are
limited to a maximum palette of 256
colors nevertheless they remain useful
for web graphics not least because they
can store animations as well as still
images
tiff or the tagged image file format was
first released in 1986 with its
specification last updated in 2002.
tiff files store raster images with no
compression non-lossy compression or
lossy compression depending on the
options chosen when a file is saved
tiff also supports rgb and cmyk as well
as black and white images and offers
either 8 16 or 32 bits per channel
and for good measure an alpha channel is
also included
as all of this suggests tiff is ideal
for professional graphics especially in
print applications and enjoys wide
software support
some high-end digital cameras also
directly shoot tiff files
psd or photoshop document is the native
adobe photoshop file format
it mainly stores non-compressed raster
images although text and certain image
elements are saved as vectors which
allows them to remain editable and
scalable without resolution loss
psd supports rgb and cmyk as well as
black and white images and supports 8 16
or 32 bits per channel
psd images can be stored in multiple
layers each of which may contain its own
alpha channel it's therefore not
surprising that whilst proprietary psd
is the dominant standard for
professional raster image creation and
manipulation
raw is a native raster digital camera
format that preserves information that's
lost when shooting jpeg or tiff files
it offers an rgb color space with either
12 14 or 16 bits per channel depending
on the camera model
each image is in effect a direct binary
dump from the camera's sensor so no data
is thrown away by the camera's internal
image processing
raw files can be read by photoshop and
other major image editing programs as
well as specialist utility software but
the majority of image viewing and
editing applications cannot load a raw
file
cameras from panasonic leckia and casio
actually used the dot raw extension for
their raw file format however nikon raw
files are usually.nef
which stands for nikon electronic format
while canon cameras currently save.cr2
or canon raw version 2 files other raw
file extensions include arw which is
used by sony as well as dot
dng.dcr and dot nrw
now i could continue for a very long
time detailing additional raster file
formats but jpeg png gif tiff psd and
raw are the most common
others to be aware of include xcf which
is the native format used by the
photo editor bmp or the bitmap image
file which was developed by microsoft
and tga which was developed by truvision
and is often known as targa
all vector-based formats store each
image element mathematically
this preserves resolution at all scales
negates the need for alpha channels to
deliver transparency and allows a wide
range of color spaces to be used there
are therefore fewer fundamental
differences between different
vector-based image formats than between
their raster-based comrades
in professional publishing the dominant
file format used for vector-based
artwork is a i which is the native
format of adobe illustrator although ai
files can be edited in many other
packages
other popular vector formats include cdr
which is a native file format for
coreldraw and svg which is very widely
used and stands for scalable vector
graphics
svg was developed by the world wide web
consortium as an open standard and is
the native file format in the inkscape
vector illustration package
svg enjoys widespread software support
including being readable in all modern
browsers
two other notable formats are eps which
stands for encapsulated postscript and
pdf or the portable document format
both of these are very widely used for
the delivery of final artwork or typeset
documents eps and pdf are also both
largely vector-based
however it's possible to embed raster
images within eps or pdf files so
allowing for a mix of resolution
independent text and graphics alongside
photographs scans or bitmap
illustrations
many many years ago i was learning the
lightwave 3d modeling package and i had
a particular issue it came up and i
contacted newtek the publishers of
lightwave who were very helpful and as
part of our email exchange they said i
should be using the png file format for
my textures in lightwave rather than
jpeg or a windows bitmap file
and that was extremely helpful advice
and ever since that time i've used the
png file format in lots and lots of
situations it's very helpful to me
particularly with its uh alpha layer if
you use a 32-bit png it was
transformative that moment of just
learning about a particular file format
it changed the way i work
and i hope with this video in explaining
all the different image formats i've
talked about maybe someone out there
will have a similar experience go oh yes
you've only used this file format it
would make life so much easier
but now that's it for another video if
you've enjoyed what you've seen here
please press that like button if you
haven't subscribed please subscribe and
i hope to talk to you again very soon
[Music]
you