Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For a preservation-oriented image archive, keep the source image and create compressed delivery derivatives from it whenever future crops, reprocessing, legal review, or fidelity may matter. Compression is not inherently wrong for a master: archival guidance allows compression for both masters and derivatives. The deciding factor is whether the chosen method preserves the fidelity your archive requires and can be recovered over time.

Should you compress originals or only derivatives?

Keep the archive’s source or master role distinct from files generated for display and delivery. Derivatives are secondary files optimized for particular uses; access copies commonly use lossy compression. If you might need to make a different crop, change display sizes, revisit color handling, or verify a supplier’s submission, retain the highest-fidelity input available and generate derivatives from it.

There is no universal rule that masters must remain uncompressed. FADGI’s 2023 Technical Guidelines for Digitizing Cultural Heritage Materials state: “Compression may be appropriate for both master and derivative files.” The right choice depends on the archive’s retention goals, intended use, storage considerations, and ability to recover or migrate the file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What kind of compression is being applied?

“Compression” can describe different operations, and an archive policy should say which one its workflow performs.

Lossless compression

A lossless method reduces storage while preserving the data needed to reproduce the same decoded image. It may be appropriate for a master when it meets the archive’s fidelity requirements and the encoding can be decoded, managed, and migrated throughout the intended retention period.

Lossy image re-encoding

A lossy encoder discards image information to reduce file size. JPEG-like access formats are common examples. Re-encoding the only retained source this way is an irreversible policy choice: later derivatives cannot restore detail that was discarded. The National Archives and Records Administration (NARA) recommends lossless compression when continued fidelity to the exact appearance is desired, and cautions that proprietary compression methods can create migration difficulties. See its Digital-Imaging and Optical Digital Data Disk Storage Systems report (June 2004).

Container or archive compression

Wrapping existing file bytes in a compressed archive is not the same as decoding and re-encoding the image. The container operation need not change the image’s pixel data, while image re-encoding may change pixels, color information, metadata, or format. Document which operation a workflow uses rather than calling both simply “compression.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a policy based on what the archive must preserve

  • Retain source bytes and compress derivatives when future editing, recropping, new display sizes, color adjustments, supplier verification, or the best available fidelity matter. Identify the generated files as derivatives.
  • Use lossless compression for a master when it reduces storage without sacrificing required fidelity and the format has adequate documentation and a viable recovery or migration path.
  • Keep a lossy-compressed master only by explicit policy when the retained input is already a delivery asset or the organization knowingly accepts the irreversible loss and resulting fidelity limits. Record what was retained and why; this is a policy decision, not a universal archival requirement.

When comparing methods, consider whether they are lossless, whether later editing or recropping is likely, how well the format is documented, whether it can be migrated, storage capacity and cost, the intended delivery use, and whether processing can be repeated consistently. FADGI identifies storage and application as relevant to compression choices; NARA highlights fidelity and migration risk. The cited guidelines address digitization and archival practices, so they are general guidance rather than binding rules for every commercial archive.

Protect Go services from oversized image decodes

Compression makes files smaller on disk, but a compact image can expand into a large pixel buffer when decoded. Go’s security guidance identifies large-image decoding as a resource-control concern and recommends checking dimensions with image.DecodeConfig before fully decoding untrusted input. The Go image package documentation explains that DecodeConfig reads image configuration from the header without allocating a full-size pixel buffer, which makes it useful for checking dimensions first.

  1. Read the image configuration. Use image.DecodeConfig on the input before calling image.Decode.
  2. Apply application limits. Check width, height, and total pixels against limits chosen for your service’s workload and available resources. There is no universal maximum in the cited Go guidance.
  3. Reject out-of-policy files before full decoding. Do not proceed to image.Decode when dimensions exceed your application’s limits.
  4. Decode only accepted files. Continue to full decoding after the size check, then produce the required derivatives under your documented policy.

This check addresses the memory risk of decoding oversized images; it does not decide whether an image belongs in the archive as a master or which compression method meets preservation needs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep source and derivative identity clear

A durable workflow should make it possible to distinguish retained sources from generated access files and explain how each was produced. Document the compression and transformation policy, including whether image re-encoding is lossy or lossless. Define any additional metadata, checksum, and backup practices according to the collection’s requirements; no single implementation is prescribed by the archival guidance cited here.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.