.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TIFFMEDIAN" "1" "Dec 17, 2022" "4.5" "LibTIFF" .SH NAME tiffmedian \- apply the median cut algorithm to data in a TIFF file .SH SYNOPSIS .sp \fBtiffmedian\fP [ \fIoptions\fP ] \fIinput.tif\fP \fIoutput.tif\fP .SH DESCRIPTION .sp \fBtiffmedian\fP applies the median cut algorithm to an RGB image in \fIinput.tif\fP to generate a palette image that is written to \fIoutput.tif\fP\&. The generated colormap has, by default, 256 entries. The image data is quantized by mapping each pixel to the closest color values in the colormap. .SH OPTIONS .INDENT 0.0 .TP .B \-c Specify the compression to use for data written to the output file: \fB\-c none\fP for no compression, \fB\-c packbits\fP for PackBits compression, \fB\-c lzw\fP for Lempel\-Ziv & Welch compression, \fB\-c zip\fP for Deflate compression. .sp By default \fBtiffmedian\fP will compress data according to the value of the \fBCompression\fP tag found in the source file. .sp LZW compression can be specified together with a \fBpredictor\fP value. A predictor value of 2 causes each scanline of the output image to undergo horizontal differencing before it is encoded; a value of 1 forces each scanline to be encoded without differencing. LZW\-specific options are specified by appending a \fB:\fP\-separated list to the \fBlzw\fP option; e.g. \fB\-c lzw:2\fP for LZW compression with horizontal differencing. .UNINDENT .INDENT 0.0 .TP .B \-C Specify the number of entries to use in the generated colormap. By default all 256 entries/colors are used. .UNINDENT .INDENT 0.0 .TP .B \-f Apply Floyd\-Steinberg dithering before selecting a colormap entry. .UNINDENT .INDENT 0.0 .TP .B \-r Specify the number of rows (scanlines) in each strip of data written to the output file. By default, \fBtiffmedian\fP attempts to set the rows/strip that no more than 8 kilobytes of data appear in a strip. .UNINDENT .SH NOTES .sp This program is derived from Paul Heckbert’s \fBmedian\fP program. .SH SEE ALSO .sp \fI\%pal2rgb\fP (1), \fI\%tiffinfo\fP (1), \fI\%tiffcp\fP (1), \fI\%tiff2cmp\fP (1), \fI\%libtiff\fP (3tiff), .sp \fB“Color Image Quantization for Frame Buffer Display”\fP, Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297\-307. .SH AUTHOR LibTIFF contributors .SH COPYRIGHT 1988-2022, LibTIFF contributors .\" Generated by docutils manpage writer. .