Image File Formats Which To Use
Image File Formats Which To Use
www.scantips.com
Image File Formats - JPG, TIF, PNG, GIF
Which to use?
The most common image file formats, the most important for cameras,
printing, scanning, and internet use, are JPG, TIF, PNG, and GIF.
JPG is the most used image file format. JPG is the file extension for JPEG
files (Joint Photographic Experts Group, a committee of ISO and ITU).
Digital cameras and web pages use JPG files, because JPG heroically
compresses the data to be very much smaller in the file. JPG uses lossy
compression to accomplish this feat, which has a strong downside. A
smaller file, yes, there is nothing like JPG for small, but this is at the
cost of image quality. However, this compression degree is optionally
selectable (with an option setting named JPG Quality in your editor), to
be lower quality smaller files, or to be higher quality larger files.
Small file size and high image quality are opposites. Your digital camera
offers that choice too, the menu usually called Image Quality (you do
want to select best quality in the camera). In general today, JPG is
rather unique in this regard, of using lossy compression allowing very
small files of lower quality, whereas almost all other file types use
lossless compression (with larger files). The meaning of Lossy is
discussed Below.
Frankly, JPG is used when small file size (for transfer or storage, web
pages, email, memory cards, etc) is more important than maximum
image quality. But a High Quality setting to create JPG is good enough
in most cases, if we don't overdo the compression. Perhaps good
enough for some uses even if we do overdo it (web pages, etc). But if
you are concerned with maximum quality for archiving your important
images, then you do need to know two things: 1) JPG should always
choose higher Quality and a larger file, and 2) do NOT keep editing and
saving your JPG images repeatedly, because more quality is lost every
time you save it as JPG (in the form of added JPG artifacts... pixels
become colors they ought not to be - lossy). More at the JPG link at
page bottom.
TIF is lossless (including LZW compression option), which is considered the
highest quality format for commercial work. The TIF format is not
necessarily any "higher quality" per se (the same RGB image pixels,
they are what they are), and most formats other than JPG are lossless
too. TIF simply has no JPG artifacts, no additional losses or JPG artifacts
to degrade and detract from the original. And TIF is the most versatile,
except that web pages don't show TIF files. For other purposes
however, TIF does most of anything you might want, from 1-bit to 48-
bit color, RGB, CMYK, LAB, or Indexed color. Most of the "special" file
types (for example, camera RAW files, fax files, or multipage
documents) are based on TIF format, but with unique proprietary data
tags — making these incompatible unless expected by their special
software. Web browsers cannot show TIF files.
TIF format is very versatile. There are many TIFF formats for all kinds of
data and compressions. CCITT data for standard text document storage,
which supports multiple pages in one file. Standard fax is another TIFF
format. Designers can be assigned special data tags to declare other
data and compression types. One case is that some camera Raw files
are actually TIF format, but with unique proprietary data tags for their
special purpose, which then is no longer compatible with TIF viewers.
GIF was designed by CompuServe in the early days of computer 8-bit video,
before 24 bits or JPG was used, for video display at dial up modem
speeds. GIF discards all Exif data, which because GIF was designed for
video screen purposes, GIF does Not retain printing resolution values.
GIF always uses lossless LZW compression, but it is always an indexed
color file (1 to 8-bits per pixel). GIF can have a palette of 24-bit colors,
but only a maximum of 256 of them (which colors depend on your
image colors). GIF is rather limited colors for color photos, but is
generally great for graphics. Repeating, don't use GIF with indexed color
for color photos today, the color is too limited. GIF does offer
transparency and animation. PNG and TIF files can also optionally
handle the same indexed color mode that GIF uses, but they are more
versatile with other choices too (can be RGB or 16 bits, etc). But GIF is
still very good for web graphics (i.e., with a limited number of colors).
For graphics of only a few colors, GIF can be much smaller than JPG,
with more clear pure colors than JPG). Indexed Color is described at
Color Palettes (second page of GIF link below).
PNG can replace GIF today (web browsers show both), and PNG also offers
many options of TIF too (indexed or RGB, 1 to 48-bits, etc). PNG offers
an 8-bit mode to replace indexed 256 color GIF files, or a 24-bit mode
for a possible 16.7 million colors for photos. PNG was invented more
recently than the others, designed to bypass possible LZW compression
patent issues with GIF (which never actually became an issue). And
since PNG was more modern, it offers other options too (RGB color
modes, 16 bits, etc). One additional feature of PNG is transparency for
24 bit RGB images. Normally PNG files are a little smaller than LZW
compression in TIF or GIF (all of these use lossless compression, of
different types), but PNG is a bit slower to read or write. That patent
situation has gone away now, but PNG remains excellent lossless
compression. Less used than TIF or JPG, but PNG is another good choice
for lossless quality work.
Camera RAW files are very important of course, but RAW files must be
processed into regular formats (JPG, TIF, etc) to be viewable and usable
in any way. Make no mistake, Shooting Raw is a philosophy, not just a
setting. RAW involves a little easy extra work, but offers substantial
benefits, one of which is we can choose our settings AFTER we can
actually see the image, and see what it needs, and see what helps it,
and can still change our minds and try something else. Some may
debate it, but many cannot imagine NOT taking advantage of the
greater opportunities of RAW. Others think any extra step is too much
trouble, and are satisfied with JPG — but my own biased opinion is they
just don't know yet, or don't care. :) More detail Below.
We could argue that there really is no concept of RAW files from the
scanner (scanners are RGB). Vuescan does offer an output called RAW,
which is 16 bit, but RGB, not raw like from cameras. The difference is
that it only defers gamma correction until a later pass. And its file can
include the scanners fourth Infrared noise correction channel data if
any. Vuescan itself is the only post-processor for these Vuescan raw
files (except any Photoshop-like Levels can adjust gamma). But scanner
color images are already RGB color, instead of Bayer pattern raw data
like from cameras.
Camera RAW images are not RGB, and must be converted to RGB for
any use (our monitors and printers expect RGB images). The idea and
big advantage of camera raw is that all camera and JPG processing
options (such as white balance and contrast) are deferred until later,
when we can see the image to decide what it precisely needs without
having to undo JPG processing. That makes it better, and much easier
to get it right. Then the converted RGB image can be saved only one
time as high quality JPG (no JPG artifact issues). When and if the image
needs additional processing, we discard that JPG copy and resume from
the raw archive original.
Data Type
Bytes
Add estimated Exif size (optional)
KB
Image Size
Data Size
File Size
Print Size
Basics
Our digital images are dimensioned in pixels (not bytes, and definitely not
inches). And a pixel is simply a color definition, the color that this tiny dot of
image sampled area ought to be. Put all those colored dots together, and
our brain sees the image. The losses of image data we are speaking about is
about the altered color of the pixels.
inches
mm
at dpi resolution
<h3>This Calculator requires JavaScript be enabled in your browser.</h3>
This simple calculation can serve two purposes:
Scanning: The multiplication inches x dpi will show the output image
size created (pixels) if the area is scanned at the dpi resolution.
Scanning 8x10 inches at 300 dpi will produce 2400x3000 pixels.
Printing:The multiplication inches x dpi will show the required image
size (pixels) to print this paper size at the dpi resolution. 2400x3000
pixels printed at 300 dpi will fill 8x10 inches on paper.
Call it dpi or ppi as you prefer, but (since it’s about image pixels instead of
ink dots), the idea is that this resolution is the spacing of the pixels on
paper, pixels per inch.
It's important to realize that an area scanned at 300 dpi will create the
pixels necessary to also print the same size at 300 dpi.
Or for example, you could scan at 150 dpi and print at 300 dpi for a half size
copy.
Or you could scan at 600 dpi and print at 300 dpi for a double size copy.
The concept either way is pixels per inch, in the scanner and in the printer.
But NOT on monitor video screens. Images are shown on the video screen
at their actual size in pixels. Image pixels are shown one for one on the
screen pixels, so to speak. There are no inches or mm inside video monitors.
You might have bought a 23 inch monitor, but its screen is dimensioned in
pixels.
300 dpi is likely what you want for printing a high quality photo copy job (a
line art scan of black text or line drawings can better use 600 dpi, but 300
dpi is plenty for photo work).
This dpi number does NOT need to be exact at all, but planning size to have
sufficient pixels to be somewhere near this size ballpark (of 250 to 300
pixels per inch) is a very good thing for printing.
Image data consists of pixels, and pixels are "colors", simply the storage of
the three RGB data components (see What is a Digital Image Anyway?).
Any 24-bit RGB image will use three bytes per pixel (see Color Bit-Depth -
Memory Size).
So for example- any 10 megapixel camera image data will occupy 3x10 = 30
million bytes, by definition of RGB color. This number is the "data size"
(when opened into computer memory for use). A TIF file will be near that
size (and is lossless), but JPG is normally compressed very heavily (lossy,
not lossless) to store in a JPG file of perhaps 1/10 this size (variable with
JPG Quality setting), which is "file size" (not image size and not data size).
This example image size is still 10 megapixels (dimensioned in pixels, width
x height), and the data size is 30 million bytes, but the JPG file size might be
3 MB (lossy compression takes a few liberties). The image will still come out
of the JPG file as the same 10 megapixels and the same 30 million bytes
when the 3 MB JPG file is opened. We hope its quality also comes out about
the same — the JPG losses are altered color values of some of the pixels).
Image size (pixels) determines how we can use the image — everything is
about the pixels. See a summary of digital basics.
All photo editor programs will support these file formats, which will generally
support and store images in the following color modes:
Summary
The most common image file formats, the most important for general
purposes today, are JPG, TIF, PNG and GIF. These are not the only choices
of course, but they are good and reasonable choices for general purposes.
Newer formats like JPG2000 never acquired popular usage, and are not
supported by web browsers, and so are not the most compatible choice.
PNG and TIF LZW are lossless compression, so their file size reduction is not
as extreme as the wild heroics JPG can dream up. In general, selecting lower
JPG Quality gives a smaller worse file, higher JPG Quality gives a larger
better file. Your 12 megapixel RGB image data is three bytes per pixel, or 36
million bytes. That is simply how big your image data is. Your JPG file size
might only be only 5-20% of that, literally. TIF LZW might be 65-80%, and
PNG might be 50-65% (very rough ballpark for 24-bit color images). We
cannot predict sizes precisely because compression always varies with image
detail. Blank areas, like sky and walls, compress much smaller than
extremely detailed areas like a tree full of leaves. But the JPG file can be
much smaller, because JPG is not required to recover the original image
intact, losses are acceptable. Whereas, the only goal of PNG and TIF LZW is
to be 100% lossless, which means the file is not as heroically small, but
there is never any concern about compression quality with PNG or TIF LZW.
They still do impressive amounts of file size compression, remember, the
RGB image data is actually three bytes per pixel.
Camera RAW files is one way to bypass this JPG issue, at least until the last
one final save as JPG when required. And it offers additional processing
advantages too. Better easier tools in RAW than JPG has, the RAW data has
wider range than JPG has. Much the same controls as in the camera, which
you would have needed anyway, but this step is done after you see the
camera results, to know exactly what it still needs, and can simply tweak
and judge it by eye (as opposed to settings in the camera done in advance,
as hopeful wishing).
We hear: But RAW images require an editing step first. Some people do
seem terrified of the word "edit", but no matter what, we do always have to
stop and look at our images on the computer, every one of them. That is the
same extra step. Surely we have to crop them a bit, and resample smaller,
and many of mine will need a slight Exposure or White Balance tweak to be
their best. It makes a tremendous difference. That is the same editing, a few
seconds each, a few clicks, and then the file must be saved again. You might
as well do this step in the RAW software, which has better easier tools to do
it, and more range to do it., and of course, we can SEE the image now. If
your session included 100 images of same lighting situation, just select them
all, edit ONE of them (say White Balance and Exposure, even Cropping, etc),
and the same edit clicks are applied to all of the selected RAW images in one
click. Extremely convenient. And no JPG artifacts of course, no losses, and
any changes can easily be Undone anytime later, with full recovery of our
original RAW master copy. RAW is the trivial, easy, and good way, Day and
Night good, if you care about these things. Much more about Raw files here.
We all have our own notions, but here is a popular opinion about the
ultimate, in quality, in versatility, in convenience. RAW files are popular
indeed, from most DSLR cameras. When we take any digital picture, the
camera has a RAW sensor, but normally processes and outputs the image as
a JPG file. But often we can choose to output the original RAW image
instead, to defer that JPG step until later. We cannot view or use that RAW
file any way other than to process it in computer software and then output a
final TIF or JPG image, however postponing this processing offers a few
serious advantages, better editing options, and we can bypass all JPG
artifacts entirely, until the one final output Save for whatever purpose. RAW
allows us to tweak exposure and color, and defer White Balance decisions
until later when we can see the image first, and judge any trial results. The
12-bit RAW file offers greater range for any of our adjustments, often on
multiple files simultaneously. And RAW always preserves the intact original
version, so we can easily back out any editing changes we made, crop size
for example. An argument is made that processing RAW requires this extra
step, but of course, same is true of any editing that is required. RAW is the
easy way, with the best results.
The Next button will browse through the descriptions on the next pages, or you can use these
shortcut links directly:
JPG Format PNG Format TIF Format GIF Format Raw files
Copyright © 1997-2020 by Wayne Fulton - All rights are reserved.