TIFFMEDIAN(1) TIFFMEDIAN(1) NAME tiffmedian−applythemediancutalgorithmtodatainaTIFFfile SYNOPSIS tiffmedian[options]input.tifoutput.tif DESCRIPTION tiffmedianapplysthemediancutalgorithmtoanRGBimageininput.tiftogenerateapalette imagethatiswrittentooutput.tif.Thegeneratedcolormaphas,bydefault,256entries.The imagedataisquantizedbymappingeachpixeltotheclosestcolorvaluesinthecolormap. OPTIONS −cSpecifythecompressiontousefordatawrittentotheoutputfile:nonefornocompression,packbitsforPackBitscompression,lzwforLempel-Ziv&Welchcompression,and zipforDeflatecompression.Bydefaulttiffmedianwillcompressdataaccordingtothe valueoftheCompressiontagfoundinthesourcefile. LZWcompressioncanbespecifiedtogetherwithapredictorvalue.Apredictorvalueof2 causeseachscanlineoftheoutputimagetoundergohorizontaldifferencingbeforeitis encoded;avalueof1forceseachscanlinetobeencodedwithoutdifferencing.LZW-spe-cificoptionsarespecifiedbyappendinga‘‘:’’-separatedlisttothe‘‘lzw’’option;e.g.−c lzw:2forLZWcompressionwithhorizontaldifferencing. −CSpecifythenumberofentriestouseinthegeneratedcolormap.Bydefaultall256 entries/colorsareused. −fApplyFloyd-Steinbergditheringbeforeselectingacolormapentry. −rSpecifythenumberofrows(scanlines)ineachstripofdatawrittentotheoutputfile.By default,tiffmedianattemptstosettherows/stripthatnomorethan8kilobytesofdata appearinastrip. NOTES ThisprogramisderivedfromPaulHeckbert’smedianprogram. SEEALSO pal2rgb(1),tiffinfo(1),tiffcp(1),tiffcmp(1),libtiff(3) "ColorImageQuantizationforFrameBufferDisplay",PaulHeckbert,SIGGRAPHproceedings, 1982,pp.297-307. October15,1995 1