From: Thomas T. <tt...@bi...> - 2000-05-19 18:52:54
|
I tried Roberts latest CVS updates and these were what I Was trying to achieve, but didn't succeed in. I got addicted to the use more more black though, so I adjusted things around a little. Things look fine for photos: better than they ever did, if using the large dither matrix. There are problems though with overflows. Floyd-Steinberg can look like the cartridge has been dripping milk in dark areas and a white-to-black wedge shows definite artefacts when black gets dense: black suddenly gets switched out to reappear later with ordered dither. Floyd is worse: a white line appears in the dark portion of the bar, and the line gets wider down the print. Probably an overflow effect as well. All this tested with 0.1 for dither_set_black_lower and .699 for dither_set_black_upper in print-escp2.c. dither_set_black_lower at .999 also causes the wedge problem, but closer to the dark side. Further remark: the old ordered dither now seems useless because of its autocorrelation. Depending on density in the grey wedge, C, M or Y hads the greates tendency to disappear under K, leading to a rainbow-effect grey wedge. The 199 size matrix does fine though, but could even more black than with the settings used above. But prints look so crisp now! Now for the changes as relevant to black generation. The full patched version will be in CVS under print/Matgen in a moment: I reinstated the old kdarkness generation: *** 1545,1556 **** * In between we scale. We actually choose, for each point, * whether we're going to print black or color. */ ! #if 0 tk = (((oc * d->c_darkness) + (om * d->m_darkness) + (oy * d->y_darkness)) >> 6); ! #else ! tk = k; ! #endif kdarkness = tk; if (kdarkness < d->k_upper) /* Possibility of printing color */ { --- 1556,1565 ---- * In between we scale. We actually choose, for each point, * whether we're going to print black or color. */ ! tk = (((oc * d->c_darkness) + (om * d->m_darkness) + (oy * d->y_darkness)) >> 6); ! kdarkness = tk; if (kdarkness < d->k_upper) /* Possibility of printing color */ { *************** Instead of (ok - lb) squared I use this as direct black value, so we start producing appreciable amounts of black early on. *** 1574,1588 **** if ((d->dither_type & ~D_ADAPTIVE_BASE) == D_FLOYD) ditherbit = ((xrand() & 0xffff000) >> 12); else ! ditherbit = (DITHERPOINT(d, row, x, 1) ^ ! (DITHERPOINT(d, row, x, 3) >> 2)); ditherbit = ditherbit * rb / 65536; if (rb == 0 || (ditherbit < (kdarkness - lb))) bk = ok; else bk = 0; #else ! bk = (ok - lb) * (ok - lb) / (ub - lb); #endif } else /* All black */ --- 1583,1596 ---- if ((d->dither_type & ~D_ADAPTIVE_BASE) == D_FLOYD) ditherbit = ((xrand() & 0xffff000) >> 12); else ! ditherbit = (DITHERPOINT(d, x+150, row+50, 4); ditherbit = ditherbit * rb / 65536; if (rb == 0 || (ditherbit < (kdarkness - lb))) bk = ok; else bk = 0; #else ! bk = (ok - lb) * 65535 / (ub - lb); #endif } else /* All black */ *************** And instead of subtracting all the black from the CMY values, I take the square of the black and subtract that. *** 1600,1608 **** if (bk > 0) { ! c -= (d->k_clevel * bk) >> 6; ! m -= (d->k_mlevel * bk) >> 6; ! y -= (d->k_ylevel * bk) >> 6; if (c < 0) c = 0; if (m < 0) --- 1608,1617 ---- if (bk > 0) { ! bk = bk * bk / 65536; ! c -= (d->k_clevel * bk) /128; ! m -= (d->k_mlevel * bk) /128; ! y -= (d->k_ylevel * bk) /128; if (c < 0) c = 0; if (m < 0) *************** Thomas |