PNG
Choose lossless raster output when exact edges and transparency outweigh file size.
Family 02
The useful first split is not “old versus new,” but pixels versus vectors and lossy versus lossless representation.
| Format | Capabilities | Good fit | Watch for |
|---|---|---|---|
| PNG .pngimage/png | Lossless raster compression and alpha transparency. PNG is chunk-based; APNG adds animation in compatible readers. | UI graphics, diagrams, screenshots, and images where exact pixels or transparency matter. | Photographs are often much larger than with a suitable lossy format. |
| JPEG .jpg .jpegimage/jpeg | Lossy raster coding designed around continuous-tone images. No standard alpha channel. | Photographs and other complex scenes where some controlled loss is acceptable. | Repeated re-encoding accumulates artifacts; sharp text and flat-color edges can degrade visibly. |
| WebP .webpimage/webp | Lossy or lossless raster images, alpha transparency, metadata, and animation inside a RIFF container. | Web delivery when the complete consumer set supports WebP. | The RIFF size field limits a conforming WebP file to roughly 4 GiB. |
| SVG .svgimage/svg+xml | XML-based vector graphics with shapes, paths, text, styling, and optional scripting or external references. | Icons, diagrams, logos, and illustrations that should scale without rasterization. | Treat untrusted SVG as potentially active content, not as an inert bitmap. |
A format is only one part of image quality. Dimensions, encoder settings, color profile, and the receiving application matter too.
Choose lossless raster output when exact edges and transparency outweigh file size.
Choose a controlled lossy encode and inspect the result at its real display size.
Choose vectors for geometry, while accounting for fonts, filters, and the security context.