SVGConverter
SVGConverter wraps a PNG or JPEG image in an SVG container. It provides a small Python API, command-line interface, and desktop GUI.
Important: current
embedmode Base64-encodes the original raster image into an SVG<image>element. It does not trace pixels into vector paths, and it does not inherently reduce file size. A futurevectorizemode is tracked separately.
Installation
SVGConverter requires Python 3.10 or newer. After v1.2.0 has been published to PyPI:
python -m pip install --upgrade svgconverter
To run the current development version instead:
git clone https://github.com/KageRyo/SVGConverter.git
cd SVGConverter
python -m pip install .
Command line
Convert one image, retaining its dimensions in the generated SVG:
svgconverter image.png
svgconverter photo.jpg --output output.svg
Convert all supported images immediately inside a directory:
svgconverter ./images --output-dir ./svg-output
Outputs are never overwritten unless --overwrite is supplied. Run
svgconverter --help for all options. Supported inputs are PNG, JPG, and JPEG
(including upper-case extensions); recursive conversion and image optimization
are not part of the current release.
Python API
from svgconverter import SVGConverter, convert_file
convert_file("image.png", "image.svg")
converter = SVGConverter(overwrite=True)
result = converter.convert_directory("./images", "./svg-output")
print(result.success_count, result.failure_count)
convert_file() returns the output pathlib.Path. Directory conversion returns
a BatchResult containing successful output paths and per-file failures, so a
bad image does not abort the entire batch.
GUI
Install the package and run:
svgconverter-gui
The legacy development command python main.py starts the same GUI. The GUI
currently selects a directory and offers Traditional Chinese, English, and
Japanese. It uses the same public conversion API as the CLI.
Release process
The tag workflow uses PyPI Trusted Publishing instead of a long-lived API token. Before the first release, configure a pending or normal PyPI Trusted Publisher for:
- owner:
KageRyo - repository:
SVGConverter - workflow:
release.yml - environment:
pypi
After the pull request is merged, create an annotated v1.2.0 tag whose
version matches pyproject.toml. The workflow builds, checks, publishes to
PyPI, and then creates a GitHub Release with the distributions attached.
Contributing and license
See CONTRIBUTING.md for local checks and commit conventions. This project is licensed under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file svgconverter-1.2.0.tar.gz.
File metadata
- Download URL: svgconverter-1.2.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e0534916df63710b8165e30019ef3afde57e610d249fddad71a599c4a86eb92
|
|
| MD5 |
b5818722eb5cc7383c5b17237161ee97
|
|
| BLAKE2b-256 |
c5d9e1f104d280186ae4f2dbc3f3cf2ef617c2cc038e8af9cc648b91c27315ca
|
Provenance
The following attestation bundles were made for svgconverter-1.2.0.tar.gz:
Publisher:
release.yml on KageRyo/SVGConverter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svgconverter-1.2.0.tar.gz -
Subject digest:
8e0534916df63710b8165e30019ef3afde57e610d249fddad71a599c4a86eb92 - Sigstore transparency entry: 2403382165
- Sigstore integration time:
-
Permalink:
KageRyo/SVGConverter@6d8ab00a93ebe5328f054e0e6264bcac578a8969 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/KageRyo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6d8ab00a93ebe5328f054e0e6264bcac578a8969 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svgconverter-1.2.0-py3-none-any.whl.
File metadata
- Download URL: svgconverter-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
618ba235b87ba29556ae37d65b9c63faa25c775c8906048040af31e259a757ff
|
|
| MD5 |
7f753e16f844345ce0849ab278e3a36d
|
|
| BLAKE2b-256 |
35fc019b3067e7313472a688d1df3f3c0c764fddbe0c2a170f17d03a4e259f67
|
Provenance
The following attestation bundles were made for svgconverter-1.2.0-py3-none-any.whl:
Publisher:
release.yml on KageRyo/SVGConverter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svgconverter-1.2.0-py3-none-any.whl -
Subject digest:
618ba235b87ba29556ae37d65b9c63faa25c775c8906048040af31e259a757ff - Sigstore transparency entry: 2403382825
- Sigstore integration time:
-
Permalink:
KageRyo/SVGConverter@6d8ab00a93ebe5328f054e0e6264bcac578a8969 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/KageRyo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6d8ab00a93ebe5328f054e0e6264bcac578a8969 -
Trigger Event:
push
-
Statement type: