Compression reduces the bytes needed to store an image, but the smallest file is rarely the only goal. A product photo must still show texture. A screenshot should keep its text sharp. A logo may need transparent edges. Good compression is a balance between visible quality, file size, format support, and the dimensions at which people will see the result.
GoldieKit's image compressor lets you compare quality and file size, including an optional target size. Treat its output as a candidate to inspect, not as a guarantee that the target can be reached without damage. The focused target-size guide explains the controls; this article helps you decide what to optimize.
Lossless preserves samples; lossy approximates them
Lossless compression reconstructs the stored image data exactly after decoding. PNG uses lossless compression and is useful for flat graphics, screenshots, and transparency. Lossy compression discards some information to save more bytes. JPEG is lossy and often works well for photographs, but heavy compression can create blockiness, ringing around edges, and smudged fine texture.
WebP can be used in lossy or lossless modes and can preserve transparency. AVIF may offer strong compression in many cases, but encoding support and workflow compatibility should be checked with the destination. No format wins on every image. A complex photograph, a line drawing, and a screenshot have different statistical patterns, so compare actual exports rather than relying on a slogan.
Dimensions and compression work together
A 4000-pixel-wide image displayed at 600 pixels wastes pixels even if its JPEG quality is low. Resize to a plausible output width first, then tune compression. Fewer pixels reduce both download size and decoding work. But resizing too far makes the result soft on large or high-density displays. The pixels and display-size article helps choose a width.
Quality sliders are not standardized measurements across encoders. “80” in one application may not match “80” in another. Compare the visible result and final bytes, especially around faces, text, fine lines, gradients, and shadows. Inspect at 100% zoom and at the expected display size; a flaw that is obvious when zoomed in may be invisible in a small card, while a fine product label may remain important.
| Image type | Good candidates to compare | What to inspect |
|---|---|---|
| Photograph | JPEG, lossy WebP, AVIF where supported | Skin, texture, gradients, and edges |
| Screenshot with text | PNG, lossless WebP | Letters, thin rules, and flat-color regions |
| Transparent logo | PNG, transparent WebP | Edge halos and alpha preservation |
| Mixed illustration | PNG and WebP variants | Flat areas and photographic regions |
Use a target byte size carefully
Some upload forms impose a hard cap. A target-size control can search for an encoding setting that approaches it, but there may be no acceptable result at the original dimensions. If the output still exceeds the cap, reduce dimensions modestly or choose a different format if the receiving app accepts it. If it reaches the cap but looks poor, reconsider the content: perhaps a tighter crop or smaller intended display size works better.
Do not repeatedly recompress a previously lossy file if the original is available. Each new lossy export can compound artifacts. Start from the best source, make a small number of candidates, and keep the original for future uses.
Cosmo tip: Compare bytes and appearance side by side. “Smaller” is useful only if the image still does its job.
A repeatable workflow
Define the destination: website card, email, social post, or strict upload form. Determine the largest display size and whether transparency is required. Make a resized copy if the source is oversized. Export two or three formats or quality levels with Compress image and Convert image. Compare the downloaded files in the destination, not just in the tool preview.
Record the format, dimensions, and byte size of the winner. If you prepare a batch, test a representative photograph, a dark image, and a detailed image first. One setting may not work equally well for all. For a website, check both the visual result and whether the file actually loads where it is used.
Mistakes to avoid
JPEG cannot preserve transparency. A transparent source converted to JPEG needs a background color. PNG is not always “higher quality” than JPEG in a practical sense; it preserves data exactly, but a huge PNG photograph may be unnecessary for the intended use. Likewise, a tiny lossy export may create artifacts that harm trust in a product image. Choose based on the image's role and the receiving system's support.
Worked example: a product photo under a size cap
Suppose a shop accepts images up to 1 MB and your source photo is 5 MB at 3000 × 2000 pixels. The product page displays it at roughly 900 pixels wide. First create a copy around 1800 pixels wide so a high-density screen still has useful detail. Then compare JPEG and WebP exports at several quality settings. The target is not the lowest slider value that falls under 1 MB; it is the smallest candidate that still shows stitching, material texture, and any printed label accurately.
If the 1800-pixel candidate cannot meet the cap without obvious artifacts, consider a tighter crop that removes unused background or a slightly smaller dimension. Do not hide a defect by checking only the site thumbnail; customers may open the full image. If the receiving platform recompresses uploads, inspect the published version too. The file you upload and the file visitors receive may differ.
For a screenshot with small interface text, repeat the experiment with PNG and lossless WebP. A format and quality choice that worked for the photograph can blur letters or create halos around thin lines. This is why one universal compression preset rarely serves every asset well.
Use one representative comparison set
Pick a photo with hair or texture, a screenshot with small text, and a graphic with flat colors. Export each at the intended display width in the formats your destination accepts. Record bytes and inspect at normal display size plus 100% zoom. This prevents a quality setting tuned on a smooth photograph from silently smearing a diagram. Keep the originals and the chosen settings so later images can be judged against the same baseline.
Put the ideas to work
Focused guides
For a shorter, step-by-step walkthrough: