Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiddae/imagecolorizer
Make any wallpaper fit any terminal colorscheme.
https://github.com/kiddae/imagecolorizer
colorscheme image-processing palette python unixporn wallpaper-generator
Last synced: about 2 months ago
JSON representation
Make any wallpaper fit any terminal colorscheme.
- Host: GitHub
- URL: https://github.com/kiddae/imagecolorizer
- Owner: kiddae
- License: mit
- Created: 2021-02-15T16:54:03.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-30T19:06:07.000Z (about 3 years ago)
- Last Synced: 2023-03-05T07:42:01.398Z (almost 2 years ago)
- Topics: colorscheme, image-processing, palette, python, unixporn, wallpaper-generator
- Language: Python
- Homepage:
- Size: 33.9 MB
- Stars: 86
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ![Image](Demo/demo1.jpg)
**`ImageColorizer` is a Python module and a CLI tool** that you can easily use to colorize wallpapers for them to fit a terminal colorscheme.
It currently supports importing colorschemes from the currently set `Xresources` variables, `pywal` and `colorer` (my [colorscheme management engine](https://github.com/ngynLk/colorer)).
## 📓 How it works
The module uses two different algorithms:
+ pixel by pixel (default): goes through each pixel and replaces it with the right color from the colorscheme
+ average box: calculates the average color of each pixel before processing. This one gives smoother and better results in some cases.Average | Pixel by pixel
:-------------------------------:|:-----------------------------:
![Average](Demo/montage_avg.png) | ![Original](Demo/montage.png)### Usage
```
usage: ImageColorizer [-h] [-x] [-c COLORSCHEME] [-w] [-p COLOR [COLOR ...]] [-s]
[-b] [--average BOX_SIZE] [--no_quantize]
input outputpositional arguments:
input File to generate image from.
output File to generate image to.optional arguments:
-h, --help show this help message and exit
-x, --xresources Get palette from Xresources.
-c COLORSCHEME, --colorer COLORSCHEME
Get palette from colorer.
-w, --pywal
Gets palette from pywal.
-p COLOR [COLOR ...], --palette COLOR [COLOR ...]
Manually set colors.
-s, --show Show image using xdg-open when image is generated.
-b, --blur Blur the image
--average BOX_SIZE Use average algorithm (calculate the average color of
each pixel with the pixels around) to generate the
wallpaper, and set the size of the box to calculate
the color from
--no_quantize Do not quantize the image before processing (may make
the image look better)```
### Examples
```shell
ImageColorizer a.jpg output.jpg -x # Generate the wallpaper from colors of the currently used ~/.Xresources or ~/.Xdefaults file
ImageColorizer a.jpg output.jpg -c ~/Configuration/colorschemes/nord # Generate the wallpaper using colorscheme nord from colorer
ImageColorizer a.jpg output.jpg -c ~/Configuration/colorschemes/nord --average 2 # Use average algorithm with box size of 2
ImageColorizer a.jpg output.jpg -c ~/Configuration/colorschemes/nord --average 2 -s # Show image at the end
ImageColorizer a.jpg output.jpg -p "#3b4252" "#bf616a" "#a3be8c" -s # Use these colors.
```## 💻 Installation
Clone the repo and run `./install.sh` (or `pip3 install .`)
## ✔️ Todo
- [ ] Multi-threading
- [ ] More colorscheme importing options## ❎ Troubleshoot
Any common fixes to any errors will be added here.
## 👍 Credits
Heavily inspired by [ImageGoNord](https://github.com/Schrodinger-Hat/ImageGoNord-pip).