A simple program to remove the watermark from a PDF/JPG/PNG file.
- convert the PDF file into images using
pymupdf
- convert the images(include .jpg/.png) to numpy array
- find the specific pixel by watermarks' rgb values and change them into (255,255,255)
- save the modified images
First you need to install the dependencies:
$ pip install pillow pymupdf scikit-image numba
For .pdf execute:
$ python watermark.py --source source.pdf --target out
For .jpg/.png execute:
$ python watermark.py --source source.png --target out
Don't forget to indicate the source path you want to convert, script will automatically creates an output path.