How do I represent grid patterns with a dither matrix?

Click For Summary
SUMMARY

This discussion focuses on representing grid patterns using a dither matrix, specifically utilizing a 2x2 dither matrix as outlined in the problem statement. The key equations involve calculating pixel intensity and error using the formulas I(x,y), trunc(I(x,y)), and D_n(i,j). The user expresses confusion regarding the concepts of truncation and pixel intensity, seeking clarity on how to implement these in the context of ordered dithering. The solution involves determining pixel values based on the error compared to the dither matrix values.

PREREQUISITES
  • Understanding of dither matrices and their application in image processing
  • Familiarity with pixel intensity calculations and error diffusion techniques
  • Knowledge of modular arithmetic as it applies to grid patterns
  • Basic concepts of truncation, floor, and ceiling functions in programming
NEXT STEPS
  • Study the implementation of ordered dithering techniques in image processing
  • Learn about the role of error diffusion in enhancing image quality
  • Explore the mathematical foundations of modular arithmetic in grid-based algorithms
  • Investigate the differences between truncation, floor, and ceil functions in programming languages
USEFUL FOR

Students in computer graphics, software developers working with image processing, and anyone interested in understanding dithering techniques for digital images.

s3a
Messages
828
Reaction score
8

Homework Statement


PROBLEM STATEMENT:
"Represent the grid patterns in the figure with a dither matrix."
(Figure: https://www.docdroid.net/OMLUX5v/figure.pdf )

ANSWER (FROM MY BOOK):
http://www.wolframalpha.com/input/?i={{0,2},{3,1}}

Homework Equations


Matrix_element_where_dot_should_be_printed_or_something_like_that = D_n(i,j)

i = x mod n

j = y mod n

The Attempt at a Solution


The closest I seem to get to understand how to do the problem from my book is with page 12 (of 15) from a document I found online ( https://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/dither/dither.pdf ), but I don't understand what trunc(x,y) and P(x,y) are, and I suspect I(x,y) means the intensity at a point (x,y), but what that means, more specifically, is beyond my current understanding.

I'm VERY confused, so any input that could help me fully understand how to do the problem from my book would be GREATLY appreciated!

P.S.
If you want more information from me for anything, just let me know.
 
Physics news on Phys.org
Looking at the code for ordered dither on page 12:
The range of the pixel values and what exactly trunc, floor and ceil do isn't too clear.

i = x mod n
j = y mod n

the image is divided in nxn squares. Each of these squares is combined with the nxn dither matrix.
i and j become the column and row number of the pixel in the small square that it belongs to.
e = I(x,y) - trunc(I(x,y))
I(x,y) is the intensity of the pixel at x,y. It seems to be a real number in the range from 0 to 4 if you want to use the 2x2 dither matrix displayed here.
I think trunc(I(x,y)) should be the same as floor(I(x,y)) and this would mean to round down the intensity to a value that can be displayed without dithering.
for the 1-bit dither that only uses black and white displayed in the images trunc() should always give 0.
e, the error is the difference between the intensity you want and the truncated intensity.
if e > D(i,j) then P(x,y) = ceil(x,y) else P(x,y) = floor(x,y)
if the error is bigger than the value you look up in the dither matrix, then use the intensity rounded up. If it's not, use the intensity rounded down.
for an 1-bit dither ceil(x,y) would produce black, and floor(x,y) would produce white.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
8K
  • · Replies 23 ·
Replies
23
Views
9K
  • · Replies 7 ·
Replies
7
Views
8K
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K