Photo Image file formats, TIF, JPG, PNG, GIF. Which to use? (2024)

www.scantips.com

Image File Formats - JPG, TIF, PNG, GIF
Which to use?

There are very many image file formats, but the most common and the most important for cameras, printing, scanning, and internet use, are JPG, PNG, GIF and TIF. TIF has been the standard for commercial work, but web browsers cannot show TIF file images (there are browser plugins for TIF, but it will be very incompatible with others).

  • JPG is the image file format most used. 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 can have a strong downside if overdone. Yes, there is nothing like JPG for small, but that is at the risk of reduced image quality.

    This JPG compression risk degree is selectable (with an option setting named JPG Quality in your editor seen as you save the file). High Quality means lower JPG compression for higher quality larger files. Or you could choose a Lower Quality, to be higher JPG compression for smaller files but lower image quality. Small file size and high image quality are opposites. Your digital camera offers that size choice too, the menu usually called Image Quality (you do of course 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 and size is discussed more on another page at JPG Artifacts.

    Greater JPG compression is used when small file size (for email transfer or web pages, memory cards, etc) is more important than best image quality. You will have to decide if smaller file storage is more important than a larger better quality format that might be important archived for a later time (storage space is inexpensive today). 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.

    To prevent continued edits from adding JPG artifacts, keep edits in a TIF format until time to create a final JPG, and perhaps archive that TIF file too, for any future use. Writing a TIF file will NOT remove any existing JPG artifacts from the image, but it will not add any more of them. This need will be recognized as quite important after you have failed to do this for some important image you needed again, but didn't have. The camera will do one JPG Save (if not Raw) and the final JPG file for use will do another, but using the TIF file for all edits limits that to only those two JPG Saves. I don't necessarily mean EVERY image, since we do shoot a lot of junk never to be seen again, but I mean those obviously good and important images that you conceivably might want again in the future. Prepare them for that and save their fate.

    JPG2 There is a format called JPG 2000 with .jpg2 files. It uses a different compression without the JPG artifacts, but its blur typically reduces image sharpness. Little used, and few programs support it, so it is likely incompatible with most programs. Web browsers don't show JPG2 files.

  • 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 specials based on TIF format, but with unique proprietary data tags — making these incompatible unless expected by their special software. Web browsers typically cannot show TIF files (the uncompressed size is greatly larger than JPG compression).

    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 (1987), 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 also does NOT retain the file 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 for color photos today, the indexed color is too limited for full color. And if printing a GIF, you will have to specify resolution and size, because GIF discards any dpi info. 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 (which can be RGB or 16 bits, etc). But GIF is still very good for web graphics (i.e., with only a few colors). For graphics of only a few colors, GIF can be much smaller than JPG, with more clear pure colors than JPG, but many fewer colors). Indexed Color is described at Color Palettes.
  • 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.78 million colors for photos. At time of creation, these modes are often described with the nomenclature of PNG8 or PNG24. All PNG does offer lossless compression, but not as dramatically small as lossy JPG. 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, and is larger files than JPG. 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, but RAW files must be processed into regular RGB formats (JPG, TIF, etc) to be viewable and usable in any way. Make no mistake, Raw described at Shooting Raw is a philosophy, not just a setting. RAW involves a little extra work, which is easy, and great tools are available, which then offers substantial benefits, one of which is we can choose our White Balance 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. Can tweak exposure too. And Raw has lossless editing, meaning the original raw file is retained and can be easily recovered. Some may debate Raw, 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. 😊 Raw is about caring. If you care about best image quality, you will really love how easy Raw can achieve it. But if you're already satisfied with the pictures you get, Raw won't be of interest. More Raw detail Below.

    We could argue that there really is no concept of RAW files from the scanner (scanner images are RGB, not raw). Vuescan does offer an output called RAW, which is 16 bit, but is still RGB, not raw like from cameras. The difference is that that option only defers gamma correction encoding 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 control 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.

