abouttreesummaryrefslogcommitdiff
path: root/readme.md
blob: ff5cf5aeb4895ef34ac489b47ba494c015c91bdd (preview) (code) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Separator

Command line tool to separate an image into background and foreground

## Usage

./main <filename> <new_filename> <fg_color> <bg_color> <new_color>

This will replace <fg_color> with <new_color> and make <bg_color> transparent.
It only handles two colors but correctly interpolates between the two and adds transparency accordingly.
Colors are entered as six hex digits without any annotations.

## Example
```bash
./main img.png img_separated.png 000000 ffffff ff0000
```

This works with an image with a black foreground on a white background.
The resulting image is red with a transparent background.

Separator

Command line tool to separate an image into background and foreground

Usage

./main <new_filename> <fg_color> <bg_color> <new_color>

This will replace <fg_color> with <new_color> and make <bg_color> transparent. It only handles two colors but correctly interpolates between the two and adds transparency accordingly. Colors are entered as six hex digits without any annotations.

Example

./main img.png img_separated.png 000000 ffffff ff0000

This works with an image with a black foreground on a white background. The resulting image is red with a transparent background.