Compression

Image 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

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: ~4

JPEG Compression (Quality Level: 40)

i_o_format_jpg_40

Image file format

Compressed Image Size: 14.1 KB
Compression Ratio: ~8

JPEG Compression (Quality Level: 20)

i_o_format_jpg_20

Image file format

Compressed Image Size: 9.3 KB
Compression Ratio: ~12

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

Original Image

Original Image Size: 303 KB

PNG Compression

Compression Level: 1

i_o_format_png_1

Image file format

Compressed Image Size: 303 KB
Compression Ratio: 1

Compression Level: 9

i_o_format_png_9

Image file format

Compressed Image Size: 267 KB
Compression Ratio: ~1.2