Skip to content

Support for additional SVG path commands beyond cubic Bézier curves #4

@APR18

Description

@APR18

Hi, thank you for this great project!

Currently, the algorithm seems to convert only cubic Bézier curves into accurate pixelated equivalents. I'm trying to use it with SVG paths that include other command types like M, L, and possibly Z. Here's an example of the SVG path I'm working with:
<path d="M 70.002535,99.204056 L 70.083650,99.122940 L 73.409379,99.122940 L 73.490494,99.204056 L 73.490494,99.366286 L 73.571610,99.447402 L 73.571610,100.015209 L 54.185044,1.784537" stroke="black" stroke-width="0.01" fill="none"/>

My pipeline uses OpenCV to detect contours from an image, writes those to an SVG file, and then feeds that into the algorithm. However, since the current implementation seems tailored for cubic Béziers, the output becomes a bit janky when used with these other path types.

By janky, I mean the pixelated output has inconsistent stroke widths — some areas are one pixel wide, while others are two pixels wide. This breaks the uniformity expected in pixel art aesthetics.

Do I need to make major changes to the codebase to support other path commands like lines and moves, or can this be addressed with minor tweaks? I had some trouble understanding the Java code structure, so any pointers or guidance would be really helpful.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions