A generalized analysis of binary halftone representation of images