Sampling and subsampling
When optimizing a PDF file, both average downsampling and subsampling are techniques used to reduce the resolution of images to decrease the file size. However, they differ in how they achieve this reduction.
Average downsampling
-
Method: Average downsampling reduces the resolution of an image by averaging the color values of multiple pixels into a single pixel. For example, if you are downsampling by a factor of 2, a 2x2 block of pixels in the original image is averaged to produce one pixel in the downsampled image.
-
Quality: This method tends to produce smoother and higher-quality images because it takes into account the color information of all the pixels in the block, resulting in less aliasing and more accurate color representation.
-
Use Case: Average downsampling is often used when maintaining image quality is important, such as in high-quality print documents.
Subsampling
-
Method: Subsampling reduces the resolution by simply selecting one pixel from a block of pixels and discarding the rest. For example, if you are subsampling by a factor of 2, a 2x2 block of pixels in the original image is reduced to one pixel by selecting one of the four pixels and ignoring the others.
-
Quality: This method can result in lower image quality because it does not consider the color information of the discarded pixels, which can lead to aliasing and loss of detail.
-
Use Case: Subsampling is often used when file size is a higher priority than image quality, such as in web documents or when bandwidth is limited.
Summary
In the context of optimizing a PDF file, the choice between average downsampling and subsampling depends on the desired balance between image quality and file size.
-
Average Downsampling: Produces higher-quality images by averaging pixel values, resulting in smoother images with less aliasing.
-
Subsampling: Produces lower-quality images by selecting one pixel from a block and discarding the rest, resulting in faster processing and smaller file sizes but with potential loss of detail and increased aliasing.