From: Thomas T. <tt...@bi...> - 2000-05-20 10:07:13
|
Robert L Krawitz wrote: > How's the new matrix coming along. If we're going to use any kind of > ordered dither, we have to solve the autocorrelation problem. > Remember that we have to solve it for variable dot size/color, too. The new matrix was a disaster. That may be because of lack of randomness First, it seems mostly a problem in areas with very low dot density. As soon as something like 10 dots from the matrix are printed the positions of these are essentially random. Still, I broke something in my code that makes very low densities go bad now: maybe I left out an addition that I had there before. > I reinstated the old kdarkness generation: > > I think that that's the wrong approach. I'm trying to remember > exactly why I got rid of it, but it behaved very strangely. Maybe we > need that to be configurable. I decided to take out everything I didn't fully understand, and did a little cleaning up. It reacts properly now to set_black_upper and -_lower and colors look good. It also seems faster. This is what is left: oc = c; om = m; oy = y; k = MIN(c, MIN(m, y)); if (black != NULL) { ok = k; ak = k; ub = d->k_upper; /* Upper bound * lb = d->k_lower; /* Lower bound */ rb = ub - lb; /* Range */ bk = (ok - lb) * d->density / (ub - lb); if ( bk < 0) bk = 0; if ( bk > d->density ) bk = d->density; k = bk; if (bk > 0) { // Divide by 128 should really be by 64 and d->k_clevel etc should be adjusted instead bk = bk / 128; c -= (d->k_clevel * bk); m -= (d->k_mlevel * bk); y -= (d->k_ylevel * bk); if (c < 0) c = 0; if (m < 0) m = 0; if (y < 0) y = 0; } I'm doubting what to do with the matrices. On one hand, a matrix that performs very well when shifted halfway right and halfway down sounds like the way to go. This allows the two darkest colors to mix well. Other stuff can be mixed in in less optimal positions. I guess I first have to find out what broke the use of the first matrix. So far for organized working on my side. Thomas |