PaletteOptimiser

Changeset

54:28240372e1d8
2015-10-07 Paul Boddie raw files shortlog changelog graph Reduced the propagated error by half.
optimiser.py (file)
     1.1 --- a/optimiser.py	Wed Oct 07 01:21:07 2015 +0200
     1.2 +++ b/optimiser.py	Wed Oct 07 01:38:25 2015 +0200
     1.3 @@ -252,7 +252,7 @@
     1.4  
     1.5                      # Spread the error across adjacent pixels.
     1.6  
     1.7 -                    error = tuple(map(lambda i: (i[0] - i[1]) / 2.0, zip(rgb, value)))
     1.8 +                    error = tuple(map(lambda i: (i[0] - i[1]) / 4.0, zip(rgb, value)))
     1.9                      for xn in range(x, min(x + 2, width)):
    1.10                          rgbn = im.getpixel((xn, y+1))
    1.11                          rgbn = tuple(map(lambda i: clip(i[0] + i[1]), zip(rgbn, error)))