| 1 |
Ordered Dither Screen Creation Tool. Copyright 2010-2021 Artifex Software, Inc. |
| 2 |
|
| 3 |
This code is designed to enable the creation of clustered dot threshold arrays |
| 4 |
for halftoning, which can provide high lpi without quantization issues. As |
| 5 |
the lpi requirements of a halftone screen increases and begins to approach the |
| 6 |
limits of the printer resolution, the size of the clustered dot decreases and |
| 7 |
the number of levels that can be represented by the clustered dot decreases. |
| 8 |
To overcome this, the clustered dots are placed in a larger threshold array, |
| 9 |
where the threshold values of the individual clustered dots scaled are |
| 10 |
dithered to enable the representation of more gray levels within the larger |
| 11 |
screen. The dithering is performed in a manner that is pleasing to the visual |
| 12 |
system. |
| 13 |
|
| 14 |
The command line and parameters are as follows: |
| 15 |
|
| 16 |
gen_ordered [-a target_angle] -d [dot_shape] -f [ps | ppm | raw | raw16 | tos] |
| 17 |
[-l target_lpi] [-q target_quantization_levels] [-r resolution] |
| 18 |
[-s size_of_supercell] |
| 19 |
|
| 20 |
where: |
| 21 |
|
| 22 |
target_angle: The desired screen angle in degrees. [default 0 degrees] |
| 23 |
|
| 24 |
dot_shape: The index number of the dot shape, CIRCLE, REDBOOK_CIRCLE, INVERTED, |
| 25 |
RHOMBOID, LINE_X, LINE_Y, DIAMOND1, DIAMOND2 or ROUNDSPOT values from 0 to 8, |
| 26 |
respectively. |
| 27 |
|
| 28 |
target_lpi: The desired resolution of the screen in lines/inch. [default 300dpi] |
| 29 |
|
| 30 |
target_quantization_levels: indicates the desired number of "gray" levels |
| 31 |
that you wish to achieve with the screen (e.g. 256). [default 256] |
| 32 |
Special note on this option. To achieve a particular quantization |
| 33 |
level, it is neccessary that the size_of_supercell is sufficiently large. |
| 34 |
Since the default size of size_of_supercell is set to 1, the minimum |
| 35 |
possible size is always used and the target quantization may not be |
| 36 |
achieved. A warning is displayed to indicate this condition and a minimum |
| 37 |
size is suggested. |
| 38 |
|
| 39 |
resolution: The resolution of the output device in dots/inch. Horizontal and |
| 40 |
vertical resolution can be different if given as -rHxV where H is the |
| 41 |
horizontal, and V is the vertical resolution. [default 300dpi] |
| 42 |
|
| 43 |
size_of_supercell: The specified size of the supercell will impact the number |
| 44 |
of achievable levels. If a small size is specified (example 1) the |
| 45 |
smallest periodic cell will be created, regardless of the setting for |
| 46 |
target_quantization_levels and it is possible that target_quantization_levels |
| 47 |
will not be achieved. size_of_supercell should be set to something |
| 48 |
reasonably large to achieve a specified target_quantization_levels, for |
| 49 |
example 64. Work is underway to have this value optimally set based upon |
| 50 |
the desired number of gray levels. |
| 51 |
|
| 52 |
The output format (-f format) [default: tos] can be one of: |
| 53 |
|
| 54 |
Portable Pixmap (ppm): The screen is stored in a .ppm image that is readily |
| 55 |
viewed by most image viewers. A maximum of 256 levels can be written in the |
| 56 |
format. |
| 57 |
|
| 58 |
PostScript (ps): The output will be a screen that can readily be brought into |
| 59 |
ghostscript. For example: |
| 60 |
|
| 61 |
gswin32c -r300 -dDisplayFormat=16#20102 -c \ |
| 62 |
"(Screen_20x10.ps) run sethalftone" examples/tiger.eps |
| 63 |
|
| 64 |
This will be a HalftoneType 3, 8-bit threshold array unless there are more |
| 65 |
than 256 levels. For up to 65,536 levels a HalftoneType 16 Postscript |
| 66 |
threshold array will be output. |
| 67 |
|
| 68 |
Raw (raw): An 8 bit row ordered Width x Height threshold array that is |
| 69 |
periodic vertically and horizontally. The size of the array is indicated in |
| 70 |
the output file name, for example Screen_Dithered_WxH.raw. A maximum of 256 |
| 71 |
levels can be written in this format. |
| 72 |
|
| 73 |
16-bitRaw (raw16): An 16 bit row ordered Width x Height threshold array that |
| 74 |
is periodic vertically and horizontally. The size of the array is indicated |
| 75 |
in the output file name, for example Screen_Dithered_WxH.16.raw. A maximum of |
| 76 |
65536 levels can be written in this format. |
| 77 |
|
| 78 |
Turn-On-Sequence (tos): A format compatible with the 'thresh_remap' program. |
| 79 |
This consists of a line with the Width and Height of the threshold array as |
| 80 |
"# W=%d H=%d\n" followed by (width * height) x, y pairs in the format "%d\t%d |
| 81 |
n". This format can support more than 65,536 levels, and is the default format. |
| 82 |
|
| 83 |
Currently the code is limited in a few features, which will be included in the |
| 84 |
near future: |
| 85 |
|
| 86 |
1) The code currently only creates bi-level threshold arrays. It is planned |
| 87 |
to enable the creation of multi-level threshold arrays. Due to the manner |
| 88 |
in which the screens are created, this should be a simple task. |
| 89 |
|
| 90 |
2) Often it is desired to incorporate a tone reproduction curve (TRC) into the |
| 91 |
design of a screen. While not currently supported, the plan is add that |
| 92 |
option into this code. The thresh_remap program can be used to incorporate |
| 93 |
a TRC from the 'tos' format. |
| 94 |
|
| 95 |
3) Typically screens are designed off line and provided as a threshold array |
| 96 |
to most applications. In postscript, it is possible that screens can be |
| 97 |
specified within the document with specific attributes including line |
| 98 |
frequency and dot shape. This code needs significant optimization before |
| 99 |
it should be folded into the ghostscript code base for use in this manner. |
| 100 |
|
| 101 |
4) Minimum dot size handling is also a feature to be added. |
| 102 |
|