What is image compression? Smaller files, lossy or lossless

Published , by the PrintBlob team.

Image compression stores an image in fewer bytes than its raw pixels need. Lossy compression, such as JPEG, makes files much smaller by discarding detail that cannot be recovered; lossless compression, such as PNG, keeps every pixel exactly. The choice decides how a file behaves when it is saved again, enlarged or printed.

Compression is not resolution. A compressed image has the same width and height in pixels as before; what changes is how faithfully those pixels are kept.

How lossy compression loses detail

Cloudinary’s explanation of JPEG describes the mechanism: the encoder divides values by a quantisation constant and the decoder multiplies them back, and the rounding in between loses information. A larger constant gives a smaller file and more loss; quality 100 means no quantisation. JPEG also halves the resolution of its colour channels by default (4:2:0 chroma subsampling), which can cause colour to bleed across repeated saves.

The consequence for a shop is generation loss. Opening a JPEG and saving it again re-encodes it, and each time adds loss that cannot be undone, even at a higher quality setting. Cloudinary’s advice is blunt: the number of generations matters more than the quality setting you use. Copying a file unchanged does no harm.

What it means for print files

  • Edit in a lossless format, export last. Keep originals as PNG or TIFF and save a JPEG only at the end, once.
  • Do not compress to fix a big file. A smaller JPEG of a logo adds blocky edges around sharp lines and flat colour, which show up at the printed size.
  • Transparency needs a format that stores it. A JPEG has no transparent background, so a logo saved as one prints as a rectangle; see transparent background.
  • File size is not quality. A 20 MB photo can still be 800 pixels wide, and a small PNG can be exactly right at the print size.

Choosing a format

Format Compression Good for
PNG Lossless Logos, transparency, text, print files
JPEG Lossy Photographs where no transparency is needed
WebP Either (lossy or lossless) Compact web images

The W3C’s PNG specification states the lossless design goal: filtering and compression should preserve all information. See lossless compression for how that works.

Common mistakes

  • Re-saving a customer’s JPEG several times while “cleaning it up”.
  • Saving a PNG logo as JPEG to cut size, then losing the transparent background.
  • Measuring quality by megabytes rather than by pixels at the printed size; see print resolution.

In PrintBlob

Customers can upload PNG, JPEG and WebP images, up to 20 MB each by default, set under WooCommerce › Settings › PrintBlob, and a design keeps up to 10 of them. PrintBlob keeps the customer’s original upload as they sent it, and PrintBlob Pro downloads it from the order. The print PNG is made at the print area’s size at 300 DPI. The designer warns below 150 DPI at the placed size, which a heavily compressed image can fail even when its file is large. The guide on customer image upload covers what makes an upload printable.

Sources