Skip to content

Topmost pixels of Big PNG object gets black using insert_image() function #4128

Closed
@LasseStaeglichPP

Description

@LasseStaeglichPP

Description of the bug

When using PyMuPDF's insert_image function to insert a transparent PNG into a PDF, certain areas of the image (notably the topmost pixels) appear as solid black in the generated PDF. This issue is most noticeable in large PNG images (~300 DPI, dimensions such as 56 cm x 100 cm)
I tried the insert_image() function with the Image parameter as a File, Pixmap and stream. All had the same result

Here the resulting PDF file:
23511_1_No.pdf
Screenshot of the PNG wihtout the issue
image
Screenshot of the PDF with the issue
image

The PNG was sadly to big for uploading so i here is a wetransfer link:
https://we.tl/t-1VdSrVImwP

How to reproduce the bug

use insert_image() function with a large PNG with transparency and semi transparency

PyMuPDF version

1.24.12

Operating system

Windows

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions