Skip to main content

Convert a SVG file into a PNG file using Inkscape

Project description

svg2png is a Python package that provides a simple function to convert SVG (Scalable Vector Graphics) files into PNG (Portable Network Graphics) format. The conversion is performed using Inkscape, a powerful vector graphics editor.

Features:

  • SVG to PNG Conversion: Utilizes Inkscape to handle the conversion.
  • Validation: Checks if the input file is a valid SVG and if Inkscape is installed and accessible.
  • Error Handling: Provides meaningful error messages if the SVG file is invalid or if Inkscape is not found.

Usage:

To convert an SVG file to PNG, simply call the svg2png function with the path to your SVG file:

from svg2png import svg2png

svg2png('path/to/your/icon.svg')

Requirements:

  • Inkscape: Ensure that Inkscape is installed and added to your system PATH.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svg2png-1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

svg2png-1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file svg2png-1.0.tar.gz.

File metadata

  • Download URL: svg2png-1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for svg2png-1.0.tar.gz
Algorithm Hash digest
SHA256 3b229ea74a1bcf46a17c046b0b5e7a62954d2c4d32ad30bc2fd5d26e79b155f8
MD5 bc3c6a9f20a1c92ed2b0bb16077a39bf
BLAKE2b-256 ec3d201aca754dcd4be1a1181840376be17181c7d95cb45e82dc859412de8fd1

See more details on using hashes here.

File details

Details for the file svg2png-1.0-py3-none-any.whl.

File metadata

  • Download URL: svg2png-1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for svg2png-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02e83ce9e1e0924dc6d14d501c14adc28b3af58c69672aec7de67e09d3b5ade1
MD5 1d6d99faec9d0e67268ff43c5424f1b4
BLAKE2b-256 739d2330b413f4725ef8da04c8dac56c8913bab80327eefa0f7d9e3e93533270

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page