Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algorithm to make halftone images?

What is a good algorithm to make halftone images (like this)? A quick google search brings up a bunch of papers on the subject, but it's difficult to judge which are good, efficient, etc. Is there a best choice to do this sort of thing?

like image 805
Paul Wicks Avatar asked Aug 11 '09 01:08

Paul Wicks


People also ask

What is the halftone method?

Rather, the term halftone describes two processes. The first translates continuous tonalities of photographic prints or negatives into a series of dots. The second uses different methods of mechanical printing to produce a print that simulates the continuous tonality of reproduced photographs.


1 Answers

  • Filter down to the resolution you want the "dots" separated by.
  • Get the average intensity of the pixel group in that area.
  • Draw the dot such that the surface area of the dot is equal to the percent from white to Black of the average intensity.

Think of the Pixels groups as a hexagonal grid. Use a circle function to decide which pixels go into the group. You can tune the overlap of the circles to adjust the black/saturation of the output. This is really designed for hi-resolution output such as print. If you are doing this to display on screen as a visual effect make sure you use an anti-aliased circle drawing routine to compensate for the low-resolution of the display. (Compared to print, even HD isn't really that high.)

If you are doing this because you like the effect, that's cool. But if you just want to dither down to a black and white image consider using a "Floyd-Steinberg" dither. It provides high quality results and distributes the error across the image. http://en.wikipedia.org/wiki/Floyd-Steinberg_dithering

like image 61
NoMoreZealots Avatar answered Nov 06 '22 13:11

NoMoreZealots