[comp.graphics] 8x8 dither matrices

daveb@cbmvax.UUCP (Dave Berezowski) (04/21/89)

	I have a dither matrices for...

	a) 4x4 ordered dither
	b) 4x4 halftone dither
	c) 4x4 halftone dither (slanted 45 degrees)

	I am looking for either an 8x8 version of the above OR a formula
	to calculate any of the above.  Actually, I would also be interested
	in 2x2, 3x3, 5x5, 6x6, 7x7, etc. dither matrices too.

	Any help would be appreciated!

	Regard, David Berezowski

bayes@hpfcdc.HP.COM (Scott Bayes) (04/28/89)

A common way of enlarging a 4x4 matrix to 8x8 is:

multiply the matrix by the scalar 4.

tile the 8x8 matrix with 4 copies of the scaled-up 4x4 matrix

add the constant 1-matrix  	1 1 1 1
				1 1 1 1
				1 1 1 1
				1 1 1 1

to the upper right-hand tile. Add the constant 2-matrix to the lower left tile,
and add the constant 3-matrix to the lower right tile (actually you also add
the constant 0-matrix to the upper left tile). This produces an 8x8 matrix
that is fractally similar to the 4x4 starter, and shares many of its noise
distribution properties.

It can be applied to any 2^n by 2^n. For example n=0:

matrix = 0

Deriving the next up (n=1):

matrix =0 1
        2 3

etc.

Scott Bayes
dithering as usual

daveb@cbmvax.UUCP (Dave Berezowski) (05/01/89)

In article <5040008@hpfcdc.HP.COM> bayes@hpfcdc.HP.COM (Scott Bayes) writes:
>A common way of enlarging a 4x4 matrix to 8x8 is:
>
>multiply the matrix by the scalar 4.
>
>tile the 8x8 matrix with 4 copies of the scaled-up 4x4 matrix
>
>add the constant 1-matrix  	1 1 1 1
>				1 1 1 1
>				1 1 1 1
>				1 1 1 1
>
>to the upper right-hand tile. Add the constant 2-matrix to the lower left tile,
>and add the constant 3-matrix to the lower right tile (actually you also add
>the constant 0-matrix to the upper left tile). This produces an 8x8 matrix
>that is fractally similar to the 4x4 starter, and shares many of its noise
>distribution properties.
>
>It can be applied to any 2^n by 2^n. For example n=0:
>
>matrix = 0
>
>Deriving the next up (n=1):
>
>matrix =0 1
>        2 3
>
>etc.
>
>Scott Bayes
>dithering as usual

	An interesting trick which works fine on Ordered dither matrices,
but does not work for Halftone dither matrices.  I now know how to generate
ordered dither matrices of size power's of 2(ie. 2, 4, 8, etc.) BUT am
still looking for references on Halftone dither matrices above a 4x4.

jef@ace.ee.lbl.gov (Jef Poskanzer) (05/01/89)

In the referenced message, daveb@cbmvax.UUCP (Dave Berezowski) wrote:
}                                                 I now know how to generate
}ordered dither matrices of size power's of 2(ie. 2, 4, 8, etc.) BUT am
}still looking for references on Halftone dither matrices above a 4x4.

