Kozea / Kozea/CairoSVG

Handling of large size PNG

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

Description

Hello there, I'm trying to convert to PNG a SVG file. The output PNG file should be roughly 81k width for 7k height, however Cairo returns a CAIRO_STATUS_INVALID_SIZE when the output PNG file would be above 32k\*32k. If I set the scale to 0.4 or the dpi to 35 I manage to get a pixelated version of my SVG with a width under 32k but that's not precise enough for my uses. I guess the 32k\*32k limitation is a memory one since the PNG format itself is not limitated in height/width. 81k\*7k is half of 32k\*32k so it should be ok in terms of memory. Is there then a mean to tune the call/the library to allows it ? Or, if not, to output in several PNG files if the initial SVG size is too big (PNG that could be merged later) ? I don't know if a tool exists that can split SVG so that I could feed them to `svg2png` and then somewhat merge the PNG files. That's what I trying to do right now, but it seems more logic to split the PNG files than the SVG files (pixels vs xml), hence this issue. Thank you !
EDIT : or maybe there's a way to get a compressed PNG as output if the size is too much (I don't know much about the PNG format, that may be dumb).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by investigating the svg2png conversion path and how Cairo reports CAIRO_STATUS_INVALID_SIZE for the requested 81k by 7k output. Determine whether CairoSVG can support that size or whether splitting the rendered result is required; done means a clearly defined supported behavior for oversized PNG output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.