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.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

svg2png-1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for svg2png-1.2.tar.gz
Algorithm Hash digest
SHA256 70511371e192baccff3bcc0da3f8bfdb7fe7e6b05013ece0705872906472bd7b
MD5 7579404a4ae731c31649b1ce13ea9067
BLAKE2b-256 b6997a6f97ba2ecca07f1df95ea65110c571d768ee780e2579b9322edd72ad8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: svg2png-1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94d706ae46f0fb23df5c9afc9e5654a249f8e9046b3abdb87d2e581780ba0d65
MD5 8ea50c1e9f15227443f9e2e284ef5e7b
BLAKE2b-256 de74499bddbd648580b68921d7a45cd3edd21f8e5466a67aff2de7144e7a5fe5

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