Remove debug code

This commit is contained in:
kris 2021-01-04 21:11:18 +00:00
parent 7f47aa33e7
commit 8f2424127f
1 changed files with 1 additions and 12 deletions

View File

@ -382,6 +382,7 @@ def dither_lookahead(
# output_pixel = dither_one_pixel(screen, differ, # output_pixel = dither_one_pixel(screen, differ,
# input_pixel, output_pixel, xx) # input_pixel, output_pixel, xx)
quant_error = input_pixel - output_pixel quant_error = input_pixel - output_pixel
# TODO: try squared error
total_error += differ.distance(input_pixel, output_pixel) total_error += differ.distance(input_pixel, output_pixel)
dither.apply(screen, temp_image, xx, y, quant_error) dither.apply(screen, temp_image, xx, y, quant_error)
# print(bin(i), total_error, inputs, choices) # print(bin(i), total_error, inputs, choices)
@ -415,18 +416,6 @@ def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("input", type=str, help="Input file to process") parser.add_argument("input", type=str, help="Input file to process")
parser.add_argument("output", type=str, help="Output file for ") parser.add_argument("output", type=str, help="Output file for ")
import traceback
import warnings
import sys
def warn_with_traceback(message, category, filename, lineno, file=None,
line=None):
log = file if hasattr(file, 'write') else sys.stderr
traceback.print_stack(file=log)
log.write(
warnings.formatwarning(message, category, filename, lineno, line))
warnings.showwarning = warn_with_traceback
# screen = DHGR140Screen() # screen = DHGR140Screen()
screen = DHGR560Screen() screen = DHGR560Screen()