I strongly recommend always archiving your original unedited JPG image from camera or scanner.That's the only way to get the original JPG data back. Especially for JPG, archive the first pristine copy (which is automatic with Raw files, unless you delete them). Your download folder should be your permanent archive location of the camera's unchanged original file, and edited copies go elsewhere. Good practice is when editing that image, always save any change to a different file in a different location, always, preferably to a TIF file. Never overwrite or delete your only camera original file. Always keep that pristine original, because you can't otherwise go back. Or else there could be times when you realize the edited image is damaged, especially important on the really special ones. JPG especially, each JPG compression is lossy. If you did edit that original JPG file a few times, for white balance, brightness, resampling or cropping, JPG quality suffers with each new JPG compression (lossy), and it is irreversible if the original image is lost. You can't go back, so don't risk destroying your pristine original image. Any work should only make a copy. Beginners tend to worry about the disk space used by that archive, but this is just the nature of the game, JPGs are small anyway, and disks are inexpensive (a 4 TB Western Digital USB 3.0 external drive is about $100 USD). Disk space becomes a trivial concern. Retaining your original image is not trivial. Make a frequent backup too, onto another disk. It's a choice of being safe now, or sorry later.

A few features of common file types
File PropertyJPG TIF PNG GIF
Web pages can show itALL ALLALL
Uncompressed option Yes
Lossy compressionALL
Lossless compression YesALLALL
GrayscaleYesYesYesYes
8-bit RGB color (24-bits)ALLYesYes
16-bit RGB color (48-bits) YesYes
CMYK or LAB colorYes
Indexed color option YesYesALL
Transparency option YesYes
Animation option Yes

The term ALL means it is the only option. Yes means it is an available option. Blank means there is no option.

Different color modes have different size data values, as shown.

There are FOUR sizes of a digital image

Image Size is dimensioned in pixels, which is what determines how the image might be suitably used. Image size in pixels is the FIRST numbers you need to know about using a digital image is its dimensions in pixels.

The camera sensor is dimensioned in mm, but it also has dimensions in pixels. For example, a full frame 36x24 mm sensor might be divided into 6000x4000 pixels. The sensor size in mm is all important for computing Field of View or Depth of Field. And the sensor mm dimensions also affect the necessary enlargement factor to print size, but the pixel dimensions are also important for viewing the image on screen or paper.

Data Size is the image uncompressed size in bytes when file is opened into computer memory (but image size viewed on the monitor screen is still dimensioned in pixels).

File Size is its size in bytes stored in a file (which is Not a meaningful number regarding how the image might be used). Image size is in pixels, not bytes (file size is in bytes). Data compression can affect file size drastically smaller, but it is still the same image size in pixels. So saying “I have an 8 megabyte JPG file” says nothing to describe the image size. Image size is dimensioned in pixels.

Print Size is its size when printed on paper (dimensioned in inches or mm, as is the print paper). The size of film is also inches or mm. Sensor size (mm) or film size (mm) must be enlarged to the print or viewing size. By varying the printing resolution (pixels per inch on paper), we can print the image about any size we wish, but the quality will vary. 250 to 300 dpi are usual high quality goals.

In strong contrast to paper, monitor screen size is dimensioned in pixels, and image size is also dimensioned in pixels. The image pixels fit the screen pixels one for one, so to speak. A 600x400 image will show as 600x400 pixels on the screen. If the image size is larger than the screen size, we normally are shown a temporary resampled copy of more suitable smaller size. However, print paper is dimensioned in inches or mm, so images for printing must be scaled to be spaced out so many pixels per inch or mm (often called dpi, jargon for pixels per inch on paper). See basic differences, and more detail between using images printed or on the video screen.

The most common type of color image (such as any JPG file, but Not Raw files) is the RGB 24-bit choice. Note that uncompressed 24-bit RGB data is three bytes per pixel, regardless of image size. However many/most files are compressed into a smaller file size (JPG is normally compressed to unusually small size, which can involve some quality losses). Compressed files are uncompressed again when opened into computer memory for showing (the count of pixels remains unchanged).

These are not the only choices, but they are good and reasonable choices — More information:

JPG FormatPNG FormatTIF FormatGIF FormatRaw files

