The pattern method displays the gray chart ———— uses the Bayer table to carry on the two value display to the image value

Source: Internet
Author: User

Pattern Method refers to the gray scale can be used in a certain proportion of black and white points of the region represented, so as to achieve the overall image of gray sense. The position of the black and white point is chosen to be patterned.

When printed, there is a 160*120*8bit grayscale image that needs to be printed on a 128*9.6-inch paper using a laser printer with a resolution of 200dpi*200dpi. Since this piece of paper can be hit (200*12.8) * (200*9.6) =2560*1920 points, each pixel can be a 256-point size pattern to represent grayscale 256. The 16*16 Square can represent 257 shades of gray, so grayscale images can be printed completely.

But there's a problem. Is the problem of patterns, that is, where the black spots hit. For example, when there is only one black spot, we can play in the center or on the edge. So the last used to represent the gray pattern can make the rules, or can not be rules.

Now suppose to use 16*16 two value points to print a grayscale pixel, if you want to store a 256-level grayscale pattern of the standard template, you need 256*16*16 two-value lattice, occupy a larger space. A better way to do this is to: only one 16*16 integer matrix is stored, which becomes the standard pattern, and the matrix element is 0~255. The actual grayscale of the pixel and each value in the array are compared, when the value is greater than or equal to grayscale, the label in the standard pattern is greater than or equal to the gray value corresponding to a black dot.

8*8 's standard pattern M3 is more special, called Bayer Jitter table. But if you use the M3 jitter table, each pixel should be represented by a 8*8 pattern, and a n*n graph will become 8n*8n size. If you want to maintain the size of the original image with the pattern of technology, you only need to take a point in the corresponding pattern, that is, resample. And then use the pattern technology, you can maintain the size of the original. For M3, that is to take a little bit of every 8*8 point in the original artwork. But in fact, this method is not feasible, because actually do not know which point in this 8*8 is more appropriate, and 8*8 interval is too large, the resulting image and original picture must be very different.

The following methods can be used to resolve the problem:

if ((p[y][x]>>2) > Bayer[y%8][x%8])

Then show white dots

else Display black dots

P[y][x] represents the point grayscale. In the display of the first gray-level two-bit, into 64, and then the x,y to do modulo 8 operations, find the corresponding points in the Bayer table, the comparison between the two to determine whether the current pixel output is black or white. As you can see, the modulo 8 operation makes the original image broken into multiple 8*8 pieces, each of which corresponds to the Bayer table of the 8*8. Each point in the small block is involved in the comparison, which avoids the problem of dividing too large and selecting the points mentioned above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.