https://github.com/lostsh/pixedit
Simple picture editor : remove background
https://github.com/lostsh/pixedit
background-removal background-remover cli command-line-tool picture-editing picture-editor pillow png python3
Last synced: 26 days ago
JSON representation
Simple picture editor : remove background
- Host: GitHub
- URL: https://github.com/lostsh/pixedit
- Owner: lostsh
- Created: 2024-03-12T11:09:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-13T20:22:11.000Z (over 1 year ago)
- Last Synced: 2025-09-02T09:02:46.487Z (about 1 month ago)
- Topics: background-removal, background-remover, cli, command-line-tool, picture-editing, picture-editor, pillow, png, python3
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pixedit
> Remove some pixel to make transparent background using PILRequirements:
- `Pillow` version 1.1.7## Usage
Installing environment :
```bash
python3 -m venv .env # Creating virtual environement
source .env/bin/activate # Activating the environment
python -m pip install pillow # Installing the library
```Running program :
```bash
# To remove all pixels matching the given rgb values :
python main.py -f input.jpg -o output.png -rv 255 -gv 255 -bv 255# To keep all pixels matching the given rgb values :
python main.py -f input.jpg -o output.png -rv 255 -gv 255 -bv 255 --keep-pixel
```## Examples :
| | Removing pixels | Keeping only selected pixels |
|--------------|:---------------:|:----------------------------:|
| Description |Removing white background *(all pixels with value 255, 255, 255)*|Keeping only white pixels|
| Command line |`python main.py -f undraw.png -o out.png -rv 255 -gv 255 -bv 255`|`python main.py -f undraw.png -o white.png -rv 255 -gv 255 -bv 255 --keep-pixel`|
| Input image ||
|
| Ouput image ||
|
```bash
usage: Pixedit [-h] -f FILE -o OUT [--keep-pixel] [-rv R_VALUE] [-gv G_VALUE] [-bv B_VALUE] [-d]Pixel Editor
options:
-h, --help show this help message and exit
-f FILE, --file FILE Input image path
-o OUT, --out OUT Output image path
--keep-pixel Keep only pixel matching given rgb. By default, it remove all matching rgb pixels
-rv R_VALUE, --red-value R_VALUE
(r,g,b) Red value to remove 0 - 255
-gv G_VALUE, --green-value G_VALUE
(r,g,b) Blue value to remove 0 - 255
-bv B_VALUE, --blue-value B_VALUE
(r,g,b) Green value to remove 0 - 255
-d, --debug Enable debug ouput, disabled by default
```| | Removing pixels | Keeping only selected pixels |
|--------------|:---------------:|:----------------------------:|
| Description |Removing only dark cat pixels|Keeping only dark cat pixels|
| Command line |`python main.py --file undraw_cat.png --out out.png -rv 63 -gv 61 -bv 86`|` python main.py --file undraw_cat.png --out out.png -rv 63 -gv 61 -bv 86 --keep-pixel`|
| Input image ||
|
| Ouput image ||
|