You have a picture and one decision to make: save it as JPEG or as PNG. The short answer is that JPEG suits photographs, where a small loss of detail is acceptable, and PNG suits screenshots, logos, diagrams and anything with a see-through background, where every edge and pixel must stay exact.

This guide explains what each format does to your pixels, shows how to measure a saving with a worked example, and ends with decision rules you can apply to any image. It does not quote typical file sizes, because the size you get depends on the picture itself.

The core difference: lossy versus lossless

The JPEG standard, ITU-T T.81, defines two classes of process, lossy and lossless. It calls a process lossless when the decoder output is identical to the encoder input, and lossy when it is not. The processes based on the discrete cosine transform (DCT) are the lossy ones, and image files described as JPEG on the web use that route. The picture is cut into 8 × 8 blocks of pixels, and a step called quantization scales the block values so the data compresses well. Quantization is where detail is thrown away.

PNG takes the opposite approach. Its specification lists losslessness as a design goal: filtering and compression should preserve all information. The compression method is DEFLATE, a member of the LZ77 family, which exploits repeated sequences of data. The decoder returns exactly the samples that went in. The article on how DEFLATE works explains the method, and lossless vs. lossy compression covers the general trade-off.

Feature JPEG PNG
Compression Lossy, DCT-based Lossless, DEFLATE
Transparency No alpha channel Optional alpha channel, or transparent palette entries
Sample precision 8 or 12 bits per sample in DCT-based processes 1 to 16 bits per sample, depending on the color type
Palette (indexed) color Not part of the standard Yes, 1 to 256 palette entries
Described as best for Photographs Screenshots, diagrams, line art, images needing transparency

Why photographs and flat graphics behave differently

A photograph is made of smooth gradients and fine, irregular texture. Few neighboring pixels match exactly, so a method that hunts for exact repeats has little to work with, while a lossy method can drop detail the eye barely notices. The standard's own title names its target: continuous-tone still images.

A screenshot, logo or chart is the opposite. It has large areas of one color, hard edges and sharp text. Exact repeats are everywhere, so lossless compression works well. A lossy method does harm here: a widely used web-platform guide warns that lossy compression on content that needs sharpness, such as diagrams or charts, can give unsatisfactory results, with blurring and colored fringes around text and sharp edges.

One more point from T.81: the amount of compression depends on the characteristics of the particular image and on the picture quality you ask for. You cannot predict a size from the format name alone. Two different images saved in the same format can land far apart.

A worked example: measuring a saving

Start from the uncompressed size, which depends only on the pixel grid. The image file size calculator applies the formula bytes = width × height × bits per pixel ÷ 8. Then compare any saved file against that baseline with the compression ratio calculator.

Worked example. Example: a 1920 × 1080 image at 24 bits per pixel.

  1. Pixels: 1,920 × 1,080 = 2,073,600 (2.0736 megapixels).
  2. Uncompressed size: 2,073,600 × 24 ÷ 8 = 6,220,800 bytes, about 6.22 MB.
  3. Suppose a saved file is 777,600 bytes. This value is assumed for the exercise because it gives round results. It is not a measurement of any real encoder.
  4. Compression ratio: 6,220,800 ÷ 777,600 = 8, written 8:1.
  5. Percent saved: (1 − 777,600 ÷ 6,220,800) × 100 = 87.5%, or 5,443,200 bytes of space saved.

A lossless file reaches a number like this only if the picture has enough repeated data. A lossy file reaches it by discarding detail.

If you see a saving, ask which of the two routes produced it. If detail was discarded, you cannot get it back from the smaller file.

Decision rules you can apply today

Match the format to the content, not to habit.

Your image Choose Reason
A photograph with no transparency JPEG Lossy DCT compression targets continuous-tone images
A screenshot, chart, diagram or line art PNG Lossless storage keeps text and sharp edges clean
A logo or icon on a see-through background PNG JPEG has no alpha channel
A graphic with only a few flat colors PNG, possibly with a palette Indexed color stores a small palette plus one index per pixel
An image you will edit again A lossless copy, such as PNG Each lossy save can discard more detail
A photograph that also needs transparency PNG, or a newer format See WebP and AVIF

For simple shapes that must stay sharp at any size, a third option exists: vector graphics store drawing instructions instead of pixels.

Common mistakes

  • Saving screenshots as JPEG. The lossy step blurs thin lines and text. Use PNG for anything with sharp edges.
  • Re-saving a JPEG again and again. Every lossy save processes pixels that are already altered. Edit from an original and save the JPEG once at the end.
  • Expecting a transparent background from JPEG. The format has no alpha channel, so see-through areas must be replaced by a solid color before saving. Choose PNG for transparency.
  • Converting a JPEG to PNG to "restore" quality. PNG keeps the damaged pixels exactly as they are. The detail does not come back, and the file may even get larger.
  • Comparing quality numbers between tools. The standard defines quantization tables stored inside the file, not a universal quality scale, so the same slider value can mean different things in different encoders.
  • Assuming PNG is always bigger. It depends on the content. Test your own image in both formats and compare the results.

FAQ

Is PNG always larger than JPEG?

No. A flat graphic with large uniform areas can compress very well without any loss, while a photograph usually has fewer exact repeats. Save your own image both ways and compare the sizes.

Can a PNG be lossy?

The format stores exactly the samples it is given. Lossy results come from steps before storage, such as reducing a picture to a palette of at most 256 colors, which discards color information.

Does JPEG support transparency?

No. The format has no alpha channel. If you need see-through areas, use PNG or one of the newer formats.

What if my image is half photograph and half text?

Judge by the part that suffers most. Sharp text and edges show lossy damage quickly, so check them at full size before choosing. A lossless copy is the safe starting point.

Sources

  1. W3C, Portable Network Graphics (PNG) Specification (Third Edition). Accessed November 6, 2026.
  2. ITU-T, Information technology - Digital compression and coding of continuous-tone still images - Requirements and guidelines (Recommendation T.81). Accessed November 6, 2026.
  3. ITU-T, Recommendation T.81 (09/92), full text as hosted by the W3C. Accessed November 6, 2026.
  4. Mozilla (MDN Web Docs), Image file type and format guide. Accessed November 6, 2026.