Major considerations to choose the necessary file type include:

  • Compression quality - Lossy type for smallest files (JPG), or Lossless type for best quality images (TIF, PNG). Lossless means what you put into the file will come back out again. But Lossy can take liberties with some of the details in order to compress tighter. Compression varies with type of compression, but degree of compression also varies with the image content (bland areas with sparse detail, like walls or sky, compress very effectively, High detail areas compress less effectively). Compression is a real big deal concerning file size, but you definitely would NOT want your bank account, or your text document or spreadsheet to use lossy compression.

    But file size is also very dependent on image size (in pixels). A 0.24 megapixel image file (600x400 pixels) will be vastly smaller than a 24 megabyte image file (6000x4000 pixels), regardless of compression. 24-bit color is always 3 bytes per pixel (before compression).

  • 8-bit mode full 24-bit RGB color is normal for photos (TIF, PNG, JPG). Or Indexed Color is for graphics (PNG, GIF, TIF).
  • 16-bit mode (48-bit RGB color data) is sometimes desired (TIF and PNG). Wide-range tonal shifts (gamma and white balance) in the initial editing processing can benefit from more than 8-bits. Scanners and cameras are at least 12-bits for this reason.
    However our monitors and printers expect 8-bit data. And JPG is only 8-bits.
  • Type PNG-24 is 24-bit RGB color for photos. PNG-8 is Indexed color for graphics, a maximum of 256 colors.
  • GIF is indexed color only (for graphics today), but indexed is also an option in TIF and PNG.
  • Transparency or Animation is used in graphics (GIF and PNG).
  • Documents - images of graphics and text - line art, multi-page, fax, etc - this will be TIF files. Text commercially uses G3 or G4 compression, but LZW works too.
  • Commercial prepress wants CMYK color (TIF files).

See Properties chart above. We select the file type that supports the properties we need.

The only reason for using lossy compression is for smaller file size, usually for internet transmission speed or storage space. Web pages require JPG or GIF or PNG image types, because some browsers do not show TIF files. On the web, JPG is the clear choice for photo images (smallest file, with image quality being less important than file size), and GIF is common for graphic images, but indexed color is not normally used for color photos (PNG can do either on the web).

Other than the web, TIF file format has been the undisputed leader when best quality is desired, largely because TIF is so important in commercial printing environments. High Quality JPG can be pretty good too, but don't ruin them by making the files too small. If the goal is high quality, you don't want small. Only consider making JPG large instead, and plan your work so you can only save them as JPG only one or two times. Adobe RGB color space may be OK for your home printer and profiles, but if you send your pictures out to be printed, the mass market printing labs normally only accept JPG files, and only process sRGB color space.

What does JPG Quality Losses mean?
What are JPG artifacts?

Something we all need to know, but it takes more to show this, so it was placed on its own page.

All photo editor programs will support these next file formats, which will generally support and store images in the following color modes:

Color data mode of File Types, bits per pixel

JPG The most popular format for camera or web images.

RGB - 24-bits (8-bit color), or Grayscale - 8-bits

JPG always uses lossy JPG compression, but its degree is selectable, for higher quality but larger files, or lower quality but smaller files.JPG is for photo images, and is not the best choice for most graphics or text document data.

Any time you Save a JPG image, you specify the degree of JPG compression you want in a setting called JPG Quality, which runs 1 to 10 or sometimes 1 to 100 (which is the same thing). If you want for sure a decent JPG image, I suggest a JPG Quality at least 8 (or 80) or 9 (or 90). But 10 (or 100) is not likely delectably better. But if you just need the file to be small, and don't really care if it is top quality, then a lower number like 7, or maybe even 6. However note that file size also depends on the number of megapixels, and a smaller image may be all you need.

One quirk I can't explain, if you use the Adobe Elements or Photoshop menu Save For Web (which removes all EXIF data), its numerical JPG Quality runs 0 to 100, but the same number there gives better JPG Quality than its Save As JPG menu. Save For Web may call a number like 60 as High Quality. But different programs can do JPG differently, and may vary in how they number JPG Quality.

TIF

Versatile, many formats supported. But the internet web cannot show TIF file images.
Modes: RGB or Grayscale or Indexed Color or Line Art or CMYK or LAB, and others.
8 or 16-bits per color channel, called 8 or 16-bit "color" (24 or 48-bit RGB files).
Grayscale - 8 or 16-bits,
Indexed color - 1 to 8-bits,
Line Art (bilevel)- 1-bit

For TIF files, most programs have options of either no compression or LZW compression (LZW is lossless, but is less effective reducing file size of images). Adobe Photoshop also provides JPG or ZIP compression in TIF files too (but which greatly reduces third party compatibility of those TIF files). "Document programs" allow ITCC G3 or G4 compression for 1-bit text (Fax is G3 or G4 TIF files), which is lossless and tremendously effective (small) and all of that is TIF. Many specialized image file types (like camera RAW files) are TIF file format, but using special proprietary data tags limiting compatibility to Raw programs designed for them.

