tfuxu / Halftone

Give your images that pixel art-like style
GNU General Public License v3.0
102 stars 16 forks source link

Bayer dither doesn't respect color amount #21

Closed daudix closed 1 year ago

daudix commented 1 year ago

Noticed that ordered dither uses same color amount no matter how high you set it, comparing with Pixfect (ditherer.sh) it looks quite different (same 128 px | 10 colors)

halftone-bay-bridge

bay-bridge-ditherer

tfuxu commented 1 year ago

That's because your script is setting levels per color channel, instead of reducing the amount of colors. In ditherer.sh#L103 instead of a comma there should be -colors option.

daudix commented 1 year ago

aha, so bug is actually in my script, haha :D

Edit: it seems that ordered dithering can use more colors, as in https://en.wikipedia.org/wiki/Ordered_dithering#/media/File:Lenna_ordered_dither.png and https://kamoroso94.github.io/ordered-dither