Image File Formats Compared - JPEG, PNG, GIF, TIFF, SVG and PDF
What You Need to Know
Image formats are not interchangeable “file wrappers” — each format bakes in compression behavior, color limits, transparency rules, metadata support, and whether it stores raster pixels or scalable vectors. In digital image editing, choosing the wrong format is a fast way to get:
- visible artifacts (blockiness, banding)
- broken transparency
- wrong colors in print
- huge files
- blurry logos/icons
Core definitions (the exam-grade version)
- Raster formats store an image as a grid of pixels: JPEG, PNG, GIF, TIFF.
- Vector formats store shapes/paths mathematically: SVG, and often content inside PDF.
- Lossy compression throws away information to reduce file size (quality decreases): JPEG (and optionally in TIFF/PDF if they embed JPEG).
- Lossless compression reduces size without losing image information: PNG, GIF (palette-limited), TIFF (when using lossless methods).
Why this matters (typical use cases)
- Photos for web: JPEG (small, good for continuous tone).
- Graphics with transparency: PNG (true alpha) or SVG (vector).
- Simple animations: GIF (palette-limited) (or modern alternatives, but GIF is common).
- Archiving / print workflows: TIFF (high bit depth, flexible, widely supported in print).
- Logos/icons/diagrams: SVG (resolution-independent).
- Final delivery for print/multi-page/vector+raster: PDF (layout-preserving, press standards).
Critical reminder: Transparency is not one thing. PNG supports true alpha; GIF is effectively 1-bit transparency; JPEG has no transparency.
Step-by-Step Breakdown
A practical decision workflow (exporting the “right” file)
Decide: raster or vector?
- If it must scale perfectly (logo, icon, line art): choose SVG or PDF.
- If it’s a photograph or pixel-based painting: choose JPEG/PNG/TIFF.
Decide: web/screen or print/archive?
- Web/screen: JPEG/PNG/GIF/SVG.
- Print delivery or long-term master: TIFF or PDF.
Check transparency needs
- No transparency needed: JPEG is fine for photos.
- Soft edges/partial transparency needed: PNG (raster) or SVG/PDF (vector).
- Only hard on/off transparency and tiny palettes: GIF.
Check color + bit depth requirements
- High-quality editing/retouching, smooth gradients: prefer TIFF (often 16-bit/channel).
- Web graphics with limited colors: PNG-8 or GIF.
Choose compression + settings
- JPEG: pick a quality level; watch for artifacts.
- PNG: lossless; optimization reduces size without changing pixels.
- TIFF: pick compression method (LZW/ZIP lossless; JPEG lossy).
- PDF: choose presets (print vs smallest size), embedding fonts, image downsampling.
Verify with a quick inspection
- Zoom to and for artifacts/edges.
- Toggle background behind transparent edges.
- Soft-proof if destined for print (format choice interacts with color management).
Micro “worked” decisions
- You have a product photo for a website hero banner: JPEG (good quality/size tradeoff).
- You have a UI icon with transparency: PNG (or SVG if it’s vector).
- You must send a press-ready multi-page brochure: PDF (often PDF/X).
- You want a future-proof master of a retouched photo: TIFF (lossless, high bit depth).
Key Formulas, Rules & Facts
File size math you can use on exams
Uncompressed raster size (before compression) is approximately:
Common bits per pixel (bpp):
- RGB 8-bit/channel:
- RGBA 8-bit/channel:
- RGB 16-bit/channel:
Compression ratio varies by content (flat color compresses well; noise compresses poorly).
High-yield comparison table
| Format | Raster/Vector | Compression | Transparency | Color limits | Typical strengths | Typical weaknesses |
|---|---|---|---|---|---|---|
| JPEG (.jpg) | Raster | Lossy (DCT-based) | None | Typically 8-bit/channel; supports YCbCr; chroma subsampling common | Small files for photos; ubiquitous | Artifacts on text/line art; repeated saves degrade; no alpha |
| PNG (.png) | Raster | Lossless (DEFLATE) | Yes (alpha up to 8/16-bit) | Truecolor; can be paletted; supports gamma info | Crisp UI/text; perfect edges; transparency | Larger than JPEG for photos; not designed for CMYK print |
| GIF (.gif) | Raster | Lossless LZW-style coding of indexed pixels | 1-bit transparency (on/off) | 256 colors max (indexed) | Simple animations; tiny flat graphics | Banding/dithering; terrible for photos; limited transparency |
| TIFF (.tif/.tiff) | Raster container | Lossless or lossy depending on codec (LZW/ZIP/JPEG/etc.) | Possible (alpha) | Often supports high bit depth; RGB/CMYK/others | Print/archival masters; flexible; metadata | Big; “TIFF” isn’t one compression; compatibility varies |
| SVG (.svg) | Vector (XML) | Typically uncompressed text; can gzip as SVGZ | Yes (vector transparency) | Not limited like raster; depends on viewers | Infinitely scalable logos/icons; editable | Not ideal for complex photo-like imagery; rendering differences |
| PDF (.pdf) | Container (vector + raster) | Mixed; can be lossless or lossy inside | Yes | Strong color management/ICC support | Final delivery, multi-page, print standards | Can embed downsampled images; editing can be limited |
JPEG essentials (what’s tested)
- Lossy compression: repeated saving compounds damage.
- Uses block-based transforms (commonly blocks), causing block artifacts at low quality.
- Often uses chroma subsampling (e.g., ) to reduce color detail more than luminance.
- Modes you may see:
- Baseline JPEG: sequential loading.
- Progressive JPEG: loads in passes (useful on slow connections).
PNG essentials
- Lossless; saving repeatedly does not degrade pixels.
- Supports:
- True alpha transparency (soft edges, shadows).
- Grayscale, truecolor, or indexed (paletted) variants.
- Interlacing: Adam7 (progressive-like display).
- Common variants in editors:
- PNG-24/32: truecolor (32 implies alpha).
- PNG-8: indexed palette, smaller, but limited colors.
GIF essentials
- Indexed color only: max colors per frame.
- Animation support (frame-based with timing + disposal methods).
- Transparency is single-color keying (effectively on/off), not soft alpha.
TIFF essentials
- TIFF is a container: capabilities depend on tags + codec.
- Common compressions:
- None (huge)
- LZW (lossless)
- ZIP/Deflate (lossless)
- JPEG (lossy)
- PackBits (simple RLE-like; lossless)
- Can store multiple pages (multi-page TIFF) and lots of metadata.
- BigTIFF exists for very large files (addresses beyond classic TIFF limits).
SVG essentials
- Vector paths + text in XML.
- Can embed raster images, but then it’s no longer purely resolution-independent.
- Can be styled/animated via CSS/SMIL and scripted (security policies may restrict this).
- Great for logos, icons, diagrams; not for photo realism.
PDF essentials
- PDF can contain:
- vector art (paths)
- embedded raster images (often JPEG/JPEG2000/Flate)
- fonts, text, spot colors, profiles
- Print workflows often require standards:
- PDF/X variants for press (constrains color, fonts, transparency rules depending on version).
- “Save as PDF” may downsample/compress images depending on preset.
Examples & Applications
Example 1: Web photo vs web graphic
- Scenario: You have a photograph and a logo for the same webpage.
- Best picks:
- Photo: JPEG at a quality that avoids visible blocks/banding.
- Logo: SVG (best), or PNG if you need pixel-perfect raster.
- Key insight: JPEG is optimized for continuous tone; SVG/PNG preserve hard edges.
Example 2: Transparent overlay on a photo
- Scenario: You designed a badge with soft shadow that must sit on top of varying backgrounds.
- Best pick: PNG (RGBA).
- Why: GIF transparency will halo (1-bit), and JPEG cannot do alpha.
Example 3: Archive master vs sharing copy
- Scenario: You retouched a high-res portrait and want a master plus a shareable version.
- Best picks:
- Master: TIFF with lossless compression (LZW/ZIP), keep higher bit depth if available.
- Share: JPEG sized for the destination.
- Key insight: keep a lossless master; export lossy derivatives.
Example 4: Delivering artwork to print
- Scenario: A poster includes vector text/logos plus embedded photos.
- Best pick: PDF (print preset), ensuring fonts embedded and images not overly downsampled.
- If asked “why not TIFF?”: TIFF is raster-only; you’d have to rasterize the text/logos, losing crisp scaling.
Common Mistakes & Traps
Mistake: Using JPEG for logos/text/UI
- What goes wrong: fuzzy edges, ringing artifacts, “mosquito noise” around text.
- Fix: use PNG or SVG.
Mistake: Assuming PNG is always smaller than JPEG
- Why wrong: PNG is lossless; photos have high entropy and compress poorly in PNG.
- Fix: use JPEG for photos, PNG for flat graphics/transparency.
Mistake: Expecting GIF to handle smooth transparency
- Why wrong: GIF transparency is effectively binary.
- Fix: use PNG (soft alpha) or export as video/other modern web formats when allowed.
Mistake: Believing “TIFF = lossless” by definition
- Why wrong: TIFF can use lossy JPEG compression internally.
- Fix: check TIFF compression settings (choose LZW/ZIP if you need lossless).
Mistake: Confusing DPI with pixel dimensions when choosing formats
- Why wrong: For raster images, the real detail is in pixel dimensions; DPI is metadata until print.
- Fix: decide on required pixel size first; then set DPI for print context.
Mistake: Flattening vectors unintentionally when exporting to PDF
- What goes wrong: text becomes raster, edges soften, file balloons.
- Fix: use PDF presets that preserve vectors; avoid “rasterize everything” options.
Mistake: Color issues from wrong expectations (screen vs print)
- What goes wrong: PNG/JPEG are commonly used in RGB screen workflows; print may expect CMYK/ICC-managed PDFs.
- Fix: for print delivery, prefer PDF (with proper profiles/standards) or TIFF when specifically requested.
Mistake: Re-saving JPEG multiple times during editing
- Why wrong: each save re-quantizes and accumulates artifacts.
- Fix: edit in a lossless/master format (e.g., TIFF or native project file), export JPEG at the end.
Trap to watch: “PDF” and “TIFF” are containers. Two PDFs can behave totally differently depending on what’s embedded and how it’s compressed.
Memory Aids & Quick Tricks
| Trick / mnemonic | Helps you remember | When to use |
|---|---|---|
| J = Just photos (lossy) | JPEG is best for continuous-tone photos, not sharp graphics | Picking web formats quickly |
| PNG = Pixels + (a)lpha | PNG keeps pixels intact and supports real alpha transparency | Any transparency/clean edges need |
| GIF = Graphics In Frames | GIF is about indexed graphics and animation frames | If you need simple looping animation |
| TIFF = The “I’ll Fix it in Future” file | TIFF is a flexible high-quality master/print workflow choice | Archiving, round-tripping, print assets |
| SVG = Scales Very Great | SVG stays crisp at any size | Logos, icons, diagrams |
| PDF = Print/Portable Document Format | PDF preserves layout, pages, fonts, vector + raster | Final delivery, proofs, press-ready files |
Quick Review Checklist
- JPEG: lossy, no transparency, best for photos, artifacts worsen with re-saves.
- PNG: lossless, true alpha, best for UI/text/graphics and transparency; big for photos.
- GIF: max colors, 1-bit transparency, supports animation; poor for photos.
- TIFF: raster container; can be lossless or lossy depending on compression; great for masters/print.
- SVG: vector XML; best for logos/icons/diagrams; resolution-independent.
- PDF: container for vector+raster+text+fonts; best for final delivery/print/multi-page.
- Always ask: raster vs vector, lossy vs lossless, transparency, print vs screen, master vs derivative.
You’ve got this — if you can justify your format choice with compression + transparency + use case, you’ll ace the questions.