24-bits is called 8-bit color, three 8-bit bytes for RGB (256x256x256 = 16.78 million colors maximum.)
Or 48-bits is called 16-bit color, three 16-bit words (65536x65536x65536 = trillions of colors conceptually)

PNG

PNG is selected from two choices PNG8 or PNG24. PNG8 is 8 bits indexed color, a maximum of 256 colors, but 8 colors is suitable for most graphics. PNG24 is 24 bit color suitable for color images.

Modes: RGB - 24 or 48-bits (called 8-bit or 16-bit "color"),
Alpha channel for RGB transparency - 32 bits
Grayscale - 8 or 16-bits,
Indexed color - 1 to 8-bits,
Line Art (bilevel) - 1-bit

Supports transparency in regular indexed color, and also there can be a fourth channel (called Alpha) which can map RGB graduated transparency (by pixel location, instead of only one color, and graduated, instead of only on or off).

The APNG version also supports animation (like GIF), showing several sequential frames fast to simulate motion (but very few if any photo editors support it).

PNG uses ZIP compression which is lossless, and somewhat more effective color compression than GIF or TIF LZW. For photo data, PNG is slightly smaller files than LZW compression in TIF or GIF files, but larger files than JPG (however PNG is lossless, and JPG is not.) PNG is a newer format than the others, designed to be both versatile and royalty free, back when royalty for the patent for LZW compression was disputed for GIF and TIF files.

GIF

Indexed color - 1 to 8-bits (8-bit indexed color, limited to only 256 colors maximum.) Each color is 24-bit color, but only 256 colors can be indexed with 8 bits. The beauty of indexed color is for graphics with limited colors. Only 16 colors can use a 4 bit index, smaller for every pixel.

One color in indexed color can be marked transparent, allowing underlying background color to be seen (for text images, for example). GIF is for an online video image, and the file contains no dpi information for printing. GIF is an 8 bit index supporting only 256 colors, which is barely passible for full color images, but it was used that way at first. GIF was designed by CompuServe for their online images in the days of dialup and the then 8-bit indexed computer video, whereas other file formats are 24-bits today. GIF was intended to be a smaller image for internet downloads with slow modems. However, GIF is still seen in web use of graphics containing only a few colors, when it is a small lossless file, much smaller and better than JPG for graphics or text images. Or PNG8 is very comparable to GIF.

It turns out that GIF's LZW compression had been patented by Unisys, and in the early 1990s, it was feared there would be royalty charges for using GIF images. So PNG was developed about 1994 as a GIF replacement using royalty free ZIP compression (which actually compresses slightly better). But the GIF royalty issue was not pressed (and the patent expired in 2003 & 2004), and both formats continue today. PNG generally has more features, but PNG does not support GIF's animation.

GIF uses lossless LZW compression. (for Indexed Color, see second page at GIF link at page bottom).

GIF also supports one transparent color and also, animation showing several sequential frames fast to simulate motion.

Note that if your image size is say 3000x2000 pixels, then this is 3000x2000 = 6 million pixels (6 megapixels). Assuming this 6 megapixel image data is RGB color and 24-bits (or 3 bytes per pixel of RGB color information), then the size of this image data is 6 million x 3 bytes RGB = 18 million bytes. That is simply how large your image data is (see more). Then file compression like JPG or LZW can make the file smaller, but when you open the image in computer memory for use, the JPG may not still have the same image quality, but it is always still 3000x2000 pixels and 18 million bytes. This is simply how large your 6 megapixel RGB image data is (megapixels x 3 bytes per pixel).

Difference in photo and graphics images

