A method of generating image data, comprising:
- acquiring first image data represented in two or more colors, the first image data comprises a plurality of pixels, wherein said acquiring comprises acquiring for each pixel of the plurality of pixels of the first image data, a tone value for each of the two or more colors;
- and
- based on the first image data, generating second image data comprising a plurality of pixels, wherein each pixel of the plurality of pixels of the second image data has a binarized tone value for each of the two or more colors, wherein
- the generating the second image data includes:
- selecting a first pixel from the plurality of pixels of the first image data;
- performing a first comparison of the tone value of the first pixel with a first threshold
- if the first comparison shows that the tone value of the first pixel is greater than the first threshold, binarizing the tone value of the first pixel by a first binarization process
- if the first comparison shows that the tone value of the first pixel is less or equal than the first threshold, performing a second comparison of the tone value of the first pixel with a second threshold smaller than the first threshold,
- if the second comparison shows that the tone value of the second pixel is smaller than the second threshold, binarizing the tone value of the first pixel by a second binarization process different from the first binarization process, and
- if the second comparison shows that the tone value of the second pixel is equal or greater than the second threshold, binarizing the tone value of the first pixel by a third binarization process different from the first binarization process and the second binarization process, wherein
- the first binarization process includes setting the tone value of the first pixel to a first tone value that is greater than the first threshold,
- the second binarization process includes:
- setting the tone value of the first pixel to a second tone value that is smaller than the second threshold;
- and
- distributing a value equivalent to the tone value of the first pixel to one or more second pixels of the plurality of pixels of the first image data different from the first pixel,
- the third binarization process includes:
- executing an adjustment process of subtracting a predetermined value from a tone value of one or more third pixels of the plurality of pixels of the first image data different from the first pixel and adding the predetermined value to the tone value of the first pixel;
- performing a third comparison of the tone value of the first pixel after the adjustment process with the first threshold;
- if the third comparison shows that the tone value of the first pixel after the adjustment process is more than the first threshold, setting the tone value of the first pixel to the first tone value;
- and
- if the third comparison shows showing that the tone value of the first pixel after the adjustment process is equal to or less than the first threshold, setting the tone value of the first pixel to the second threshold, and
- wherein
- said selecting the first pixel includes selecting the first pixels one by one in order in the horizontal direction from each of the upper line to lower line of the first image data,
- the second binarization process includes selecting the one or more second pixels from pixels other than pixels binarized by setting the first tone value of the second tone value out of the plurality of pixels of the first image data, and
- the third binarization process includes selecting, from among the plurality of pixels of the first image data, the one or more third pixels from pixels other than pixels binarized by setting the first tone value of the second tone value.