This script processes a set of images and replaces a specified background colour with a new colour.
The script will ask you for the following input:
- Input folder containing images
- Output folder for processed images
- Background colour to replace in RGB format (e.g., 0 0 0)
- Threshold distance for colour similarity (default: 50)
- New color to replace the background colour in RGB format (e.g., 255 255 255)
- File extension to process (default: png)
I made this because I was extracting diagrams from a scan of a book to use elsewhere and the background colour was unsuitable.
If you want to run it you need to install python then you can run python script.py and it will ask you for the inputs.