Image compression: dimensions, quality and transparent backgrounds

Choose JPEG, PNG or WebP, separate pixel resizing from byte savings, preserve transparency and check the downloaded file format.

Content reviewed ·

The problem and context

Photos, screenshots and transparent icons have different compression needs. Dimensions set the number of pixels; encoding and quality influence the resulting bytes. Converting a JPEG to PNG can increase file size, and a downloaded extension should match the actual encoding.

Method and calculation

Start with a maximum width suited to the image’s display size, then compare JPEG, PNG and WebP. Choose a background before flattening transparency into JPEG. PNG is lossless and ignores the quality slider. Each adjustment uses the cached original, avoiding repeated compression of an earlier result.

Worked example

A 4000×3000 image resized to a maximum width of 1600 becomes 1600×1200. Each side is scaled by 0.4 and only 16% of the pixels remain; that does not promise an 84% reduction in bytes. An input of 1000000 bytes followed by an output of 1200000 bytes is a 20% increase, so compare quality and format again.

Checklist

PNG and WebP can store alpha; JPEG writes the chosen background into the pixels. Browser codecs, color conversion and image content affect the result, and WebP quality 100 does not guarantee lossless output. SVG becomes a bitmap, animation uses its default frame and original EXIF metadata is not copied.

Image compression and resizing

Upload image

Drop an image here; a new file replaces the source and result.

Up to 64 MiB, 16384 pixels per side and 32 million pixels in total. Supports browser-decodable images, including SVG, AVIF and ICO.

Output settings

Files are processed locally. SVG is rasterized, animation uses its default frame and original EXIF and other metadata are not copied.

Use these tools with this article

  • Image Base64 Converter

    Encode PNG, JPEG, GIF, WebP and BMP, or restore the original image from Base64.

  • Aspect Ratio

    Reduce integer image or video dimensions to an exact ratio, then scale by a target width or height to the nearest whole pixel.

  • Image Compressor

    Resize images in your browser, export JPEG, PNG or WebP, compare actual file sizes and choose a JPEG background for transparent areas.

  • Image Rotate & Flip

    Rotate by 90° or flip the current view, compare it with the original, then download PNG.

Sources