Looks cool. Also, I remember you posting some gif of a cube rotating on what could be a Game Boy or TI screen with dithered shading. If you don't mind me asking, what reading materials can I study to do these kinds of downsampling?
Good question. Well, the net is full of dithering yet the information
presented on the net won't likely lead to any deeper understanding of it. And
many articles are just copies of one another. However, it may already suffice
for the task at hand, but going any further may require a deeper understanding
of the entire process. To tell the truth, halftoning/dithering is quite a
sophisticated topic at its core if you go beyond applying just some patterns.
So it depends. It depends on where do you want to go with all of this.
When dithering was a contemporary technique in the '80 there was basically no
internet to document it properly with respect to computer graphics and video
games. Game developers from the '80 have built special patterns to even adapt
to the antics of a CRT. But it's all lost. The are some scientific/technical
papers and books like the book of Robert Ulichney on Digital Halftoning which
is supposed to be the standard -- doing frequency analysis on many different
patterns etc. However, this technical stuff is mainly written with respect to
the printing process and not for computer graphics resp. video games/effects.
And often the process is just explained for black-and-white images. However,
this book is sort of a start to get to know about the issues/performance of
some halftoning techniques, but it won't talk that much about the basic
principles behind. Basically, the book tells how certain patterns are good, or
not, by applying some Fourier analysis onto them. Reading this book will give
you, for example, an explanation for the optimality (in a given sense) of the
Bayer patterns.
Well, after tinkering around with the topic and looking in many different
direction, I came to the conclusion that there is no cohesive treatment of the
topic for computer graphics (even not in Foley, van Damm, et al; "Computer
Graphics: Principles and Practice", which has just a small section about it)
or for video games/effects telling the core principles behind. But I've found
them out on my own. I've spent the time to studied the whole thing from
scratch. The knowledge gained will be a part of my Retro Engine. Basically, I
derived most of the old techniques from the '80 anew and have build new stuff
not shown yet. I could write an entire book about it, but I'm in a similar
situation like the devs from the '80; *all-in*. xD
As you see, it depends. If you just want to make some simple dithering, then
the information on the net is quite sufficient. But if you want to combine
different techniques knowing their strengths and weaknesses, you better dig
deeper. I will give you a hint for the latter; There are at least two
important ingredients for a proper understanding of digital halftoning. The
first lies in a proper understanding of the quantization process (independent
of any dithering technique whatsoever), i.e. in making a continuous quantity
discrete. I have given an easy explanation (about 8-16 pages back, I guess) on
how to model this process in one's mind by using a bucket analogy. The second
important ingredients for -digital- halftoning, which can be regarded as a
principle, is is the relationship between space and depths, or between
resolution in space and resolution in magnitude, or between resolution in
frequency and resolution in amplitude. The whole halftoning/dithering process
is a tradeoff between these two things with quite a lot of spice added to the
mix, i.e. of how to best spread the error, of funky rotated patterns/grids, of
hexagonal tiling, of tone-map correction, of human vision etc.
Lets give an example. Larger dither patterns, like for example Bayer's 16x16
for simulating 256 shades, are able to simulate more shades than a 4x4 one,
yet they trade-in resolution for simulating all these shades! You may say that
the image resolution will remain the same while applying a dither pattern
pixel-by-pixel, which it does using the standard ordered-dithering method of
applying a dither matrix for each pixel replacing it depending on the value
within the matrix used for making a comparison, but the effective resolution
(lines per inch) will drop nevertheless. You can make a test by taking an
image and dither it with a Bayer matrix of 4x4, 8x8, and 16x16 watching the
results. You will see that the resolution is worst on the 16x16 dithered
image, yet the simulated shades are best for this image! It is this principle
which will lead to many different (combined) halftoning techniques. So an
understanding of it is of utmost importance. And we haven't spoken about color
yet. Color dithering on palette driven devices (or simulations thereof)
requires an understanding of color quantization, yet it underlies the same
principles as all other quantization processes with a similar "spice-function"
as given earlier making it a subject of its own, i.e. there are good and not
so good color quantization techniques depending on how the quantization error
is treated and how the model best applies to human vision. The human vision
factor is quite important since you can save valuable bits in one direction
(color space) and use them to increase resolution in another direction. This
way you can gain a better dithered color images with the same amount of total
bits while viewed by a human. I think this technique was never applied in any
gif/png tool.
There are many more cool things to talk about, but this must suffice for now.
Time is up. I hope it helps! Dither for Life! :+