Python code for converting any image to a Painting By Numbers version of itself.
python pbnify.py --help
usage: pbnify.py [-h] -i INPUT_IMAGE -o OUTPUT_IMAGE [-k NUM_OF_CLUSTERS]
[--outline]
optional arguments:
-h, --help show this help message and exit
-i INPUT_IMAGE, --input-image INPUT_IMAGE
Path of input image.
-o OUTPUT_IMAGE, --output-image OUTPUT_IMAGE
Path of output image.
-k NUM_OF_CLUSTERS, --num-of-clusters NUM_OF_CLUSTERS
Number of kmeans clusters for dominant color
calculation. Defaults to 15.
--outline Save outline image containing edges.
python pbnify.py -i images/picasso.jpg -o images/picasso_PBN.jpg --outline -k 15