Skip to content

SVG to PNG conversion removes gradients #4963

@AlexanderPodorov

Description

@AlexanderPodorov

Description of the bug

See example code, run it and see the difference.

from pathlib import Path

from pymupdf import open as open_doc

original_image_file = Path("Complete_neuron_cell_diagram_en.svg")

png_image_file = Path("Complete_neuron_cell_diagram_en.png")

with open_doc(original_image_file) as doc:
    doc[0].get_pixmap(dpi=100, alpha=True).save(png_image_file)

How to reproduce the bug

PyMuPDF version

1.27.2.2

Operating system

MacOS

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream bugbug outside this package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions