4 import gfxprim
.core
as core
5 import gfxprim
.loaders
as loaders
6 import gfxprim
.filters
as filters
10 print("usage: dither.py image")
14 img
= loaders
.Load(sys
.argv
[1])
15 # Use Floyd-Steinberg dithering
16 res
= img
.filters
.FloydSteinbergAlloc(core
.C
.PIXEL_G1
)
17 # Save result into grayscale png
18 res
.loaders
.SavePNG("out.png")
20 if __name__
== '__main__':