Created attachment 7538 [details] The rendered file demonstrating the artifact. The error diffusion algorithm used in tiffscaled can generate large, unsightly artifacts when large images of flat color are rendered. This is reminiscent to the little bugs in the "Life" computer game, or the automata in Wolfram's ego-inflating tome "A New Kind of Science". Attached are two files. One is the source PDF, the other is the 1-bit TIFF output file. The command used was: /opt/local/bin/gs -sDEVICE=tiffscaled -sOutputFile=/scaled.tif -dMinFeatureSize=4 -r600 /Users/eric/Desktop/PDF\ Analyzer/CMYK\ Square.pdf The artifact can be seen in the grey rectangle in the upper left-hand corner.
Created attachment 7539 [details] The source PDF file.
I recommend either changing tiffscaled to use a stochastic threshold array. We can generate one using my 'genpat' function of any dimension, or use the 167x167 array in 'ht_ccsto.ps'. Note that gx_ht_construct_threshold can be used to get a threshold array from whatever halftone is set in the graphics state so that "normal" methods (like PS) can be used to set up the threshold array. If better error diffusion is needed, then we should take advantage of the Even Toned Screening that is in the 'rinkj' directory. I've changed this to 'enhancement' and marked it bountiable.
That's exactly typical of using error diffusion. I disagree with Ray about 'changing to use stochastic thresholding'. There may be a case to be made for having stochastic thresholding as an option, but there are cases where error diffusion does a better job.
I agree that an option for ETS (Even Tone Screening) _or_ threshold array based screening (for when performance in important, or when the technology cannot image dispersed individual dots). Deriving the threshold array from the 'order' using gx_ht_construct_threshold lets the user choose the screening. I suppose the selection of threshold array vs. ETS would be a parameter for this device. This is bountiable, and an enhancement, but I'll assign it to Robin since he wrote the device in question and can guide any outside developer seeking the bounty or maybe get to it himself.
Rename bug.
I'm wondering what the scope of this enhancement request is, now that ETS halftoning is implemented.
Supporting thresold array based haltoning would provide for either ordered or blue noise (stochastic) to be used. Ghostscript is distributed with both gen_ordered and gen_stochastic programs to generate threshold arrays. Threshold array based halftoning is much faster than error diffusion, and is amenable to using SIMD (SSE2 or other) for even more acceleration.