Tool guides and practical topics/Images, files and local processingImage compression: dimensions, quality and transparent backgroundsChoose JPEG, PNG or WebP, separate pixel resizing from byte savings, preserve transparency and check the downloaded file format.Content reviewed · 2026-11-16The problem and contextPhotos, 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 calculationStart 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 exampleA 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.ChecklistPNG 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 resizingUpload imageChoose image fileDrop 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.Restore defaultsClearOutput settingsMaximum widthKeep original dimensions2560 px1920 px1600 px1280 px800 pxOutput formatJPEGPNGWebPQuality 75%Applies to JPEG and WebP; higher values usually retain more detail and may produce larger files.JPEG background #FFFFFFJPEG has no alpha channel; transparent areas are composited onto this color.Original imageFiles 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 articleImage Base64 ConverterEncode PNG, JPEG, GIF, WebP and BMP, or restore the original image from Base64.Aspect RatioReduce integer image or video dimensions to an exact ratio, then scale by a target width or height to the nearest whole pixel.Image CompressorResize images in your browser, export JPEG, PNG or WebP, compare actual file sizes and choose a JPEG background for transparent areas.Image Rotate & FlipRotate by 90° or flip the current view, compare it with the original, then download PNG.Sourceshtml.spec.whatwg.org · 1web.dev · 2web.dev · 3developers.google.com · 4