# HG changeset patch # User Paul Boddie # Date 1443964651 -7200 # Node ID a53123d8da0a198c8bac914f17f92a094249d485 # Parent 594282e858487be4b686830ca7e2ece1c17f5a72 Use the square of each scaled colour value to diminish the image intensity. diff -r 594282e85848 -r a53123d8da0a optimiser.py --- a/optimiser.py Sun Oct 04 00:32:47 2015 +0200 +++ b/optimiser.py Sun Oct 04 15:17:31 2015 +0200 @@ -29,11 +29,14 @@ def scale(rgb): return tuple(map(lambda x: x / 255.0, rgb)) +def square(srgb): + return tuple(map(lambda x: pow(x, 2), srgb)) + def invert(srgb): return tuple(map(lambda x: 1.0 - x, srgb)) def combination(rgb): - rgb = scale(rgb) + rgb = square(scale(rgb)) rgbi = invert(rgb) pairs = zip(rgbi, rgb) d = []