halftone factory class implemented