Kozea / Kozea/CairoSVG

Wrong svg to png conversion after latest update

Open
#391 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
951
Forks
166
PR merge metrics
No merged PRs in 30d

Description

In the latest updates when an SVG is converted to png the output does not come as expected (the colors are lost). I believe its because of the change in the cairosvg/image.py file where a check is added to convert "CMYK" to "RGB".

```
82 if image.mode == "CMYK":
83 image = image.convert("RGB")
```

Can I ask what is this doing. Maybe there is a problem while converting CMYK to RGB.
Sorry I am not providing the files but I found the error after updating and then rolled back to the previous version.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in cairosvg/image.py at the CMYK-to-RGB conversion around lines 82-83 and compare the behavior with the previous version. Obtain a reproducible SVG or expected PNG output, then verify that the conversion preserves the intended colors before adding a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.