Skip to content

Conversation

@hwbehrens
Copy link

Add documentation for svg2png, a tool that converts SVG images to PNG format using the cairo graphics library.

The page includes examples for:

  • Basic SVG to PNG conversion
  • Width/height scaling with aspect ratio preservation
  • Combined width and height specifications
  • Scale factor usage
  • stdin/stdout piping
  • Image flipping (horizontal/vertical)

Checklist

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR contains at most 5 new pages.
  • The PR is authored by me, or has been human-reviewed if it was created with AI or machine translation software.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented: v0.1.3

Add documentation for svg2png, a command-line tool that renders SVG images
to PNG format using the cairo graphics library.

The page includes examples for:
- Basic SVG to PNG conversion
- Width/height scaling with aspect ratio preservation
- Combined width and height specifications
- Scale factor usage
- stdin/stdout piping
- Image flipping (horizontal/vertical)
@github-actions github-actions bot added new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers. labels Nov 21, 2025
Copy link
Member

@Managor Managor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spotted these from the source code.

Update examples to show both short and long form flags for width, height, and scale options as requested in PR review.

- Convert an SVG from stdin to PNG on stdout:

`cat {{path/to/file.svg}} | svg2png - - > {{path/to/output.png}}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the double - - on purpose? Usually a single - is used to read from stdin


`svg2png {{[-s|--scale]}} {{2.0}} {{path/to/file.svg}} {{path/to/output.png}}`

- Convert an SVG from stdin to PNG on stdout:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Convert an SVG from stdin to PNG on stdout:
- Convert an SVG from `stdin` to PNG on `stdout`:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants