TIFFMEDIAN(1)
π TIFFMEDIAN π
okay bestie, welcome to tiffmedian β it's a LibTIFF page and it is, no cap, the moment your RGB image gets a glow-down into a cute lil palette β¨
β¨ NAME β¨
tiffmedian β apply the median cut algorithm to data in a TIFF file π¨
πΈ SYNOPSIS πΈ
tiffmedian [ options ] input.tif output.tif
π¦ DESCRIPTION π¦
So here's the vibe: tiffmedian takes an RGB image in input.tif, runs the median cut algorithm on it, and pops out a palette image written to output.tif. Iconic behaviour, honestly.
The generated colormap has 256 entries by default β yes, all of them, we're not being shy π
And how does the quantizing happen? Every pixel gets mapped to the closest color values in the colormap. That's it, that's the whole glow-up. Periodt. π
π OPTIONS π
-cβ tell it what compression to use for the data written to the output file. Your menu is:-c nonefor no compression at all,-c packbitsfor PackBits compression,-c lzwfor Lempel-Ziv & Welch compression, and-c zipfor Deflate compression. ποΈ
By default, tiffmedian will compress data according to whatever the value of the Compression tag in the source file says. Respecting the original's choices, we love that for it π«Ά
Now, LZW compression can be specified together with a predictor value, and this is the part where you lock in π₯ A predictor value of 2 causes each scanline of the output image to undergo horizontal differencing before it gets encoded; a value of 1 forces each scanline to be encoded without differencing. LZW-specific options get specified by appending a :-separated list to the lzw option β like, for example, -c lzw:2 for LZW compression with horizontal differencing. See? Cute AND precise β¨
-Cβ specify the number of entries to use in the generated colormap. (CapitalC, bestie, do not confuse her with lowercase-cup there, they are two different girlies π) By default all 256 entries/colors are used. π-fβ apply Floyd-Steinberg dithering before selecting a colormap entry. Dithering before, not after. Okay? Okay π-rβ specify the number of rows (scanlines) in each strip of data written to the output file. By default,tiffmedianattempts to set the rows/strip so that no more than 8 kilobytes of data appear in a strip. Very considerate of it, honestly π
π NOTES π
This program is derived from Paul Heckbert's median program. Giving credit where credit is due, as we should π
π SEE ALSO π
pal2rgb(1)tiffinfo(1)tiffcp(1)tiffcmp(1)libtiff(3tiff),
And also this absolute classic of a paper, if you wanna go full academic main character energy π:
- "Color Image Quantization for Frame Buffer Display", Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307.
π AUTHOR π
LibTIFF contributors π
π COPYRIGHT π
1988-2025, LibTIFF contributors
okay that's the whole page bestie, go forth and quantize responsibly πΈ
Version 4.7, dated Jun 27, 2026 β mwah, ty for reading, ily, bye πβ¨π¦
π¦ where this page comes from
- fedora 43: libtiff-tools 4.7.2-1.fc43
- fedora 43: libtiff-tools 4.7.2-3.fc43 Β· libtiff
- fedora 44: libtiff-tools 4.7.2-1.fc44
- fedora 44: libtiff-tools 4.7.2-3.fc44 Β· libtiff
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms