| 1 |
tiffmedian |
| 2 |
========== |
| 3 |
|
| 4 |
.. program:: tiffmedian |
| 5 |
|
| 6 |
Synopsis |
| 7 |
-------- |
| 8 |
|
| 9 |
**tiffmedian** [ *options* ] *input.tif* *output.tif* |
| 10 |
|
| 11 |
Description |
| 12 |
----------- |
| 13 |
|
| 14 |
:program:`tiffmedian` applies the median cut algorithm to an RGB |
| 15 |
image in *input.tif* to generate a palette image that is written to |
| 16 |
*output.tif*. The generated colormap has, by default, 256 entries. |
| 17 |
The image data is quantized by mapping each pixel to the closest color |
| 18 |
values in the colormap. |
| 19 |
|
| 20 |
Options |
| 21 |
------- |
| 22 |
|
| 23 |
.. option:: -c |
| 24 |
|
| 25 |
Specify the compression to use for data written to the output file: |
| 26 |
:command:`-c none` for no compression, |
| 27 |
:command:`-c packbits` for PackBits compression, |
| 28 |
:command:`-c lzw` for Lempel-Ziv & Welch compression, |
| 29 |
:command:`-c zip` for Deflate compression. |
| 30 |
|
| 31 |
By default :program:`tiffmedian` will compress data according to the |
| 32 |
value of the ``Compression`` tag found in the source file. |
| 33 |
|
| 34 |
LZW compression can be specified together with a ``predictor`` value. |
| 35 |
A predictor value of 2 causes each scanline of the output image to |
| 36 |
undergo horizontal differencing before it is encoded; a value of 1 |
| 37 |
forces each scanline to be encoded without differencing. |
| 38 |
LZW-specific options are specified by appending a ``:``-separated |
| 39 |
list to the ``lzw`` option; e.g. ``-c lzw:2`` for LZW compression |
| 40 |
with horizontal differencing. |
| 41 |
|
| 42 |
.. option:: -C |
| 43 |
|
| 44 |
Specify the number of entries to use in the generated colormap. |
| 45 |
By default all 256 entries/colors are used. |
| 46 |
|
| 47 |
.. option:: -f |
| 48 |
|
| 49 |
Apply Floyd-Steinberg dithering before selecting a colormap entry. |
| 50 |
|
| 51 |
.. option:: -r |
| 52 |
|
| 53 |
Specify the number of rows (scanlines) in each strip of data |
| 54 |
written to the output file. By default, :program:`tiffmedian` |
| 55 |
attempts to set the rows/strip that no more than 8 kilobytes of |
| 56 |
data appear in a strip. |
| 57 |
|
| 58 |
Notes |
| 59 |
----- |
| 60 |
|
| 61 |
This program is derived from Paul Heckbert's :program:`median` program. |
| 62 |
|
| 63 |
See also |
| 64 |
-------- |
| 65 |
|
| 66 |
:doc:`pal2rgb` (1), |
| 67 |
:doc:`tiffinfo` (1), |
| 68 |
:doc:`tiffcp` (1), |
| 69 |
:doc:`tiffcmp` (1), |
| 70 |
:doc:`/functions/libtiff` (3tiff), |
| 71 |
|
| 72 |
**"Color Image Quantization for Frame Buffer Display"**, |
| 73 |
Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307. |