https://github.com/marekyggdrasil/colorswap
https://github.com/marekyggdrasil/colorswap
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marekyggdrasil/colorswap
- Owner: marekyggdrasil
- License: mit
- Created: 2021-12-19T10:27:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-19T10:52:37.000Z (over 3 years ago)
- Last Synced: 2025-01-17T20:44:19.875Z (5 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colorswap
This is a simple image processing script. It extracts palette from an image by iterating over pixels. You can change this palette and based on the changed palette script can update original image. Nothing sophisticated but fun to play and bring some new life in the old games. If you like it please consider leaving a heart [here](https://twitter.com/MarekNarozniak/status/1472225450038476801) and [giving me a follow](https://twitter.com/MarekNarozniak). Senks!
## Setup
Install the dependencies
```sh
pip install -r requirements.txt
```and good to go boi!
## Usage
Pick some picture, here we will use the black mage from the classic Final Fantasy game.
Start by extracting the palette by running
```sh
python extract.py examples/bmage.png examples/bmage_palette.png
```it produces the following `bmage_palette.png` file in `examples` directory.

Now we can change this palette, feel free to change those colors. For example the following one `examples/bmage_palette_disco.png`

and we can run the color swap script that accepts original image, original palette, new palette and new image output file path
```sh
python swap.py examples/bmage.png examples/bmage_palette.png examples/bmage_palette_disco.png examples/bmage_disco.png
```produces a `examples/bmage_disco.png` file
![]()