I'm not completely sure what you mean by "Halftone".  Halftoning is
the generic term for any sort of N-bit to 1-bit quantization.  (Terminology
is great, isn't it?)  Anyway, assuming you are talking about clustered
dithering of the sort used in newspaper photographs, here is an order-8
45-degree clustered dither matrix:

    static int cluster8[8][16] = {
	 65, 70, 78, 88, 87, 77, 69, 68, 64, 59, 51, 41, 42, 52, 60, 61,
	 71, 95,101,110,109,100, 94, 76, 58, 34, 28, 19, 20, 29, 35, 53,
	 79,102,115,117,116,113, 99, 84, 50, 27, 14, 12, 13, 16, 30, 45,
	 89,111,124,125,126,119,108, 86, 40, 18,  5,  4,  3, 10, 21, 43,
	 90,112,123,128,127,118,107, 85, 39, 17,  6,  1,  2, 11, 22, 44,
	 80,103,120,122,121,114, 98, 83, 49, 26,  9,  7,  8, 15, 31, 46,
	 72, 96,104,105,106, 97, 93, 75, 57, 33, 25, 24, 23, 32, 36, 54,
	 66, 73, 81, 91, 92, 82, 74, 67, 63, 56, 48, 38, 37, 47, 55, 62 };

The only reference you need for this stuff is "Digital Halftoning" by
Robert Ulichney, MIT Press, ISBN 0-262-21009-6.
---
Jef

            Jef Poskanzer   jef@helios.ee.lbl.gov   ...well!pokey
 "Wild geese have no intent to cast reflections; water has no mind to receive
                                their image."

daveb@cbmvax.UUCP (Dave Berezowski) (05/02/89)

In article <2518@helios.ee.lbl.gov> Jef Poskanzer <jef@helios.ee.lbl.gov> writes:
>In the referenced message, daveb@cbmvax.UUCP (Dave Berezowski) wrote:
>}                                                 I now know how to generate
>}ordered dither matrices of size power's of 2(ie. 2, 4, 8, etc.) BUT am
>}still looking for references on Halftone dither matrices above a 4x4.
>
>I'm not completely sure what you mean by "Halftone".  Halftoning is
>the generic term for any sort of N-bit to 1-bit quantization.  (Terminology
>is great, isn't it?)  Anyway, assuming you are talking about clustered
>dithering of the sort used in newspaper photographs, here is an order-8
>45-degree clustered dither matrix:
>
>    static int cluster8[8][16] = {
>	 65, 70, 78, 88, 87, 77, 69, 68, 64, 59, 51, 41, 42, 52, 60, 61,
>	 71, 95,101,110,109,100, 94, 76, 58, 34, 28, 19, 20, 29, 35, 53,
>	 79,102,115,117,116,113, 99, 84, 50, 27, 14, 12, 13, 16, 30, 45,
>	 89,111,124,125,126,119,108, 86, 40, 18,  5,  4,  3, 10, 21, 43,
>	 90,112,123,128,127,118,107, 85, 39, 17,  6,  1,  2, 11, 22, 44,
>	 80,103,120,122,121,114, 98, 83, 49, 26,  9,  7,  8, 15, 31, 46,
>	 72, 96,104,105,106, 97, 93, 75, 57, 33, 25, 24, 23, 32, 36, 54,
>	 66, 73, 81, 91, 92, 82, 74, 67, 63, 56, 48, 38, 37, 47, 55, 62 };
>
>The only reference you need for this stuff is "Digital Halftoning" by
>Robert Ulichney, MIT Press, ISBN 0-262-21009-6.
>---

	Thanks for the matrix but I noticed two things:

a) its an 8x16 not an 8x8 matrix

b) the enlarging dot (which is what you get in a halftone dither) should start
   at the center of the matrix and build out uniformly.  Your matrix is simply
   a 4x4 halftone dither matrix that has been replicated/adjusted to the
   other 3 quadrants.  This technique works with an ordered dither matrix but
   not with a halftone one.

	Regards, David B

daveb@cbmvax.UUCP (Dave Berezowski) (05/02/89)

In article <2518@helios.ee.lbl.gov> Jef Poskanzer <jef@helios.ee.lbl.gov> writes:
>In the referenced message, daveb@cbmvax.UUCP (Dave Berezowski) wrote:
>}                                                 I now know how to generate
>}ordered dither matrices of size power's of 2(ie. 2, 4, 8, etc.) BUT am
>}still looking for references on Halftone dither matrices above a 4x4.
>
>I'm not completely sure what you mean by "Halftone".  Halftoning is
>the generic term for any sort of N-bit to 1-bit quantization.  (Terminology
>is great, isn't it?)  Anyway, assuming you are talking about clustered
>dithering of the sort used in newspaper photographs, here is an order-8
>45-degree clustered dither matrix:
>
>    static int cluster8[8][16] = {
>	 65, 70, 78, 88, 87, 77, 69, 68, 64, 59, 51, 41, 42, 52, 60, 61,
>	 71, 95,101,110,109,100, 94, 76, 58, 34, 28, 19, 20, 29, 35, 53,
>	 79,102,115,117,116,113, 99, 84, 50, 27, 14, 12, 13, 16, 30, 45,
>	 89,111,124,125,126,119,108, 86, 40, 18,  5,  4,  3, 10, 21, 43,
>	 90,112,123,128,127,118,107, 85, 39, 17,  6,  1,  2, 11, 22, 44,
>	 80,103,120,122,121,114, 98, 83, 49, 26,  9,  7,  8, 15, 31, 46,
>	 72, 96,104,105,106, 97, 93, 75, 57, 33, 25, 24, 23, 32, 36, 54,
>	 66, 73, 81, 91, 92, 82, 74, 67, 63, 56, 48, 38, 37, 47, 55, 62 };
>
>The only reference you need for this stuff is "Digital Halftoning" by
>Robert Ulichney, MIT Press, ISBN 0-262-21009-6.
>---
	I just noticed that the right half of your 8x16 matrix really is
a 8x8 halftone matrix.  Thankx.

	I forgot to ask for a 16x16 matrix as well, don't suppose you
have one do you?

	Does anyone know if I can contact the MIT Press directly to order
the book?

	Thankx again!

	Regards, David B

jef@ace.ee.lbl.gov (Jef Poskanzer) (05/02/89)

In the referenced message, daveb@cbmvax.UUCP (Dave Berezowski) wrote:
}	I just noticed that the right half of your 8x16 matrix really is
}a 8x8 halftone matrix.  Thankx.

