From: Thomas T. <tt...@bi...> - 2000-04-26 22:37:55
|
I built a new dither matrix generation program. For every matrix, you first choose the first 3 pixels to be set by hand. The program then finds the position that is furthest from the other pixels and puts a pixel there, and so on. At a certain time, every pixel that can be set is adjacent to another pixel. Before this happens, the program starts measuring distance to all pixels, applies a weighing function to each, and chooses the position with the largest total of weighed distances. The weighing function must differentiate pixels that are nearby much more than pixels that are far away, as there are many more pixels farther away and these are less important. It seems to work okay so far. As to Frank van Maarsseveen's remark about pseudo random numbers in a matrix: that will work much faster than calls to rand(), but not give better results. The idea about building a matrix is that you can do better than white noise, by making sure that pixels that print at the same time are distributed more evenly than random, but not so evenly as to produce a grid like structure. I do that now by placing the next dot in the largest hole that was left by the other dots - i.e. place the next dot on the place on the page that is lightest. My approach probably makes sense from a perceptional model: at low densities, people perceive individual dots. At high densities the individual dots disappear and something that takes more nearby dots into account is needed: the more nearby the dot the more important it is. The program is still rather slow, as for every level in the matrix (width^2) it tests every position (width^2) for distance to any other position (width^2). It may be better to build a perceived model matrix (width^2) and update it for every pixel that we set (width^2). This is then then checked every iteration (width^2) for the lowest value (width^2). That would be a 2*(width^4) operation - much better than width^6. Mmm.... i'll build that tomorrow. First I'll see what comes out of my 73 pixel wide matrix - if it looks to be of any use. Thomas |