Skip to content

Compression

Image Compression Formats

Here are some examples for image compression on-the-fly with size comparison before and after compression.

JPEG

JPEG is a lossy image compression algorithm, which means that JPEG affects the visual precision of the compressed image. In Inteliver JPEG compression API, you can set the compression level (image quality) from a range of [0, 100].

Level zero result in a very small image size while affecting the visual precision alot. Level one hundred will result in the best quality image with biggest size.

Original Image
No Compression

Original Image

Original Image Size: 111 KB

JPEG Compression (Quality Level: 80)

i_o_format_jpg_80
Image file format

Compressed Image Size: 27.4 KB
Compression Ratio: ~4x

JPEG Compression (Quality Level: 40)

i_o_format_jpg_40
Image file format

Compressed Image Size: 14.1 KB
Compression Ratio: ~8x

JPEG Compression (Quality Level: 20)

i_o_format_jpg_20
Image file format

Compressed Image Size: 9.3 KB
Compression Ratio: ~12x

WEBP

Webp is a lossy image compression algorithm, which means that Webp affects the visual precision of the compressed image. In Inteliver Webp compression API, you can set the compression level (image quality) from a range of [0, 100].

Level zero result in a very small image size while affecting the visual precision alot. Level one hundred will result in the best quality image with biggest size.

Original Image
No Compression

Original Image

Original Image Size: 111 KB

WEBP Compression (Quality Level: 80)

i_o_format_webp_80
Image file format

Compressed Image Size: 20.2 KB
Compression Ratio: ~5x

WEBP Compression (Quality Level: 40)

i_o_format_webp_40
Image file format

Compressed Image Size: 10.6 KB
Compression Ratio: ~10x

WEBP Compression (Quality Level: 20)

i_o_format_webp_20
Image file format

Compressed Image Size: 7 KB
Compression Ratio: ~15x

PNG

PNG is a lossless image compression algorithm. The PNG compression will not affect the visual precision of the image and after decoding the compressed image is identical to the original one. Hoewever, the compression level is a trade-off between file size and encoding/decoding speed.

In Inteliver PNG compression API, you can set the compression level from a range of [1, 9] where level-1 produces the biggest file size and fastest decoding mode and level-9 result in the samllest file size with the slowest decoding time.

Original Image
No Compression

Original Image

Original Image Size: 303 KB

PNG Compression Level: 1

i_o_format_png_1
Image file format

Compressed Image Size: 303 KB
Compression Ratio: 1x

PNG Compression Level: 6

i_o_format_png_6
Image file format

Compressed Image Size: 274 KB
Compression Ratio: 1.1x

PNG Compression Level: 9

i_o_format_png_9
Image file format

Compressed Image Size: 267 KB
Compression Ratio: ~1.2x