SShortSingh.
Back to feed

Why PDF image extractors return the stored picture, not the one visible on the page

0
·7 views

A developer found that pdfimages, PyMuPDF, pdf.js and ImgIng all returned the stored pixels of an image, ignoring rotation, mirroring and clipping applied on the page. The tools did apply a palette /Decode inversion, which suggests they handle instructions attached to the image object but not those in the page's content stream. A second test, one image object painted four times under different clip shapes, supported returning the object itself, since the visible portion would otherwise differ per placement. Visible-part extraction would also require a chosen resolution and, for non-rectangular clips, an alpha channel, while PyMuPDF's clip bounding boxes gave inaccurate coverage estimates for triangles and circles. The author notes this explanation is an inference from observed behaviour rather than documented tool design.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Guia de bloqueador de anúncios com IA para Smart TVs em 2024

Um novo guia técnico descreve como filtrar anúncios diretamente em Smart TVs usando modelos de linguagem leves e detecção visual executados localmente. A abordagem combina um proxy de interceptação de tráfego, como o mitmproxy, com um dispositivo na rede, como um Raspberry Pi ou NAS. O texto justifica a iniciativa pelas exigências regulatórias de consentimento de dados na União Europeia, pelo consumo de banda gerado por anúncios e pela expectativa do público por experiências sem propagandas. O material inclui um passo a passo de instalação e exemplos de código para classificação de URLs e detecção de frames publicitários.

0
ProgrammingDEV Community ·

Developer Builds CareKit, an Open-Source AI Assistant for a Friend's Daily Life

A developer has created CareKit, a personal AI assistant meant to help a close friend manage everyday tasks, routines, and priorities. The project was submitted to the Hacktoberfest Weekend Challenge, which encourages building something for someone in one's life. The app is built on open-weight AI models and open-source tools, so it can be adapted and customized rather than tied to a single proprietary provider. The developer notes that this approach offers more control and flexibility, and that depending on the model license and setup, local processing could keep personal data on the user's device. The project is publicly available on GitHub for others to explore and contribute to.

0
ProgrammingDEV Community ·

DIY AI Ad Blocker for Smart TVs: A 2024 Setup Guide

A new guide explains how to build an AI-based ad blocker that can work with most smart TVs in 2024. The approach runs on low-cost hardware such as a Raspberry Pi, an Intel NUC, an Android TV box, or a home NAS. It combines a quantized language model that flags textual ad cues with a lightweight object detector that spots visual overlays in the video stream. Traffic from the TV is routed through a man-in-the-middle proxy, mitmproxy, which applies the AI filter before content reaches the screen. The tutorial provides setup steps, installation commands, and performance notes to help readers judge whether their hardware and bandwidth can support it.

0
ProgrammingDEV Community ·

Guía 2024 para bloquear anuncios en Smart TV con IA en un dispositivo local

Un tutorial publicado en DEV Community explica cómo usar inteligencia artificial para bloquear anuncios en televisores inteligentes en 2024. El enfoque combina un modelo de lenguaje ligero con visión por computadora para detectar anuncios en tiempo real. La guía incluye scripts listos para ejecutarse en hardware modesto como una Raspberry Pi, un Intel NUC o un NAS Synology. También presenta pruebas de latencia y reducción de datos, junto con consideraciones de seguridad y privacidad bajo el RGPD.