Skip to content

Instantly share code, notes, and snippets.



Created Nov 1, 2017
What would you like to do?
Viacoin second image decription
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Copyright 2017 by Narcelio Filho <>
from PIL import Image
from PIL import ImageOps
import numpy
im ='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'))'/tmp/m.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment