hpcdtoppm(1L) hpcdtoppm(1L) NAME hpcdtoppm−convertaPhoto-CDfileintoaportablebitmapfile SYNOPSIS hpcdtoppminfile[−a][{−C|−0|−Overview|−O}]fileopt][−c0][−c-][−c+][−crop][−d] [−dpif][−eps][−epsd][−epsg][−fakscale][−hori][−i][−qualityN][−l][−m] [−maxmemoryN][−n][−optimize][−pbpos][−pgm][−phheight][−plpos][−pos] [−ppm][−ps][−psd][−psg][−pwwidth][−qualityN][−r][−rep][−Slongshort][−s][−vert] [-x][−ycc][−1|−Base/16|−128x192][−2|−Base/4|−256x384][−3|−Base|−512x768] [−4|−4Base|−1024x1536][−5|−16Base|−2048x3072][−6|−64Base|−4096x6144][outfile] DESCRIPTION ThisprogramacceptsPhoto-CDimageoroverviewfiledatafromthespecifiedinputfile,infile (or,iftheresolutionislowerthan64Baseandthefileargumentisspecifiedas−,fromstandard input),andwriteseitherPortableBitmapFormatorPOSTSCRIPTtothespecifiedoutputfile(or tostandardoutputifnofileisspecified). OnastandardPhoto-CD,imagefilesappearinphotocd/images,wheretheyappearinfileswith namesoftheformimgnnnn.pcd,wherennnnisa4-digit-number.Theoverviewfileappearsin photocd/overview.pcd. Photo-CDimagesarestoredusingasmanyas6differentresolutions: Format Resolution ------ ---------- 64Base 4096x6144(ProPhotoCDonly) 16Base 2048x3072 4Base 1024x1536 Base 512x768 Base/4 256x384 Base/16 128x192 TheoverviewfileemploysBase/16format. OPTIONS Invokinghpcdtoppmwithoutargumentsproducesalistofdefaultvalues.Notethatyoucansupplyonlyonesizeoption. −aAutomaticallydetermineimageorientation(thisoptionisexperimental,anddoesnot workforoverviewfiles). {−C|−0|−Overview|−O}fileopt Extractallimagesfromanoverviewfile.Themandatoryfileargumentisthenameofa ppmfile;outputfilesarenamedfilennnn,wherennnnisa4-digitnumber.Overview imagesareextractedintheiroriginalBase/16format.Thevalueofoptdeterminesthe orientationofthecontactsheetimage;recognizedvaluesare: nDonotrotatetheimage. lRotatethepicturecounter-clockwise(portraitmode). rRotatethepictureclockwise(portraitmode). −c0Donotcorrect(brightenordarken)theimage. −c-Darkentheimage. −c+Brightentheimage. −cropCutofftheblackframewhichsometimesappearsattheimageborders. −dShowonlythedecompresseddifferenceratherthanthecompleteimage(applicableonlyto 4Baseand16Baseimages). 3March1994 1 hpcdtoppm(1L) hpcdtoppm(1L) −dpires SettheprinterresolutiontoresforditheredPOSTSCRIPTimages. −epsWriteaRGBEncapsulatedPOSTSCRIPTcolorimage. −epsdWriteaFloyd-SteinbergditheredimageinEncapsulatedPOSTSCRIPT. −jpegWriteimageinJPEGformat. −qualityN Scalequantizationtablestoadjustimagequality.(JPEGoutputonly)Qualityis0 (worst)to100(best);defaultis75. −epsgWriteagrayscaleimageinEncapsulatedPOSTSCRIPT. −fakscale SetthescalingfactorforditheredPOSTSCRIPTimagestoscale. −horiFliptheimagehorizontally. −iSendinformationfromanimagefileheadertostandarderror. −lRotatethepicturecounter-clockwise(portraitmode). −mWritemessagesaboutthephasesofdecodingtostandarderror. −maxmemoryN SetlimitforamountofmemoryusedbytheJPEGencoder.Valueisinthousandsof bytes.Ifmorespaceisneeded,temporaryfileswillbeused.Defaultis50000bytes. −nDonotrotatetheimage. −optimize Performoptimizationofentropyencodingparameters.(JPEGoutputonly)Withoutthis, defaultencodingparametersareused.−optimizeusuallymakestheJPEGfilealittle smaller,butencodingissomewhatslowerandneedsmuchmorememory.Imagequality andspeedofdecompressionareunaffectedby−optimize. −pbpos SetthebottompositionofthePOSTSCRIPTimagetopos. −pgmWriteapgm(grayscale)image. −phheight SettheheightofthePOSTSCRIPTimagetoheight. −plpos SettheleftmostpositionofthePOSTSCRIPTimagetopos. −posPrinttherelativestartingpositionofthedataforthecurrentresolution. −ppmWriteappmRGB(color)image. −psWriteaRGBPOSTSCRIPTcolorimage. −psdWriteaFloyd-SteinbergditheredimageinPOSTSCRIPT. −psgWriteaPOSTSCRIPTgrayscaleimage. −pwwidth SetthewidthofthePOSTSCRIPTimagetowidth. −rRotatethepictureclockwise(portraitmode). −repTrytojumpoverreadingerrorsintheHuffmancode. −Slongshort Cutoutasubrectanglewithboundariesdefinedbythevalues: longForthelongersideoftheimage. 3March1994 2 hpcdtoppm(1L) hpcdtoppm(1L) shortFortheshortersideoftheimage. wherelongandshorttakeoneoftwoforms: a−bCutfrompositionatopositionb. a+bStartingatoffseta,cutalengthofb. andwhereaandbareeitherintegersrepresentingpixellocations,orfloatingpointvalues overtherange[0.0...1.0],representingthefractionofthelengthofaside. −sApplyasimplesharpnessoperatortotheluminositychannel. −vertFliptheimagevertically. -xOverskipMode(applicabletoBase/16,Base/4,Baseand4Base).InPhoto-CDimages theluminositychannelisstoredinfullresolution,thetwochromaticitychannelsare storedinhalfresolutiononlyandhavetobeinterpolated.InOverskipMode,thechromaticitychannelsofthenexthigherresolutionaretakeninsteadofinterpolating.Tosee thedifference,generateoneppmwithandoneppmwithoutthisflag.Usepnmarith(1L) togeneratethedifferenceimageofthesetwoimages.Callppmhist(1L)forthisdifference orshowitwithxv(1L)(pushtheHistEqbuttoninthecoloreditor). −yccWritetheimageinppmYCCformat. −1|−Base/16|−128x192 ExtracttheBase/16image. −2|−Base/4|−256x384 ExtracttheBase/4image. −3|−Base|−512x768 ExtracttheBaseimage. −4|−4Base|−1024x1536 Extractthe4Baseimage. −5|−16Base|−2048x3072 Extractthe16Baseimage. −6|−64Base|−4096x6144 Extractthe64Baseimage.ThisresolutioncanbeextractedfromProPhotoCDimages only.Thepathofthe64Baseextensionfilesisderivedfromthepathtotheimagefile. Thismeansthatitdoesn’tworkonstdinanthedirectorystructuremustbethevery sameasontheProPhotoCD. POSTSCRIPTOUTPUT ForPOSTSCRIPToutput(options−ps,−eps,−psg,−epsg,−psd,−epsg)youcandefineboth theresolutionandplacementoftheimage.Bothsizeandpositionarespecifiedinpoints(1/72 inch). Thepositionoftheimage(wheretheoriginisassumedtobeatthelowerleftcornerofthepage) iscontrolledbythe−pland−pboptions(applicableatallresolutions). Thesizeofcolorandgrayscaleimagesischangedwiththe−pwand−phoptions.Everyimage pixelismappedontoonePOSTSCRIPTpixel. TherearethreemodesofcontrolforditheredPOSTSCRIPT: Imagesize (−pwand-ph) Printerresolution (−dpi) 3March1994 3 hpcdtoppm(1L) hpcdtoppm(1L) Scalingfactor (−fak) Thesethreefactorsareinterdependent,hencenomorethentwocanbespecifiedsimultaneously. Using−dpiandthe−pw/−phoptionstogetheroftenyieldspleasingresults.Evenusingthe defaultvaluesfortheseoptionswillproduceresultsdifferingfromthoseobtainedwithoutuseof theoptions. BUGS Theprogramignoresreadprotection. The−ioptionisnotworkingcorrectly. AvailableinformationoboutthePhoto-CDformatisvague;thisprogramwasdevelopedbytrial-and-errorafterstaringathex-dumps.Pleasesendbugsreportsandpatchestotheauthor. SEEALSO pnmarith(1L),ppm(5L),ppmhist(1L),ppmquant(1L),ppmtopgm(1L),ppmtorgb3(1L),cjpeg(1L), xv(1L) VERSION Thenamehpcdtoppmstandsfor"Hadmut’spcdtoppm,"tomakeitdistinguishableintheevent thatsomeoneelseisbuildingasimilarapplicationandnamingitpcdtoppm.Thisisversion0.6. AUTHOR Copyright(c)1992,1993,1994byHadmutDanisch(danisch@ira.uka.de).Thissoftwareisnot publicdomain.Permissiontouseanddistributethissoftwareanditsdocumentationfornoncommercialuseandwithoutfeeisherebygranted,providedthattheabovecopyrightnoticeappearin allcopiesandthatboththatcopyrightnoticeandthispermissionnoticeappearinsupporting documentation.Thissoftwaremaynotbesoldorusedforprofit-makingactivities. ManualpageextensivelymodifiedbyR.P.C.Rodgers(rodgers@nlm.nih.gov). AmigaportandJPEGsupportaddedbyGu¨ ntherRo¨ hrich(Guenther@studbox.uni-stuttgart.de) 3March1994 4