Awesome-Python-Scripts/signature2png
2019-10-03 03:08:43 -05:00
..
imgs Added signatue photo to (transparent) png converter script. 2019-10-03 03:08:43 -05:00
README.md Added signatue photo to (transparent) png converter script. 2019-10-03 03:08:43 -05:00
signature.py Added signatue photo to (transparent) png converter script. 2019-10-03 03:08:43 -05:00

Python signature editor

The present repo contains a Python script to process signature images, it returns a png image with transparent background containing only the signature.

Setup

The Python PIL (Python Image Library) package with Python 3 is used in this repo.

To install PIL via pip:

pip install pillow

Contents

The main script is signature.py, which contains a set of utility functions developed so far.

Done so far

  • Binarize your signature
  • Remove background and make it transparent

TODO

  • Smooth image
  • Image orientation
  • Crop to get only signature

Usage

The main script, signature.py requires a set of parameters that are needed in the parser.

$ python signature.py -h
usage: signature.py [-h] -i INPUT [-o OUTPUT] [-th THRESHOLD]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input image.
  -o OUTPUT, --output OUTPUT
                        Output image.
  -th THRESHOLD, --threshold THRESHOLD

An example to use this script is as follows:

$ python signature.py -i imgs/example.jpg -o imgs/result.png -th 190

Results


Reference to:

https://github.com/RodolfoFerro/Signature