Look, I said it was a 45-degree matrix, but I guess you chose to ignore
that.  Fine, use the numbers any way you want to.

}	I forgot to ask for a 16x16 matrix as well, don't suppose you
}have one do you?

The one I posted was a 16x16, order 8 matrix.  You get the other half
by replicating the half I posted, shifted by 8.

Are you getting the idea yet that you quite literally don't know what
you are talking about?  Perhaps you should stop posting 50-line followups
with 10 lines of new text, until you have at least sniffed a copy of
Ulichney's book?

}	Does anyone know if I can contact the MIT Press directly to order
}the book?

Your local bookstore is probably real good at ordering books.
---
Jef

            Jef Poskanzer   jef@helios.ee.lbl.gov   ...well!pokey
           Most people on this network wouldn't recognize subtlety
                         if it hit them on the head.

frank@mnetor.UUCP (Frank Kolnick) (05/02/89)

(much stuff about half-toning removed, in particular about Ulichney's
book on the subject)

>}	Does anyone know if I can contact the MIT Press directly to order
>}the book?

I just (last week) ordered this book from MIT Press. This is a good time to
do it, since it's reduced in price until June (I think). Unfortunately,
I also just threw out their latest catalogue which has their 800 number.
You could get the direct number from information (I have to do this anyway,
since the 800 number doesn't work across the border).

-- 
Frank Kolnick,
consulting for, and therefore expressing opinions independent of, Computer X
UUCP: {allegra, linus}!utzoo!mnetor!frank

daveb@cbmvax.UUCP (Dave Berezowski) (05/02/89)

In article <2527@helios.ee.lbl.gov> Jef Poskanzer <jef@helios.ee.lbl.gov> writes:
>In the referenced message, daveb@cbmvax.UUCP (Dave Berezowski) wrote:
>}	Does anyone know if I can contact the MIT Press directly to order
>}the book?
>
>Your local bookstore is probably real good at ordering books.
>---
	Look Jef, there really is no need in getting snotty about it!!!!!!!
It turns out that we don't have a lot of bookstores around here that
specialize in computer books, especially those from MIT press.

	I still am thankful for the original info you provided, I'll
ignore your second posting and assume that you were having a bad day! :^(

	David Berezowski

daveb@cbmvax.UUCP (Dave Berezowski) (05/03/89)

In article <4987@mnetor.UUCP> frank@mnetor.UUCP (Frank Kolnick) writes:
>(much stuff about half-toning removed, in particular about Ulichney's
>book on the subject)
>
>I just (last week) ordered this book from MIT Press. This is a good time to
>do it, since it's reduced in price until June (I think). Unfortunately,
>I also just threw out their latest catalogue which has their 800 number.
>You could get the direct number from information (I have to do this anyway,
>since the 800 number doesn't work across the border).
>
	No problem, I got the number from the phone company.  The direct
# to place orders is (617) 253-2884.  Thankx again!

	Regards, David Berezowski

landru@Solbourne.COM (Mike Rosenlof) (05/03/89)

>>Your local bookstore is probably real good at ordering books.
>	Look Jef, there really is no need in getting snotty about it!!!!!!!
>It turns out that we don't have a lot of bookstores around here that
>specialize in computer books, especially those from MIT press.
>

Actually just about any bookstore, even the (IMHO) bad stores like Walden
Books have _Books_In_Print_ and can order books from any publisher.
i
n
e
w
s
fodder

-- 
Mike Rosenlof               Solbourne         (303)678-4304
1900 Pike Road            Computer, Inc.      landru@solbourne.com
Longmont Colorado                             ...hao!boulder!stan!landru
80501