https://github.com/snailedlt/svg-recolor
Website, API and CLI to let you easily recolor/tint svg files
https://github.com/snailedlt/svg-recolor
coloring fastapi foss image-editing open-source python solo-project svg svg-editing tinting vercel
Last synced: 4 months ago
JSON representation
Website, API and CLI to let you easily recolor/tint svg files
- Host: GitHub
- URL: https://github.com/snailedlt/svg-recolor
- Owner: Snailedlt
- License: mit
- Created: 2024-06-27T10:19:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-23T15:33:13.000Z (over 1 year ago)
- Last Synced: 2025-11-22T16:04:00.512Z (10 months ago)
- Topics: coloring, fastapi, foss, image-editing, open-source, python, solo-project, svg, svg-editing, tinting, vercel
- Language: HTML
- Homepage: https://svg-recolor.jorgenkh.no
- Size: 3.08 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# SVG Recolor
[](https://github.com/Snailedlt/svg-recolor/blob/main/LICENSE)
[](https://wakatime.com/badge/github/Snailedlt/svg-recolor)
[](https://ko-fi.com/snailedlt)
[](https://buymeacoffee.com/snailedlt)
SVG Recolor is a simple CLI tool, API and website to recolor SVG files. It is written in python.
> [!NOTE]
> Submodules have their own licenses and may or may not be covered by the license of this project. Check the submodule's license for details.
> [!WARNING]
> This project is still under construction and may not be fully functional yet.
## Features
[Website](#website): Use the intuitive web interface to recolor SVG files without any setup.
[API](#api): Integrate SVG recoloring into your applications with ease.
[CLI Tool](#cli-tool): Recolor SVG files directly from your terminal with this Python script.
[Legacy Shell Script](#legacy-shell-script): Same as above, but with a shell script (not maintained).
## Usage
### Website
The website is hosted at [svg-recolor.jorgenkh.no](https://svg-recolor.jorgenkh.no) and requires no installation.
### API
The API is hosted at the same url as the website. You can find the swagger documentation on [svg-recolor.jorgenkh.no/docs](https://svg-recolor.jorgenkh.no/api) or [svg-recolor.jorgenkh.no/redoc](https://svg-recolor.jorgenkh.no/redoc) if you prefer the redoc style.
### CLI Tool
Simply dowload `colorize_svg.py` and run it with python.
Example usage:
```sh
python colorize_svg.py path/to/input.svg path/to/output.svg --color "255,0,0"
```
### Legacy Shell Script
Download `colorize_svg.sh` and run it in your terminal.
Example Usage:
```bash
# Recolor the input SVG file to red and save it to the output file using RGB color values
./colorize_svg.sh "example-input-svgs/input.svg" tmp/output.svg --color "255,0,0"
# Recolor the input SVG file to red and save it to the output file using hex color values
./colorize_svg.sh "example-input-svgs/input.svg" tmp/output.svg --color "#FF0000"
```
## Contributing
See any bugs or missing features? Feel free to open an issue or submit a pull request, I'm open to anything!
Check out [Local Development](#local-development) for more information on how to set up the project locally.
Other ways to contribute:
[](https://ko-fi.com/H2H0GY0OU)
## Local Development
### Requirements
- Python 3.10 or higher
- [Pipenv](https://pipenv.pypa.io/en/latest/)
### Installation
Clone the repository and install the dependencies using pipenv.
```sh
git clone https://github.com/Snailedlt/svg-recolor.git
cd svg-recolor
pipenv install
```
Compile svgshift (a submodule) by running the following command
Replace `` with your environment (e.g. windows, linux).
```sh
gcc submodules/svgshift/svgshift.c -o svgshift-.exe
```
### Running the API
To run the API, use the following command:
```sh
pipenv run dev
```
### Running the CLI Tool
If you wish to run the CLI without downloading the required dependencies to a separate virtual env, you can use the following command:
```sh
# Update the dependencies if you haven't already
pipenv update
pipenv run colorize path/to/input.svg path/to/output.svg --color "255,0,0"
```
