When we save a bitmap image, we can choose between lossy and lossless compression schemes to reduce the file size that stores the color information for each pixel that composes the bitmap.
Lossless compression schemes retain all the original color information; therefore, they keep the original quality but produce a large file size. On the other hand, lossy compression schemes replace some color information with approximated values to produce a smaller file size. Thus, lossy compression schemes don't keep the original quality.
In this recipe, we will learn how to choose between one scheme over the other—the smaller size is not the only thing that matters.
We are going to capture ...