Photo images have continuous tones, meaning that adjacent pixels often have very similar colors, for example, a blue sky might have many shades of blue in it. Normally this is 24-bit RGB color, or 8-bit grayscale, and a typical color photo may contain perhaps a hundred thousand RGB colors, out of the possible set of 16 million colors in 24-bit RGB color.
Grayscale 8-bit images can have 256 shades of gray (0..255 from black to white). RGB color images have three component values (of Red, Green, Blue), each of 8 bits, which can combine to be one of a total of 256x256x256 = 16.78 million possible colors (called 24 bit color). For example, one color of Orange might be RGB(255, 165, 0) (which is #ffa500 hexidecimal). See more detail about RGB. Colors can be 16 bits, but our monitors and printers are 8 bit devices.

Graphic images are normally not continuous tone (gradients are possible in graphics, but are seen less often). Graphics are drawings, not photos, and they normally use relatively few colors, maybe only two or three, often less than 16 colors in the entire image. In a color graphic cartoon, the entire sky will be only one shade of blue where a photo might have dozens of shades. A map for example is graphics, maybe 4 or 5 map colors plus 2 or 3 colors of text, plus blue water and white paper, often less than 16 colors overall. These few colors are well suited for Indexed Color, which can re-purify the colors. Don't cut your color count too short though, there will be more colors than you count. Every edge between two solid colors likely has maybe a couple of shades of anti-aliasing smoothing the jaggies (examine it at maybe 500% size). Insufficient colors can rough up the edges.

Scanners have three modes to create the image:

  • Color (for scanning color work) If Negative Film mode, color mode automatically removes the orange film mask.
  • Grayscale (like scanning B&W photo or other work with varying gray tones)
  • Line art (sometimes called Black & White mode). Line art is a special case, only two colors (black or white, with no gray), specifically black text or lines on white paper, for example clip art, fax, and text. However, Low Resolution line art (like cartoons on the web) is often better as grayscale, which adds anti-aliasing to hide the jaggies.

JPG files are very small files for continuous tone photo images, but JPG is poor for graphics, without a high Quality setting. JPG requires 24-bit color or 8-bit grayscale, and the JPG artifacts are most noticeable in the hard edges of graphics or text. GIF files (and other indexed color files) are good for graphics, but are poor for photos (too few colors possible). However, graphics are normally not many colors anyway. Formats like TIF and PNG can be used either way, 24-bit or indexed color — these file types have different internal modes to accommodate either type optimally.

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.

  • Scanning: It calculates the scanned output image size created if the area is scanned at the dpi resolution.
    Scanning 10×8 inches at 300 dpi will produce (10 inches×300 dpi)×(8 inches×300 dpi) = 3000×2400 pixels. Your scanner program surely shows you the same information (at least if in an Advanced Scan mode allowing control).
  • Video monitors: Video does not use dpi, but scanners do. The calculator shows that if you scan a 6×4 inch print at 100 dpi, it will create a 600×400 pixel image, and the monitor will show it at that same 600×400 pixel size.
  • Printing: It also calculates the required image size (pixels) to print this image size (inches or mm) on paper at the dpi resolution.
    3000×2400 pixels printed at 300 dpi will print (3000 pixels / 300 dpi)×(2400 pixels / 300 dpi) = 10x8 inches on paper. Meaning, if you want to print 8×10 inches at 300 dpi, then you need 2400×3000 pixels. See a Printing Guidelines page and/or Resolution Basics.
  • TIP: If you both scan and then print at the same dpi, it will print a copy at the same original size. To do that, scan and print just have to be the same dpi number, but 300 dpi will be a great number for a high quality print. Photos are best printed on a photo quality printer on photo grade paper.

    Scaling: If you scan at 600 dpi and print at 300 dpi, it will print double size.
    If you scan at 150 dpi and print at 300 dpi, it will print half size.
    If you both scan and print at same 300 dpi, it will print original size.
    Printing involves how many pixels you have, and how they will be spaced on paper.
    But printing dialogs often offer scaling to print at a different dpi than specified in the image file, which will be different inches, spaced as pixels per inch.

Call it dpi or ppi as you prefer. The idea is that this scanning and printing resolution is the spacing of the pixels on paper, pixels per inch. But video images are directly sized in pixels, and video does not use printing dpi.

So there are no dpi on monitor video screens. Video images are shown on the video screen at their actual size in pixels (however they can be first resampled to a different size copy 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. Screen size will be like perhaps 1920x1280 pixels. It only shows screen images of that dimension, regardless if a cell phone or a wall TV.

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 about all that will help for photo work). That is speaking of printing resolution, NOT scanning resolution. Small film needs high scanning resolution for enlargement.

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.

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, 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 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, 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 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 FormatPNG FormatTIF FormatGIF FormatRaw files

Menu of the other Photo and Flash pages here

Photo Image file formats, TIF, JPG, PNG, GIF. Which to use? (2024)
Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6097

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.