Update 3-Colour-converter.py

This commit is contained in:
Ace 2018-10-06 18:25:21 +02:00 committed by GitHub
parent 04ca8a7227
commit 5ff52832a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ for files in glob.glob("*.jpeg"):
print('converting the images now') print('converting the images now')
"""First, a function. It's required for reducing colours""" """First, a function. It's required for reducing colours"""
fn = lambda x : 255 if x > 179 else (0 if x < 178 else 179) fn = lambda x : 179 if x == 179 else (255 if x > 179 else 0)
""" Conversion is done in two steps: """ Conversion is done in two steps:
1) Converting the file from .png or .jpeg .bmp to a greyscale .bmp 1) Converting the file from .png or .jpeg .bmp to a greyscale .bmp