Created
November 1, 2017 18:23
-
-
Save narcelio/f723d405590d7b065ac5b5834721ab48 to your computer and use it in GitHub Desktop.
Viacoin second image decription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# (c) Copyright 2017 by Narcelio Filho <[email protected]> | |
from PIL import Image | |
from PIL import ImageOps | |
import numpy | |
im = Image.open('tpSCvHx.png') | |
bw = im.convert('L', dither=Image.NONE) | |
g = numpy.asarray(bw) | |
g = g < 80 | |
m = Image.fromarray(g, '1') | |
m = ImageOps.invert(m.convert('L')) | |
m.show() | |
#m.save('/tmp/m.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment