Menu

1 / 2

A 1,600-pixel photo in a PDF: how many pixels should Android keep?

DEV Community: kotlin·Stepan Maksymov·3 days ago
#wZd8JA80
#devtokotlin#devto#dev#picture#compressor
Long article (506 words) — no AI summary yet.
Reading 0:00
15s threshold

A PDF can draw the same photo twice: once as a thumbnail on a contents page and again as a full-page illustration. If a compressor examines only the thumbnail, both copies can end up blurry. They share one underlying image. Opening the contents page first should have no effect on what the reader sees on page ten.

Here’s how a PDF compressor on Android can make that decision. The numbers below come from the geometry of a small regression-test document, so you can reproduce the calculation without installing it.

Start with the size on paper

Take a 1,600 × 1,200 pixel picture. Draw it in a rectangle 160 × 120 PDF points, using the standard 72 points per inch. The printed width is about 2.22 inches. The effective density is 720 pixels per inch:

1600 pixels × 72 points per inch / 160 points = 720 ppi

Enter fullscreen mode

Exit fullscreen mode

In this compressor, a density above 225 ppi makes the image eligible for downsampling. The target is 150 ppi.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.