Image examples and test method

These examples use original test graphics, not stock photos or a collection of typical camera images.

What we compare

Each comparison changes one stated setting or format. The source dimensions, output file size and relevant encoder settings appear with the example. Open the original files to inspect them without the page's display scaling.

What the results mean

These are demonstrations of particular effects. They do not establish a universal winner between formats or predict the smallest file for your photos. Quality slider numbers are not comparable across encoders.

Reproduce an example

Download the sample source and use the recorded settings. Different software versions can produce different bytes. The measurements shown here describe the supplied files.

Text and compression

Original test graphic with text and fine colored lines.
Source PNG
Download original file
Same graphic exported as a quality-30 JPEG.
JPEG: quality 30, 4:2:0
Download original file
Same graphic exported as a quality-90 JPEG.
JPEG: quality 90, 4:4:4
Download original file

Look for speckles around letters and blurred colored edges in the quality-30 JPEG. Both JPEG quality and color sampling differ here; this is not a quality-only comparison. Open the full-size views to see the differences.

Compare at full size

Source PNG

Original test graphic with text and fine colored lines.

JPEG: quality 30, 4:2:0

Same graphic exported as a quality-30 JPEG.

JPEG: quality 90, 4:4:4

Same graphic exported as a quality-90 JPEG.
Settings and measurements
FileDimensionsBytesExport settings
text-source.png1024 × 51222,860Optimize: True
text-jpeg-q30.jpg1024 × 51219,828Quality: 30, Subsampling: 2, Optimize: True
text-jpeg-q90.jpg1024 × 51257,293Quality: 90, Subsampling: 0, Optimize: True

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

Transparency on different backgrounds

Partly transparent blue badge on a checkerboard, with an opaque white center.
PNG on a transparency grid
Download original file
The same badge on white: the blue looks lighter and the white center blends into the background.
Same PNG on white
Download original file
The same badge on dark: the blue looks darker, while the center stays white.
Same PNG on dark
Download original file

The grid marks transparent areas; it is not part of the PNG. The blue shape is partly transparent, so its color changes with the background. The white center is opaque and stays white.

Settings and measurements
FileDimensionsBytesExport settings
alpha-source.png450 × 30013,126Optimize: True
alpha-on-white.png450 × 30011,183Optimize: True
alpha-on-dark.png450 × 30010,552Optimize: True

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

A gradient reduced to eight colors

Reducing this gradient to eight colors turns the smooth transition into bands. Dithering is off here; other GIF exports can use more colors and dithering.

Settings and measurements
FileDimensionsBytesExport settings
gradient-source.png768 × 192793Optimize: True
gradient-eight-colors.gif768 × 1923,155Optimize: False

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

Crop or fit

The square crop cuts off the side labels and part of the sun. Fit keeps the whole picture and adds white space above and below.

Settings and measurements
FileDimensionsBytesExport settings
composition-3x2.png900 × 6007,461Optimize: True
composition-square-crop.png600 × 6005,156Optimize: True
composition-square-fit.png600 × 60016,283Optimize: True

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

Enlarging a small source

A small raster image of text.
110 × 33 source
Download original file
The small image enlarged with nearest-neighbor sampling.
Nearest-neighbor enlargement
Download original file
The small image enlarged with bicubic sampling.
Bicubic enlargement
Download original file

The source is shown at its original size. Nearest-neighbor enlargement makes square pixels visible; bicubic makes smoother, softer edges. Neither restores the lost letter detail.

Settings and measurements
FileDimensionsBytesExport settings
small-source.png110 × 333,741Optimize: True
upscale-nearest.png660 × 1986,057Optimize: True
upscale-bicubic.png660 × 19859,138Optimize: True

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

Vector and raster scaling

Vector circle and triangle rendered at the display size.
Vector artwork
Download original file
Similar shapes from a 32-pixel raster enlarged with nearest-neighbor sampling.
32 × 32 raster enlarged
Download original file

The vector keeps smooth edges when enlarged. The 32 × 32 raster shows square steps with nearest-neighbor enlargement; other resizing methods can soften those steps.

Settings and measurements
FileDimensionsBytesExport settings
vector-shape.svg256 × 256302Default
raster-shape-enlarged.png256 × 256847Optimize: True

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2

Orientation is stored separately

Both files store the same 320 × 200 pixels. Orientation 6 tells the browser to rotate them 90° clockwise, so the arrow points right and the displayed size becomes 200 × 320.

Settings and measurements
FileDimensionsBytesExport settings
orientation-1.jpg320 × 2008,068Quality: 95, Subsampling: 0
orientation-6.jpg320 × 2008,068Quality: 95, Subsampling: 0

Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2