@KJ
excuse me, I meant jpeg.
Thanks! I’ve added a minimal sample PDF + the source PNG here: (link).
I’m not relying on viewer defaults—I compute the page size as points = pixels * 72 / targetDPI and draw the CGImage 1:1 (no interpolation). Despite that, thin glyphs show “holes” at typical zoom in Preview/PDFKit.
Do you know if iOS/macOS forces a particular image filter (e.g., JPEG re-encode) or disables smoothing for 1-bit/grayscale images inside PDFs? Any flag to guarantee lossless Flate (8-bit) or CCITT G4 (1-bit)?
Agree that PDF has no intrinsic DPI—only user space. That’s why I scale the page so one image pixel maps cleanly at a chosen effective DPI. The issue persists even with 8-bit grayscale (not just 1-bit).
Are there known viewer behaviors in Preview/PDFKit that render bilevel/high-contrast rasters without anti-aliasing? If so, would your recommendation be to (a) embed as 8-bit grayscale at 2× resolution, or (b) pre-apply a tiny morphological close/blur to avoid “holes”? Any other reliable workaround?
I hope it's useful