images 162 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584
  1. #------------------------------------------------------------------------------
  2. # $File: images,v 1.263 2024/11/10 20:44:30 christos Exp $
  3. # images: file(1) magic for image formats (see also "iff", and "c-lang" for
  4. # XPM bitmaps)
  5. #
  6. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  7. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  8. # merging several one- and two-line files into here.
  9. #
  10. # little magic: PCX (first byte is 0x0a)
  11. # Targa - matches `povray', `ppmtotga' and `xv' outputs
  12. # by Philippe De Muyter <phdm@macqel.be>
  13. # URL: http://justsolve.archiveteam.org/wiki/TGA
  14. # https://en.wikipedia.org/wiki/Truevision_TGA
  15. # Reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
  16. # Update: Joerg Jenderek February 2024
  17. # Note: called by DROID "Truevision TGA Bitmap" version 1.0 via PUID x-fmt/367
  18. # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
  19. # ,32 or 33 (both not observed)
  20. # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
  21. # or theoretically 2-128 reserved for use by Truevision or 128-255 may be used for developer applications
  22. # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
  23. # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
  24. # `tgatoppm' recognizes a superset (Index may be anything)
  25. #
  26. # test of Color Map Type 0~no 1~color map
  27. # and Image Type 1 2 3 9 10 11 32 33
  28. # and Color Map Entry Size 0 15 16 24 32
  29. 0 ubequad&0x00FeC400000000C0 0
  30. # Targa image data (strength=70=110-40) before some Commodore disc image (strength=70=70+0 ./c64) like Cabal+2-MarioSoft(1).d64
  31. # and some MMDF mailbox (strength=70=70+0 ./mmdf) like uupc.input.1
  32. # Conflict with MPEG sequences.
  33. !:strength -40
  34. # Prevent conflicts with CRI ADX.
  35. #>(2.S-2) belong !0x28632943
  36. # above line does not work for rgb32_top_left_rle.tga
  37. # skip some MPEG sequence *.vob and some CRI ADX audio with improbable interleave bits
  38. >17 ubyte&0xC0 !0xC0
  39. # skip more garbage like *.iso by looking for positive image type
  40. >>2 ubyte >0
  41. # skip some compiled terminfo like xterm+tmux by looking for image type less equal 33
  42. >>>2 ubyte <34
  43. # skip some MPEG sequence *.vob HV001T01.EVO winnicki.mpg with unacceptable alpha channel depth 11
  44. >>>>17 ubyte&0x0F !11
  45. # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel depth 1 8 15 16 24 32
  46. >>>>>16 ubyte 1
  47. # skip few Commodore D64 disc image like "The Great Gianna Sisters.d64" and
  48. # few MMDF mailbox like uupc.input.1 with unlikely black&white, dimension 0101h x 0101h (257x257) and +0101h origin (+257 +257)
  49. >>>>>>8 quad !0x0101010101010101
  50. >>>>>>>0 use tga-image
  51. >>>>>16 ubyte 8
  52. >>>>>>0 use tga-image
  53. >>>>>16 ubyte 15
  54. >>>>>>0 use tga-image
  55. >>>>>16 ubyte 16
  56. >>>>>>0 use tga-image
  57. >>>>>16 ubyte 24
  58. >>>>>>0 use tga-image
  59. >>>>>16 ubyte 32
  60. >>>>>>0 use tga-image
  61. # display tga bitmap image information
  62. 0 name tga-image
  63. >2 ubyte <34 Targa image data
  64. !:mime image/x-tga
  65. # Apple Uniform Type Identifier: com.truevision.tga-image
  66. !:apple ????TPIC
  67. # normal extension .tga but some Truevision products used others:
  68. # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
  69. # afi bpx
  70. !:ext tga/tpic/icb/vda/vst
  71. # image type 1 2 3 9 10 11 32 33
  72. >2 ubyte&0xF7 1 - Map
  73. >2 ubyte&0xF7 2 - RGB
  74. # alpha channel
  75. >>17 ubyte&0x0F >0 \bA
  76. >2 ubyte&0xF7 3 - Mono
  77. # type not found, but by http://www.fileformat.info/format/tga/corion.htm
  78. # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
  79. >2 ubyte 32 - Color
  80. # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
  81. >2 ubyte 33 - Color
  82. # Color Map Type 0~no 1~color map
  83. >1 ubyte 1 (
  84. # first color map entry, 0 normal
  85. >>3 uleshort >0 \b%d-
  86. # color map length 0 2 1dh 3bh d9h 100h
  87. >>5 uleshort x \b%d)
  88. # 8~run length encoding bit
  89. >2 ubyte&0x08 8 - RLE
  90. # gimp can create big pictures!
  91. >12 uleshort >0 %d x
  92. >12 uleshort =0 65536 x
  93. # image height. 0 interpreted as 65536
  94. >14 uleshort >0 %d
  95. >14 uleshort =0 65536
  96. # Image Pixel depth 1 8 15 16 24 32
  97. >16 ubyte x x %d
  98. # X origin of image. 0 normal
  99. >8 uleshort >0 +%d
  100. # Y origin of image. 0 normal; positive for top
  101. >10 uleshort >0 +%d
  102. # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
  103. # alpha depth like: 1 8
  104. >17 ubyte&0x0F >0 - %d-bit alpha
  105. # bits 5-4 give direction. normal bottom left
  106. >17 ubyte &0x20 - top
  107. #>17 ubyte ^0x20 - bottom
  108. >17 ubyte &0x10 - right
  109. #>17 ubyte ^0x10 - left
  110. # some info say other bits 6-7 should be zero
  111. # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
  112. # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
  113. #>17 ubyte&0xC0 0x00 - no interleave
  114. >17 ubyte&0xC0 0x40 - interleave
  115. >17 ubyte&0xC0 0x80 - four way interleave
  116. >17 ubyte&0xC0 0xC0 - reserved
  117. # positive length implies identification field
  118. >0 ubyte >0
  119. >>18 string x "%s"
  120. # Note: called by DROID "Truevision TGA Bitmap" version 2.0 via fmt/402
  121. # last 18 bytes of newer tga file footer signature
  122. >18 search/4261301/s TRUEVISION-XFILE.\0
  123. # extension area offset if not 0
  124. >>&-8 ulelong >0
  125. # length of the extension area. normal 495 for version 2.0
  126. >>>(&-4.l) uleshort 0x01EF
  127. # AuthorName[41]
  128. >>>>&0 string >\0 - author "%-.40s"
  129. # Comment[324]=4 * 80 null terminated
  130. >>>>&41 string >\0 - comment "%-.80s"
  131. # date
  132. >>>>&365 ubequad&0xffffFFFFffff0000 !0
  133. # Day
  134. >>>>>&-6 uleshort x %d
  135. # Month
  136. >>>>>&-8 uleshort x \b-%d
  137. # Year
  138. >>>>>&-4 uleshort x \b-%d
  139. # time
  140. >>>>&371 ubequad&0xffffFFFFffff0000 !0
  141. # hour
  142. >>>>>&-8 uleshort x %d
  143. # minutes
  144. >>>>>&-6 uleshort x \b:%.2d
  145. # second
  146. >>>>>&-4 uleshort x \b:%.2d
  147. # JobName[41]
  148. >>>>&377 string >\0 - job "%-.40s"
  149. # JobHour Jobminute Jobsecond
  150. >>>>&418 ubequad&0xffffFFFFffff0000 !0
  151. >>>>>&-8 uleshort x %d
  152. >>>>>&-6 uleshort x \b:%.2d
  153. >>>>>&-4 uleshort x \b:%.2d
  154. # SoftwareId[41]
  155. >>>>&424 string >\0 - %-.40s
  156. # SoftwareVersionNumber
  157. >>>>&424 ubyte >0
  158. >>>>>&40 uleshort/100 x %d
  159. >>>>>&40 uleshort%100 x \b.%d
  160. # VersionLetter
  161. >>>>>&42 ubyte >0x20 \b%c
  162. # KeyColor
  163. >>>>&468 ulelong >0 - keycolor %#8.8x
  164. # Denominator of Pixel ratio. 0~no pixel aspect
  165. >>>>&474 uleshort >0
  166. # Numerator
  167. >>>>>&-4 uleshort >0 - aspect %d
  168. >>>>>&-2 uleshort x \b/%d
  169. # Denominator of Gamma ratio. 0~no Gamma value
  170. >>>>&478 uleshort >0
  171. # Numerator
  172. >>>>>&-4 uleshort >0 - gamma %d
  173. >>>>>&-2 uleshort x \b/%d
  174. # ColorOffset
  175. #>>>>&480 ulelong x - col offset %#8.8x
  176. # StampOffset
  177. #>>>>&484 ulelong x - stamp offset %#8.8x
  178. # ScanOffset
  179. #>>>>&488 ulelong x - scan offset %#8.8x
  180. # AttributesType
  181. #>>>>&492 ubyte x - Attributes %#x
  182. ## EndOfTGA
  183. # PBMPLUS images
  184. # URL: https://en.wikipedia.org/wiki/Netpbm
  185. # The next byte following the magic is always whitespace.
  186. # adding 65 to strength so that Netpbm images comes before "x86 boot sector" or
  187. # "DOS/MBR boot sector" identified by ./filesystems
  188. 0 name netpbm
  189. >3 regex/s =\^[0-9]{1,50}[\040\t\f\r\n]+[0-9]{1,50} Netpbm image data
  190. >>&0 regex =[0-9]{1,50} \b, size = %s x
  191. >>>&0 regex =[0-9]{1,50} \b %s
  192. 0 search/1 P1
  193. # test for whitespace after 2 byte magic
  194. >2 regex/2 [\040\t\f\r\n]
  195. # skip DROID x-fmt-164-signature-id-583.pbm with ten 0 digits
  196. >>3 string !000000000
  197. >>>0 use netpbm
  198. >>>0 string x \b, bitmap
  199. !:strength + 65
  200. !:mime image/x-portable-bitmap
  201. !:ext pbm
  202. # check for character # starting a comment line
  203. >>>3 ubyte =0x23
  204. >>>>4 string x %s
  205. 0 search/1 P2
  206. >0 regex/4 P2[\040\t\f\r\n]
  207. >>0 use netpbm
  208. >>0 string x \b, greymap
  209. !:strength + 65
  210. # american spelling gray
  211. !:mime image/x-portable-graymap
  212. !:ext pgm
  213. 0 search/1 P3
  214. >0 regex/4 P3[\040\t\f\r\n]
  215. >>0 use netpbm
  216. >>0 string x \b, pixmap
  217. !:strength + 65
  218. !:mime image/x-portable-pixmap
  219. !:ext ppm
  220. 0 string P4
  221. >0 regex/4 P4[\040\t\f\r\n]
  222. >>0 use netpbm
  223. >>0 string x \b, rawbits, bitmap
  224. !:strength + 65
  225. !:mime image/x-portable-bitmap
  226. !:ext pbm
  227. 0 string P5
  228. >0 regex/4 P5[\040\t\f\r\n]
  229. >>0 use netpbm
  230. >>0 string x \b, rawbits, greymap
  231. !:strength + 65
  232. !:mime image/x-portable-greymap
  233. !:ext pgm
  234. 0 string P6
  235. >0 regex/4 P6[\040\t\f\r\n]
  236. >>0 use netpbm
  237. >>0 string x \b, rawbits, pixmap
  238. !:strength + 65
  239. !:mime image/x-portable-pixmap
  240. !:ext ppm/pnm
  241. # URL: https://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format
  242. # Reference: http://fileformats.archiveteam.org/wiki/Portable_Arbitrary_Map
  243. # Update: Joerg Jenderek
  244. 0 string P7
  245. # skip DROID fmt-405-signature-id-589.pam by looking for character like New Line
  246. >2 ubyte !0xAB
  247. #>2 ubyte =0x0A
  248. >>3 search/256/b WIDTH Netpbm PAM image file, size =
  249. !:mime image/x-portable-arbitrarymap
  250. !:ext pam
  251. !:strength + 65
  252. >>>&1 string x %s
  253. >>>3 search/256/b HEIGHT x
  254. >>>>&1 string x %s
  255. # at offset 2 a New Line character (0xA) should appear
  256. >>>2 ubyte !0x0A \b, %#x at offset 2 instead new line
  257. # From: bryanh@giraffe-data.com (Bryan Henderson)
  258. 0 string \117\072 Solitaire Image Recorder format
  259. >4 string \013 MGI Type 11
  260. >4 string \021 MGI Type 17
  261. 0 string .MDA MicroDesign data
  262. >21 ubyte 48 version 2
  263. >21 ubyte 51 version 3
  264. 0 string .MDP MicroDesign page data
  265. >21 ubyte 48 version 2
  266. >21 ubyte 51 version 3
  267. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  268. # [GRR: this *must* go before TIFF]
  269. 0 string IIN1 NIFF image data
  270. !:mime image/x-niff
  271. # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
  272. # (CIFF) file. These are apparently all little-endian.
  273. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  274. # URL: https://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
  275. 0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
  276. !:mime image/x-canon-crw
  277. >16 uleshort x \b, version %d.
  278. >14 uleshort x \b%d
  279. # Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
  280. # number. Put this above the TIFF test to make sure we detect them.
  281. # These are apparently all little-endian.
  282. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  283. # URL: https://libopenraw.freedesktop.org/wiki/Canon_CR2
  284. 0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
  285. !:mime image/x-canon-cr2
  286. !:strength +80
  287. >10 ubyte x \b, version %d.
  288. >11 ubyte x \b%d
  289. # Fujifilm RAF RAW image files with embedded JPEG data and compressed
  290. # or uncompressed CFA RAW data. Byte order: Big Endian.
  291. # URL: https://libopenraw.freedesktop.org/formats/raf/
  292. # Useful info from http://fileformats.archiveteam.org/wiki/Fujifilm_RAF.
  293. # File extension: RAF
  294. # Works for both the FinePix S2 Pro and the X-T3. Anybody have some more Fuji
  295. # raw samples available?
  296. # -- David Dyer-Bennet <dd-b@dd-b.net> 9-Sep-2021
  297. 0 string FUJIFILMCCD-RAW Fujifilm RAF raw image data
  298. !:mime image/x-fuji-raf
  299. !:ext raf
  300. >0x10 string x \b, format version %4.4s
  301. >0x1C string x \b, camera %s
  302. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  303. # The second word of TIFF files is the TIFF version number, 42, which has
  304. # never changed. The TIFF specification recommends testing for it.
  305. 0 string MM\x00\x2a TIFF image data, big-endian
  306. !:strength +70
  307. !:mime image/tiff
  308. !:ext tif/tiff
  309. >(4.L) use \^tiff_ifd
  310. 0 string II\x2a\x00 TIFF image data, little-endian
  311. !:mime image/tiff
  312. !:strength +70
  313. !:ext tif/tiff
  314. >(4.l) use tiff_ifd
  315. 0 name tiff_ifd
  316. >0 uleshort x \b, direntries=%d
  317. >2 use tiff_entry
  318. 0 name tiff_entry
  319. # NewSubFileType
  320. >0 uleshort 0xfe
  321. >>12 use tiff_entry
  322. # Width
  323. >0 uleshort 0x100
  324. >>4 ulelong 1
  325. >>>8 uleshort x \b, width=%d
  326. >>>12 use tiff_entry
  327. # Height
  328. >0 uleshort 0x101
  329. >>4 ulelong 1
  330. >>>8 uleshort x \b, height=%d
  331. >>>12 use tiff_entry
  332. # BPS
  333. >0 uleshort 0x102
  334. >>8 uleshort x \b, bps=%d
  335. >>12 use tiff_entry
  336. # Compression
  337. >0 uleshort 0x103
  338. >>4 ulelong 1 \b, compression=
  339. >>>8 uleshort 1 \bnone
  340. >>>8 uleshort 2 \bhuffman
  341. >>>8 uleshort 3 \bbi-level group 3
  342. >>>8 uleshort 4 \bbi-level group 4
  343. >>>8 uleshort 5 \bLZW
  344. >>>8 uleshort 6 \bJPEG (old)
  345. >>>8 uleshort 7 \bJPEG
  346. >>>8 uleshort 8 \bdeflate
  347. >>>8 uleshort 9 \bJBIG, ITU-T T.85
  348. >>>8 uleshort 0xa \bJBIG, ITU-T T.43
  349. >>>8 uleshort 0x7ffe \bNeXT RLE 2-bit
  350. >>>8 uleshort 0x8005 \bPackBits (Macintosh RLE)
  351. >>>8 uleshort 0x8029 \bThunderscan RLE
  352. >>>8 uleshort 0x807f \bRasterPadding (CT or MP)
  353. >>>8 uleshort 0x8080 \bRLE (Line Work)
  354. >>>8 uleshort 0x8081 \bRLE (High-Res Cont-Tone)
  355. >>>8 uleshort 0x8082 \bRLE (Binary Line Work)
  356. >>>8 uleshort 0x80b2 \bDeflate (PKZIP)
  357. >>>8 uleshort 0x80b3 \bKodak DCS
  358. >>>8 uleshort 0x8765 \bJBIG
  359. >>>8 uleshort 0x8798 \bJPEG2000
  360. >>>8 uleshort 0x8799 \bNikon NEF Compressed
  361. >>>8 default x
  362. >>>>8 uleshort x \b(unknown %#x)
  363. >>>12 use tiff_entry
  364. # Photometric Interpretation
  365. >0 uleshort 0x106 \b, PhotometricInterpretation=
  366. >>8 clear x
  367. >>8 uleshort 0 \bWhiteIsZero
  368. >>8 uleshort 1 \bBlackIsZero
  369. >>8 uleshort 2 \bRGB
  370. >>8 uleshort 3 \bRGB Palette
  371. >>8 uleshort 4 \bTransparency Mask
  372. >>8 uleshort 5 \bCMYK
  373. >>8 uleshort 6 \bYCbCr
  374. >>8 uleshort 8 \bCIELab
  375. >>8 default x
  376. >>>8 uleshort x \b(unknown=%#x)
  377. >>12 use tiff_entry
  378. # FillOrder
  379. >0 uleshort 0x10a
  380. >>4 ulelong 1
  381. >>>12 use tiff_entry
  382. # DocumentName
  383. >0 uleshort 0x10d
  384. >>(8.l) string x \b, name=%s
  385. >>>12 use tiff_entry
  386. # ImageDescription
  387. >0 uleshort 0x10e
  388. >>(8.l) string x \b, description=%s
  389. >>>12 use tiff_entry
  390. # Make
  391. >0 uleshort 0x10f
  392. >>(8.l) string x \b, manufacturer=%s
  393. >>>12 use tiff_entry
  394. # Model
  395. >0 uleshort 0x110
  396. >>(8.l) string x \b, model=%s
  397. >>>12 use tiff_entry
  398. # StripOffsets
  399. >0 uleshort 0x111
  400. >>12 use tiff_entry
  401. # Orientation
  402. >0 uleshort 0x112 \b, orientation=
  403. >>8 uleshort 1 \bupper-left
  404. >>8 uleshort 3 \blower-right
  405. >>8 uleshort 6 \bupper-right
  406. >>8 uleshort 8 \blower-left
  407. >>8 uleshort 9 \bundefined
  408. >>8 default x
  409. >>>8 uleshort x \b[*%d*]
  410. >>12 use tiff_entry
  411. # XResolution
  412. >0 uleshort 0x11a
  413. >>8 ulelong x \b, xresolution=%d
  414. >>12 use tiff_entry
  415. # YResolution
  416. >0 uleshort 0x11b
  417. >>8 ulelong x \b, yresolution=%d
  418. >>12 use tiff_entry
  419. # ResolutionUnit
  420. >0 uleshort 0x128
  421. >>8 uleshort x \b, resolutionunit=%d
  422. >>12 use tiff_entry
  423. # Software
  424. >0 uleshort 0x131
  425. >>(8.l) string x \b, software=%s
  426. >>12 use tiff_entry
  427. # Datetime
  428. >0 uleshort 0x132
  429. >>(8.l) string x \b, datetime=%s
  430. >>12 use tiff_entry
  431. # HostComputer
  432. >0 uleshort 0x13c
  433. >>(8.l) string x \b, hostcomputer=%s
  434. >>12 use tiff_entry
  435. # WhitePoint
  436. >0 uleshort 0x13e
  437. >>12 use tiff_entry
  438. # PrimaryChromaticities
  439. >0 uleshort 0x13f
  440. >>12 use tiff_entry
  441. # YCbCrCoefficients
  442. >0 uleshort 0x211
  443. >>12 use tiff_entry
  444. # YCbCrPositioning
  445. >0 uleshort 0x213
  446. >>12 use tiff_entry
  447. # ReferenceBlackWhite
  448. >0 uleshort 0x214
  449. >>12 use tiff_entry
  450. # Copyright
  451. >0 uleshort 0x8298
  452. >>(8.l) string x \b, copyright=%s
  453. >>12 use tiff_entry
  454. # ExifOffset
  455. >0 uleshort 0x8769
  456. >>12 use tiff_entry
  457. # GPS IFD
  458. >0 uleshort 0x8825 \b, GPS-Data
  459. >>12 use tiff_entry
  460. #>0 uleshort x \b, unknown=%#x
  461. #>>12 use tiff_entry
  462. 0 string MM\x00\x2b Big TIFF image data, big-endian
  463. !:mime image/tiff
  464. 0 string II\x2b\x00 Big TIFF image data, little-endian
  465. !:mime image/tiff
  466. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  467. # (Greg Roelofs, newt@uchicago.edu)
  468. # (Albert Cahalan, acahalan@cs.uml.edu)
  469. #
  470. # 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
  471. #
  472. # IHDR parser
  473. 0 name png-ihdr
  474. >0 ubelong x \b, %d x
  475. >4 ubelong x %d,
  476. >8 ubyte x %d-bit
  477. >9 ubyte 0 grayscale,
  478. >9 ubyte 2 \b/color RGB,
  479. >9 ubyte 3 colormap,
  480. >9 ubyte 4 gray+alpha,
  481. >9 ubyte 6 \b/color RGBA,
  482. #>10 ubyte 0 deflate/32K,
  483. >12 ubyte 0 non-interlaced
  484. >12 ubyte 1 interlaced
  485. # Standard PNG image.
  486. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
  487. !:mime image/png
  488. !:ext png
  489. !:strength +10
  490. >16 use png-ihdr
  491. >33 string \x00\x00\x00\x08acTL \b, animated
  492. >>41 ubelong 1 (%d frame
  493. >>41 ubelong >1 (%d frames
  494. >>45 ubelong 0 \b, infinite repetitions)
  495. >>45 ubelong 1 \b, %d repetition)
  496. >>45 ubelong >1 \b, %d repetitions)
  497. # Apple CgBI PNG image.
  498. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
  499. >24 string \x00\x00\x00\x0DIHDR PNG image data (CgBI)
  500. !:mime image/png
  501. !:ext png
  502. !:strength +10
  503. >>32 use png-ihdr
  504. # possible GIF replacements; none yet released!
  505. # (Greg Roelofs, newt@uchicago.edu)
  506. #
  507. # GRR 950115: this was mine ("Zip GIF"):
  508. 0 string GIF94z ZIF image (GIF+deflate alpha)
  509. !:mime image/x-unknown
  510. #
  511. # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
  512. #
  513. 0 string FGF95a FGF image (GIF+deflate beta)
  514. !:mime image/x-unknown
  515. #
  516. # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
  517. # (best; not yet implemented):
  518. #
  519. 0 string PBF PBF image (deflate compression)
  520. !:mime image/x-unknown
  521. # GIF
  522. # Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
  523. 0 string GIF8 GIF image data
  524. !:strength +80
  525. !:mime image/gif
  526. !:apple 8BIMGIFf
  527. !:ext gif
  528. >4 string 7a \b, version 8%s,
  529. >4 string 9a \b, version 8%s,
  530. >6 uleshort >0 %d x
  531. >8 uleshort >0 %d
  532. #>10 ubyte &0x80 color mapped,
  533. #>10 ubyte&0x07 =0x00 2 colors
  534. #>10 ubyte&0x07 =0x01 4 colors
  535. #>10 ubyte&0x07 =0x02 8 colors
  536. #>10 ubyte&0x07 =0x03 16 colors
  537. #>10 ubyte&0x07 =0x04 32 colors
  538. #>10 ubyte&0x07 =0x05 64 colors
  539. #>10 ubyte&0x07 =0x06 128 colors
  540. #>10 ubyte&0x07 =0x07 256 colors
  541. # URL: http://fileformats.archiveteam.org/wiki/Jeff%27s_Image_Format
  542. # http://web.archive.org/web/20010603113404/http://jeff.cafe.net/jif
  543. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-jif.trid.xml
  544. # https://www.nationalarchives.gov.uk/PRONOM/fmt/994
  545. # From: Joerg Jenderek
  546. # Note: nearly identical to GIF, except that it uses zlib compression instead of LZW
  547. # called by TrID "Jeff's Image Format bitmap" and "Jeffs Image Format" by DROID via fmt/994
  548. # verfied by XnView `nconvert -fullinfo *.jif` as "Jeff's Image Format"
  549. 0 string JIF99a Jeffs Image Format data
  550. !:mime image/x-jif
  551. # http://extension.nirsoft.net/jif
  552. #!:mime image/jif
  553. !:apple ????JIFf
  554. !:ext jif
  555. >6 uleshort x %u x
  556. >8 uleshort x %u
  557. # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
  558. # 1 plane, no encoding.
  559. 0 string \361\0\100\273 CMU window manager raster image data
  560. >4 ulelong >0 %d x
  561. >8 ulelong >0 %d,
  562. >12 ulelong >0 %d-bit
  563. # Magick Image File Format
  564. # URL: https://imagemagick.org/script/miff.php
  565. # Reference: http://fileformats.archiveteam.org/wiki/MIFF
  566. # Update: Joerg Jenderek
  567. # http://www.nationalarchives.gov.uk/pronom/fmt/930
  568. 0 search/256/bc id=imagemagick
  569. # skip bad ASCII text by following new line~0x0A or space~0x20 character
  570. #>&0 ubyte x \b, next character %#x
  571. # called by TriD ImageMagick Machine independent File Format bitmap
  572. >&0 ubyte&0xD5 0 MIFF image data
  573. # https://reposcope.com/mimetype/image/miff
  574. #!:mime image/miff
  575. !:mime image/x-miff
  576. !:ext miff/mif
  577. # examples with standard file(1) magic
  578. #>>0 string =id=ImageMagick with standard magic
  579. # examples with unusual file(1) magic like
  580. >>0 string !id=ImageMagick starting with
  581. # start with comment (brace) like http://samples.fileformat.info/.../AQUARIUM.MIF
  582. >>>0 ubyte =0x7b comment
  583. # skip second character which is often a newline and show comment
  584. >>>>2 string x "%s"
  585. # does not start with comment, probably letters with other case like Id=ImageMagick
  586. # ImageMagick-7.0.9-2/Magick++/demo/smile_anim.miff
  587. >>>0 ubyte !0x7b
  588. >>>>0 string >\0 '%-.14s'
  589. # URL: https://imagemagick.org/
  590. # Reference: https://imagemagick.org/script/magick-vector-graphics.php
  591. # From: Joerg Jenderek
  592. # Note: all white-spaces between commands are ignored
  593. 0 string push
  594. # skip some white spaces
  595. >5 search/3 graphic-context ImageMagick Vector Graphic
  596. # TODO: look for dangerous commands like CVE-2016-3715
  597. #!:mime text/plain
  598. !:mime image/x-mvg
  599. !:ext mvg
  600. # Artisan
  601. 0 long 1123028772 Artisan image data
  602. >4 long 1 \b, rectangular 24-bit
  603. >4 long 2 \b, rectangular 8-bit with colormap
  604. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  605. # FIG (Facility for Interactive Generation of figures), an object-based format
  606. # URL: http://fileformats.archiveteam.org/wiki/Fig
  607. # https://en.wikipedia.org/wiki/Xfig
  608. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/f/fig.trid.xml
  609. # https://web.archive.org/web/20070920204655/http://epb.lbl.gov/xfig/fig-format.html
  610. # Update: Joerg Jenderek
  611. # Note: called "FIG vector drawing" by TrID,
  612. # 4 byte magic is assumed to be always at offset 0 and
  613. # verified by `fig2mpdf -v bootloader.fig && file bootloader.pdf`
  614. #0 search/1/tb #FIG FIG image text
  615. # GRR: with --keep-going option the line above gives duplicate messages
  616. 0 search/1/ts #FIG
  617. >&0 use image-xfig
  618. # binary data variant with non ASCII text characters like Control-A or °C in thermostat.fig
  619. 0 search/1/bs #FIG
  620. >&0 use image-xfig
  621. # display XFIG image describing text, mime type, file name extension and version
  622. 0 name image-xfig
  623. >8 ubyte x FIG image text
  624. #!:mime text/plain
  625. # https://reposcope.com/mimetype/image/x-xfig
  626. !:mime image/x-xfig
  627. !:ext fig
  628. # version string like: 1.4 2.1 3.1 3.2
  629. >5 string x \b, version %.3s
  630. # some times after version text like: "Produced by xfig version 3.2.5-alpha5"
  631. >8 ubyte >0x0D
  632. >>8 string x "%s"
  633. # should be point character (2Eh) of version string according to TrID
  634. #>6 ubyte !0x2E \b, at 6 %#x
  635. # caret character (23h) at the beginning in most or probably all examples
  636. #>0 ubyte !0x23 \b, starting with character %#x
  637. # URL: http://fileformats.archiveteam.org/wiki/DeskMate_Draw
  638. # http://en.wikipedia.org/wiki/Deskmate
  639. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dm-fig.trid.xml
  640. # From: Joerg Jenderek
  641. # Note: called "DeskMate Draw drawing" by TrID
  642. 0 string \x14FIG DeskMate Drawing
  643. #!:mime application/octet-stream
  644. !:mime image/x-deskmate-fig
  645. !:ext fig
  646. # TODO:
  647. # "Cabri 3D Figure" by TrID fig-cabri.trid.xml
  648. # "Playmation Figure" by TrID fig-playmation.trid.xml
  649. # PHIGS
  650. 0 string ARF_BEGARF PHIGS clear text archive
  651. 0 string @(#)SunPHIGS SunPHIGS
  652. # version number follows, in the form m.n
  653. >40 string SunBin binary
  654. >32 string archive archive
  655. # GKS (Graphics Kernel System)
  656. 0 string GKSM GKS Metafile
  657. >24 string SunGKS \b, SunGKS
  658. # CGM image files
  659. # Update: Joerg Jenderek
  660. # URL: http://fileformats.archiveteam.org/wiki/CGM
  661. # https://en.wikipedia.org/wiki/Computer_Graphics_Metafile
  662. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/cgm-ct.trid.xml
  663. # http://standards.iso.org/ittf/PubliclyAvailableStandards/c032381_ISO_IEC_8632-4_1999(E).zip
  664. # Note: called "Computer Graphics Metafile (Clear Text)" by TrID and
  665. # "Computer Graphics Metafile ASCII" by DROID or CGM by XnView
  666. # verified by LibreOffice and partly by XnView `nconvert -info *.CGM`
  667. # According to TrID only letter B and M are always upcased and by DROID often only B is upcased for command BEGIN METAFILE
  668. 0 string/c begmf
  669. # skip SOME DROID fmt-301-signature-id-359.cgm fmt-301-signature-id-361.cgm fmt-302-signature-id-364.cgm
  670. # fmt-302-signature-id-365.cgm x-fmt-142-signature-id-350.cgm x-fmt-142-signature-id-351.cgm
  671. >5 short !0
  672. # skip other versions of DROID fmt-301-signature-id-359.cgm fmt-301-signature-id-361.cgm fmt-302-signature-id-364.cgm
  673. # fmt-302-signature-id-365.cgm x-fmt-142-signature-id-350.cgm x-fmt-142-signature-id-351.cgm
  674. >>5 short !0xABab clear text Computer Graphics Metafile
  675. # https://reposcope.com/mimetype/image/cgm
  676. !:mime image/cgm
  677. !:ext cgm
  678. # SF:NAME like: 'metafile example';
  679. >>>5 string x %s
  680. # look for command METAFILE VERSION (MFVERSION <SOFTSEP> <I:VERSION>)
  681. >>>2 search/128/c mfversion
  682. #>>>>&0 ubyte x SOFTSEP=%#x
  683. # version like: 1 3 4
  684. >>>>&1 ubyte >0x31 \b, version %c
  685. # Summary: Computer Graphics Metafile (binary)
  686. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/cgm-bin.trid.xml
  687. # https://standards.iso.org/ittf/PubliclyAvailableStandards/c032380_ISO_IEC_8632-3_1999(E).zip
  688. # Note: called "Computer Graphics Metafile (binary)" by TrID and DROID or CGM by XnView
  689. # verified by LibreOffice and partly by XnView `nconvert -info *.CGM`
  690. # look for BEGIN METAFILE (element Class 0 and ID 1 and "random" Parameter) that is binary C C C C 0 0 0 0 0 0 1 P P P P P
  691. 0 ubeshort&0xFFe0 0x0020
  692. # skip SOME DROID fmt-303-signature-id-368.cgm fmt-304-signature-id-369.cgm fmt-305-signature-id-370.cgm fmt-306-signature-id-371.cgm
  693. # with containing only 28 bytes
  694. >28 ubyte x
  695. # look for METAFILE VERSION (element class 1 and id 1 and parameter P1 with length 2) that is binary 0 0 0 1 i i i i i i 1 P P P 1 P
  696. # with "low" version; 2nd worst case argentin.cgm with parameter length 56
  697. # worst MS.CGM
  698. #>>2 search/73/b \x10\x22\0 binary Computer Graphics Metafile
  699. >>2 search/128/b \x10\x22\0 binary Computer Graphics Metafile
  700. !:mime image/cgm
  701. !:ext cgm
  702. # metafile 2 byte version number like: 1 (most) 2 3 4
  703. >>>&-1 ubeshort >1 \b, version %u
  704. # length number of 1st parameter octets in range 0 to 30 implies short command
  705. >>>0 ubeshort&0x001F <31 \b, parameter length %u
  706. # length of string like: 8 9 10 11 12 29
  707. #>>>>2 ubyte x \b, %u BYTES (SHORT)
  708. # string like: 'HiJaak 2' 'Example 1' 'sahara.cgm' 'MASTERCLIPS--Art Of Business '
  709. >>>>2 pstring >\0 '%s'
  710. # after 1st short command with even parameter length comes 2nd command like: 1022h 0010h (EAF00010.CGM 'HiJaak 2' FLOPPY2.CGM TIGER.CGM 'B:\TIGER.CGM')
  711. >>>>0 ubeshort&0x0001 =0
  712. >>>>>(2.b+3) ubeshort !0x1022 \b, 2nd command %#4.4x (short even)
  713. # after 1st short command with odd parameter length comes nil padding byte followed 2nd command like: 1022h
  714. >>>>0 ubeshort&0x0001 =1
  715. #>>>>>(2.b+3) ubyte !0 \b, PADDING %#x
  716. >>>>>(2.b+4) ubeshort !0x1022 \b, 2nd command %#4.4x (short odd)
  717. # 11111 binary (decimal 31) in the parameter field indicates that the command is in long-form
  718. >>>0 ubeshort&0x001F =0x1F
  719. # bit 15 is partition flag with 1 for 'not-last' partition and 0 for 'last' partition
  720. >>>>2 ubeshort&0x8000 !0 \b, partition flag %#4.4x
  721. # bits 0 to 14 is parameter list length; the number of following parameter octets; range 0 to 32767
  722. # length of 1st long command parameter like: 53
  723. >>>>2 ubeshort&0x7Fff x \b, parameter length %u (long)
  724. # The two header words are then followed by lenghth of 1st string like: 52
  725. #>>>>4 ubyte x \b, %u BYTES
  726. # string like: 'K:\PROJECTS\GRAPHICS\DWKS3.5\CLIPART\FLAGS\Italy.cgm'
  727. >>>>4 pstring/B x '%s'
  728. # odd long parameter length implies single null padding octet to start command on word boundary
  729. >>>>2 ubeshort&0x0001 =1
  730. # after 1st long command with odd parameter length comes nil padding byte followed by 2nd command like: 1022h
  731. #>>>>>(4.b+5) ubyte !0 \b, PADDING %#x
  732. >>>>>(4.b+6) ubeshort !0x1022 \b, 2nd command %#4.4x (long odd)
  733. # even long parameter length implies next command directly is following
  734. >>>>2 ubeshort&0x0001 =0
  735. # after 1st long command with even parameter length comes 2nd command like: 1022h 0x1054 (MS.CGM)
  736. >>>>>(4.b+5) ubeshort !0x1022 \b, 2nd command %#4.4x (long even)
  737. # look for END METAFILE (element class 0 and id 2 and 0 parameter) that is binary 0 0 0 0 i i i i i 1 i P P P P P
  738. >>>-2 ubeshort !0x0040 \b, NOT_FOUND_END_METAFILE
  739. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  740. 0 string yz MGR bitmap, modern format, 8-bit aligned
  741. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  742. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  743. 0 string yx MGR bitmap, modern format, squeezed
  744. # Fuzzy Bitmap (FBM) images
  745. 0 string %bitmap\0 FBM image data
  746. >30 long 0x31 \b, mono
  747. >30 long 0x33 \b, color
  748. # facsimile data
  749. 1 string PC\ Research,\ Inc group 3 fax data
  750. >29 ubyte 0 \b, normal resolution (204x98 DPI)
  751. >29 ubyte 1 \b, fine resolution (204x196 DPI)
  752. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  753. 0 string Sfff structured fax file
  754. # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
  755. # URL: http://fileformats.archiveteam.org/wiki/Award_BIOS_logo
  756. # Note: verified by XnView command `nconvert -fullinfo *.EPA`
  757. 0 string \x11\x06 Award BIOS Logo, 136 x 84
  758. !:mime image/x-award-bioslogo
  759. !:ext epa
  760. 0 string \x11\x09 Award BIOS Logo, 136 x 126
  761. !:mime image/x-award-bioslogo
  762. !:ext epa
  763. # https://telparia.com/fileFormatSamples/image/epa/IO.EPA
  764. # Note: by bitmap-awbm-v1x1009.trid.xml called "Award BIOS logo bitmap (128x126) (v1)"
  765. # verified by RECOIL `recoil2png -o tmp.png IO.EPA; file tmp.png`
  766. 0 string \x10\x09 Award BIOS Logo, 128 x 126
  767. !:mime image/x-award-bioslogo
  768. !:ext epa
  769. #0 string \x07\x1f BIOS Logo corrupted?
  770. # http://www.blackfiveservices.co.uk/awbmtools.shtml
  771. # http://biosgfx.narod.ru/v3/
  772. # http://biosgfx.narod.ru/abr-2/
  773. 0 string AWBM
  774. # Note: by bitmap-awbm.trid.xml called "Award BIOS logo bitmap (v2)"
  775. >4 uleshort <1981 Award BIOS Logo, version 2
  776. #>4 uleshort <1981 Award BIOS bitmap
  777. !:mime image/x-award-bioslogo2
  778. #!:mime image/x-award-bmp
  779. !:ext epa/bmp
  780. # image width is a multiple of 4
  781. >>4 uleshort&0x0003 0
  782. >>>4 uleshort x \b, %d
  783. >>>6 uleshort x x %d
  784. >>4 uleshort&0x0003 >0 \b,
  785. >>>4 uleshort&0x0003 =1
  786. >>>>4 uleshort x %d+3
  787. >>>4 uleshort&0x0003 =2
  788. >>>>4 uleshort x %d+2
  789. >>>4 uleshort&0x0003 =3
  790. >>>>4 uleshort x %d+1
  791. >>>6 uleshort x x %d
  792. # at offset 8 starts imagedata followed by "RGB " marker
  793. # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
  794. # https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
  795. # 28bitmap_information_header.29
  796. # Note: variant starting direct with DIB header see
  797. # http://fileformats.archiveteam.org/wiki/BMP
  798. # verified by ImageMagick version 6.8.9-8 command `identify *.dib`
  799. 0 uleshort 40
  800. # skip bad samples like GAME by looking for valid number of color planes
  801. >12 uleshort 1 Device independent bitmap graphic
  802. !:mime image/x-ms-bmp
  803. !:apple ????BMPp
  804. !:ext dib
  805. >>4 ulelong x \b, %d x
  806. >>8 ulelong x %d x
  807. >>14 uleshort x %d
  808. # number of color planes (must be 1)
  809. #>>12 uleshort >1 \b, %u color planes
  810. # compression method: 0~no 1~RLE 8-bit/pixel 3~Huffman 1D
  811. #>>16 ulelong 3 \b, Huffman 1D compression
  812. >>16 ulelong >0 \b, %u compression
  813. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  814. >>20 ulelong x \b, image size %u
  815. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  816. >>24 ulelong >0 \b, resolution %d x
  817. >>>28 ulelong x %d px/m
  818. # number of colors in palette, or 0 to default to 2**n
  819. #>>32 ulelong >0 \b, %u colors
  820. # number of important colors used, or 0 when every color is important
  821. >>36 ulelong >0 \b, %u important colors
  822. # From: Joerg Jenderek
  823. # URL: http://fileformats.archiveteam.org/wiki/VBM_(VDC_BitMap)
  824. # Reference: http://csbruce.com/cbm/postings/csc19950906-1.txt
  825. # http://mark0.net/download/triddefs_xml.7z
  826. # defs/b/bitmap-vbm.trid.xml
  827. # defs/b/bitmap-vbm-v3.trid.xml
  828. # Note: called "VDC BitMap" by TrID
  829. # verified by RECOIL `recoil2png -o tmp.png coke_can.vbm; file tmp.png`
  830. # begin with a signature of 'B' 'M' 0xCB, followed by a version byte 2 or 3
  831. # Similar to the unrelated Windows BMP format
  832. # check for VDC bitmap and then display image dimension and version
  833. 0 name bitmap-vbm
  834. >2 ubyte 0xCB VDC bitmap
  835. !:mime image/x-commodore-vbm
  836. # http://recoil.sourceforge.net/formats.html
  837. !:ext bm/vbm
  838. # the VBM format version number: 2 or 3
  839. >>3 ubyte x \b, version %u
  840. # width of the image in Hi/Lo format
  841. >>4 ubeshort x \b, %u
  842. # height of the image
  843. >>6 ubeshort x x %u
  844. # version 3 images have the following additional header information
  845. >>3 ubyte =3
  846. # data-encoding type: 0~uncompressed 1~RLE-compressed
  847. >>>8 ubyte 0 \b, uncompressed
  848. >>>8 ubyte 1 \b, RLE-compressed
  849. # byte code for general RLE repetitions
  850. #>>>9 ubyte x \b, RLE repetition code 0x%x
  851. # reserved := 0
  852. #>>>14 short >0 \b, reserved 0x%x
  853. # length of comment text; 0~no comment text
  854. #>>>16 ubeshort >0 \b, comment length %u
  855. >>>16 pstring/H >0 \b, comment "%s"
  856. #
  857. 0 string BM
  858. # check for magic and version 2 of VDC bitmap or BMP with cbSize=715=CB02
  859. >2 ubeshort 0xCB02
  860. >>6 short =0
  861. >>>0 use bitmap-bmp
  862. # VDC bitmap height or maybe a few OS/2 BMP with nonzero "hotspot coordinates"
  863. >>6 short !0
  864. >>>0 use bitmap-vbm
  865. # check for magic and version 3 of VDC bitmap or BMP with cbSize=971=CB03
  866. >2 ubeshort 0xCB03
  867. # check for reserved value (=0) of VDC bitmap
  868. >>14 short =0
  869. >>>0 use bitmap-vbm
  870. # BMP with cbSize=????03CBh and dib header size != 0
  871. >>14 short !0
  872. >>>0 use bitmap-bmp
  873. # cbSize is size of header or file size of Windows BMP bitmap
  874. >2 default x
  875. >>0 use bitmap-bmp
  876. 0 name bitmap-bmp
  877. >14 ulelong 12 PC bitmap, OS/2 1.x format
  878. !:mime image/bmp
  879. !:ext bmp
  880. >>18 uleshort x \b, %d x
  881. >>20 uleshort x %d
  882. # number of color planes (must be 1)
  883. #>>22 uleshort !1 \b, %u color planes
  884. # number of bits per pixel (color depth); found 4 8
  885. >>24 uleshort x x %d
  886. # x, y coordinates of the hotspot
  887. >>6 uleshort >0 \b, hotspot %ux
  888. >>>8 uleshort x \b%u
  889. # cbSize; size of file or header like 1Ah 228C8h
  890. >>2 ulelong x \b, cbSize %u
  891. #>>2 ulelong x \b, cbSize 0x%8.8x
  892. # offBits; offset to bitmap data like:
  893. >>10 ulelong x \b, bits offset %u
  894. # http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_BMP_2.0 no examples found
  895. >14 ulelong 48 PC bitmap, OS/2 2.x format (DIB header size=48)
  896. >14 ulelong 24 PC bitmap, OS/2 2.x format (DIB header size=24)
  897. # http://entropymine.com/jason/bmpsuite/bmpsuite/q/pal8os2v2-16.bmp
  898. # Note: by bitmap-bmp-v2o.trid.xml called "Windows Bitmap (v2o)"
  899. >14 ulelong 16 PC bitmap, OS/2 2.x format (DIB header size=16)
  900. !:mime image/bmp
  901. !:apple ????BMPp
  902. !:ext bmp
  903. # image width and height fields are unsigned integers for OS/2
  904. >>18 ulelong x \b, %u x
  905. >>22 ulelong x %u
  906. # number of bits per pixel (color depth); found 8
  907. >>28 uleshort >1 x %u
  908. # x, y coordinates of the hotspot
  909. >>6 uleshort >0 \b, hotspot %ux
  910. >>>8 uleshort x \b%u
  911. # number of color planes (must be 1)
  912. #>>26 uleshort >1 \b, %u color planes
  913. # cbSize; size of file like: 241E
  914. >>2 ulelong x \b, cbSize %u
  915. #>>2 ulelong x \b, cbSize 0x%x
  916. # offBits; offset to bitmap data like: 41E
  917. >>10 ulelong x \b, bits offset %u
  918. #>>10 ulelong x \b, bits offset 0x%x
  919. >14 ulelong 64 PC bitmap, OS/2 2.x format
  920. !:mime image/bmp
  921. !:apple ????BMPp
  922. !:ext bmp
  923. # image width and height fields are unsigned integers for OS/2
  924. >>18 ulelong x \b, %u x
  925. >>22 ulelong x %u
  926. # number of bits per pixel (color depth); found 1 4 8
  927. >>28 uleshort >1 x %u
  928. # x, y coordinates of the hotspot
  929. >>6 uleshort >0 \b, hotspot %ux
  930. >>>8 uleshort x \b%u
  931. >>26 uleshort >1 \b, %u color planes
  932. # cbSize; size of file or headers
  933. >>2 ulelong x \b, cbSize %u
  934. # BMP with cbSize 000002CBh=715 or 000003CBh=971 maybe misinterpreted as VDC bitmap
  935. #>>2 ulelong x \b, cbSize %#x
  936. # offBits; offset to bitmap data like 56h 5Eh 8Eh 43Eh
  937. >>10 ulelong x \b, bits offset %u
  938. #>>10 ulelong x \b, bits offset %#x
  939. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  940. # BITMAPV2INFOHEADER adds RGB bit masks
  941. >14 ulelong 52 PC bitmap, Adobe Photoshop
  942. !:mime image/bmp
  943. !:apple ????BMPp
  944. !:ext bmp
  945. >>18 ulelong x \b, %d x
  946. >>22 ulelong x %d x
  947. # number of bits per pixel (color depth); found 16 32
  948. >>28 uleshort x %d
  949. # x, y coordinates of the hotspot; should be zero for Windows variant
  950. >>6 uleshort >0 \b, hotspot %ux
  951. >>>8 uleshort x \b%u
  952. # cbSize; size of file like: 14A 7F42
  953. >>2 ulelong x \b, cbSize %u
  954. #>>2 ulelong x \b, cbSize 0x%x
  955. # offBits; offset to bitmap data like: 42h
  956. >>10 ulelong x \b, bits offset %u
  957. #>>10 ulelong x \b, bits offset 0x%x
  958. # BITMAPV3INFOHEADER adds alpha channel bit mask
  959. >14 ulelong 56 PC bitmap, Adobe Photoshop with alpha channel mask
  960. !:mime image/bmp
  961. !:apple ????BMPp
  962. !:ext bmp
  963. >>18 ulelong x \b, %d x
  964. >>22 ulelong x %d x
  965. # number of bits per pixel (color depth); found 16 32
  966. >>28 uleshort x %d
  967. # x, y coordinates of the hotspot; should be zero for Windows variant
  968. >>6 uleshort >0 \b, hotspot %ux
  969. >>>8 uleshort x \b%u
  970. # cbSize; size of file like: 4E 7F46 131DE 14046h
  971. >>2 ulelong x \b, cbSize %u
  972. #>>2 ulelong x \b, cbSize 0x%x
  973. # offBits; offset to bitmap data like: 46h
  974. >>10 ulelong x \b, bits offset %u
  975. #>>10 ulelong x \b, bits offset 0x%x
  976. >14 ulelong 40
  977. # jump 4 bytes before end of file/header to skip fmt-116-signature-id-118.dib
  978. # broken for large bitmaps
  979. #>>(2.l-4) ulong x PC bitmap, Windows 3.x format
  980. >>14 ulelong 40 PC bitmap, Windows 3.x format
  981. !:mime image/bmp
  982. !:apple ????BMPp
  983. >>>18 ulelong x \b, %d x
  984. >>>22 ulelong x %d
  985. # 320 x 400 https://en.wikipedia.org/wiki/LOGO.SYS
  986. >>>18 ulequad =0x0000019000000140 x
  987. !:ext bmp/sys
  988. >>>18 ulequad !0x0000019000000140
  989. # compression method 2~RLE 4-bit/pixel implies also extension rle
  990. >>>>30 ulelong 2 x
  991. !:ext bmp/rle
  992. # not RLE compressed and not 320x400 dimension
  993. >>>>30 default x
  994. # "small" dimensions like: 14x15 15x16 16x14 16x16 32x32
  995. # https://en.wikipedia.org/wiki/Favicon
  996. >>>>>18 ulequad&0xffFFffC0ffFFffC0 =0 x
  997. # https://www.politi-kdigital.de/favicon.ico
  998. # http://forum.rpc1.org/favicon.ico
  999. !:ext bmp/ico
  1000. # "big" dimensions > 63
  1001. >>>>>18 default x x
  1002. !:ext bmp
  1003. # number of bits per pixel (color depth); found 1 2 4 8 16 24 32
  1004. >>>28 uleshort x %d
  1005. # x, y coordinates of the hotspot; there is no hotspot in bitmaps, so values 0
  1006. #>>>6 uleshort >0 \b, hotspot %ux
  1007. #>>>>8 uleshort x \b%u
  1008. # number of color planes (must be 1), except badplanes.bmp for testing
  1009. #>>>26 uleshort >1 \b, %u color planes
  1010. # compression method: 0~no 1~RLE 8-bit/pixel 2~RLE 4-bit/pixel 3~Huffman 1D 6~RGBA bit field masks
  1011. #>>>30 ulelong 3 \b, Huffman 1D compression
  1012. >>>30 ulelong >0 \b, %u compression
  1013. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  1014. >>>34 ulelong >0 \b, image size %u
  1015. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  1016. >>>38 ulelong >0 \b, resolution %d x
  1017. >>>>42 ulelong x %d px/m
  1018. # number of colors in palette 16 256, or 0 to default to 2**n
  1019. #>>>46 ulelong >0 \b, %u colors
  1020. # number of important colors used, or 0 when every color is important
  1021. >>>50 ulelong >0 \b, %u important colors
  1022. # cbSize; often size of file
  1023. >>>2 ulelong x \b, cbSize %u
  1024. #>>>2 ulelong x \b, cbSize %#x
  1025. # offBits; offset to bitmap data like 36h 76h BEh 236h 406h 436h 4E6h
  1026. >>>10 ulelong x \b, bits offset %u
  1027. #>>>10 ulelong x \b, bits offset %#x
  1028. #>>>(10.l) ubequad !0 \b, bits %#16.16llxd
  1029. >14 ulelong 124 PC bitmap, Windows 98/2000 and newer format
  1030. !:mime image/bmp
  1031. !:ext bmp
  1032. >>18 ulelong x \b, %d x
  1033. >>22 ulelong x %d x
  1034. # color planes; must be 1
  1035. #>>>26 uleshort >1 \b, %u color planes
  1036. # number of bits per pixel (color depth); found 4 8 16 24 32 1 (fmt-119-signature-id-121.bmp) 0 (rgb24jpeg.bmp rgb24png.bmp)
  1037. >>28 uleshort x %d
  1038. # x, y coordinates of the hotspot; should be zero for Windows variant
  1039. >>6 uleshort >0 \b, hotspot %ux
  1040. >>>8 uleshort x \b%u
  1041. # cbSize; size of file like: 8E AA 48A 999 247A 4F02 7F8A 3F88E B216E 1D4C8A 100008A
  1042. >>2 ulelong x \b, cbSize %u
  1043. #>>2 ulelong x \b, cbSize 0x%x
  1044. # offBits; offset to bitmap data like: 8A 47A ABABABAB (fmt-119-signature-id-121.bmp)
  1045. >>10 ulelong x \b, bits offset %u
  1046. #>>10 ulelong x \b, bits offset 0x%x
  1047. >14 ulelong 108 PC bitmap, Windows 95/NT4 and newer format
  1048. !:mime image/bmp
  1049. !:ext bmp
  1050. >>18 ulelong x \b, %d x
  1051. >>22 ulelong x %d x
  1052. # number of bits per pixel (color depth); found 8 24 32
  1053. >>28 uleshort x %d
  1054. # x, y coordinates of the hotspot; should be zero for Windows variant
  1055. >>6 uleshort >0 \b, hotspot %ux
  1056. >>>8 uleshort x \b%u
  1057. # cbSize; size of file like: 82 8A 9A 9F86 1E07A 3007A 88B7A C007A
  1058. >>2 ulelong x \b, cbSize %u
  1059. #>>2 ulelong x \b, cbSize 0x%x
  1060. # offBits; offset to bitmap data like: 7A 7E 46A
  1061. >>10 ulelong x \b, bits offset %u
  1062. #>>10 ulelong x \b, bits offset 0x%x
  1063. # Update: Joerg Jenderek
  1064. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Icon
  1065. # Reference: http://www.fileformat.info
  1066. # /format/os2bmp/spec/902d5c253f2a43ada39c2b81034f27fd/view.htm
  1067. # Note: verified by command like `deark -l -d3 OS2MEMU.ICO`
  1068. 0 string IC
  1069. # skip Lotus smart icon *.smi by looking for valid hotspot coordinates
  1070. >6 ulelong&0xFF00FF00 =0 OS/2 icon
  1071. # jump 4 bytes before end of header/file and test for accessibility
  1072. #>>(2.l-4) ubelong x End of header is OK!
  1073. !:mime image/x-os2-ico
  1074. !:ext ico
  1075. # cbSize; size of header or file in bytes like 1ah 120h 420h
  1076. >>2 ulelong x \b, cbSize %u
  1077. # xHotspot, yHotspot; coordinates of the hotspot for icons like 16 32
  1078. >>6 uleshort x \b, hotspot %ux
  1079. >>8 uleshort x \b%u
  1080. # offBits; offset in bytes to the beginning of the bit-map pel data like 20h
  1081. >>10 ulelong x \b, bits offset %u
  1082. #>>(10.l) ubequad x \b, bits %#16.16llx
  1083. #0 string PI PC pointer image data
  1084. #0 string CI PC color icon data
  1085. 0 string CI
  1086. # test also for valid dib header sizes 12 or 64
  1087. >14 ulelong <65 OS/2
  1088. # test also for valid hotspot coordinates
  1089. #>>6 ulelong&0xFE00FE00 =0 OS/2
  1090. !:mime image/x-os2-ico
  1091. !:ext ico
  1092. >>14 ulelong 12 1.x color icon
  1093. # image width and height fields are unsigned integers for OS/2
  1094. >>>18 uleshort x %u x
  1095. # stored height = 2 * real height
  1096. >>>20 uleshort/2 x %u
  1097. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  1098. >>>24 uleshort >1 x %u
  1099. # color planes; must be 1
  1100. #>>>22 uleshort >1 \b, %u color planes
  1101. >>14 ulelong 64 2.x color icon
  1102. # image width and height
  1103. >>>18 ulelong x %u x
  1104. # stored height = 2 * real height
  1105. >>>22 ulelong/2 x %u
  1106. # number of bits per pixel (color depth). only 1 found
  1107. >>>28 uleshort >1 x %u
  1108. #>>>26 uleshort >1 \b, %u color planes
  1109. # compression method: 0~no 3~Huffman 1D
  1110. >>>30 ulelong 3 \b, Huffman 1D compression
  1111. #>>>30 ulelong >0 \b, %u compression
  1112. # xHotspot, yHotspot; coordinates of the hotspot like 0 1 16 20 32 33 63 64
  1113. >>6 uleshort x \b, hotspot %ux
  1114. >>8 uleshort x \b%u
  1115. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh 84Eh
  1116. >>2 ulelong x \b, cbSize %u
  1117. #>>2 ulelong x \b, cbSize %x
  1118. # offBits; offset to bitmap data (pixel array) like E4h 3Ah 66h 6Ah 33Ah 4A4h
  1119. >>10 ulelong x \b, bits offset %u
  1120. #>>10 ulelong x \b, bits offset %#x
  1121. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  1122. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  1123. #>>14 ulelong x \b, dib header size %u
  1124. #0 string CP PC color pointer image data
  1125. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Pointer
  1126. # Reference: http://www.fileformat.info/format/os2bmp/egff.htm
  1127. 0 string CP
  1128. # skip many Corel Photo-Paint image "CPT9FILE" by checking for positive bits offset
  1129. >10 ulelong >0
  1130. # skip CPU-Z Report by checking for valid dib header sizes 12 or 64
  1131. >>14 ulelong =12
  1132. >>>0 use os2-ptr
  1133. >>14 ulelong =64
  1134. >>>0 use os2-ptr
  1135. # display information of OS/2 pointer bitmaps
  1136. 0 name os2-ptr
  1137. >14 ulelong x OS/2
  1138. # http://extension.nirsoft.net/PTR
  1139. !:mime image/x-ibm-pointer
  1140. !:ext ptr
  1141. >>14 ulelong 12 1.x color pointer
  1142. # image width and height fields are unsigned integers for OS/2
  1143. >>>18 uleshort x %u x
  1144. # stored height = 2 * real height
  1145. >>>20 uleshort/2 x %u
  1146. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  1147. >>>24 uleshort >1 x %u
  1148. # color planes; must be 1
  1149. #>>>22 uleshort >1 \b, %u color planes
  1150. >>14 ulelong 64 2.x color pointer
  1151. # image width and height
  1152. >>>18 ulelong x %u x
  1153. # stored height = 2 * real height
  1154. >>>22 ulelong/2 x %u
  1155. # number of bits per pixel (color depth). only 1 found
  1156. >>>28 uleshort >1 x %u
  1157. #>>>26 uleshort >1 \b, %u color planes
  1158. # compression method: 0~no 3~Huffman 1D
  1159. >>>30 ulelong 3 \b, Huffman 1D compression
  1160. #>>>30 ulelong >0 \b, %u compression
  1161. # xHotspot, yHotspot; coordinates of the hotspot like 0 3 4 8 15 16 23 27 31
  1162. >>6 uleshort x \b, hotspot %ux
  1163. >>8 uleshort x \b%u
  1164. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh
  1165. >>2 ulelong x \b, cbSize %u
  1166. #>>2 ulelong x \b, cbSize %x
  1167. # offBits; offset to bitmap data (pixel array) like 6Ah A4h E4h 4A4h
  1168. >>10 ulelong x \b, bits offset %u
  1169. #>>10 ulelong x \b, bits offset %#x
  1170. #>>(10.l) ubequad !0 \b, bits %#16.16llx
  1171. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  1172. #>>14 ulelong x \b, dib header size %u
  1173. # Type: Vision Research Phantom CINE Format
  1174. # URL: https://www.phantomhighspeed.com/
  1175. # URL2: http://phantomhighspeed.force.com/vriknowledge/servlet/fileField?id=0BEU0000000Cfyk
  1176. # From: Harry Mallon <hjmallon at gmail.com>
  1177. #
  1178. # This has a short "CI" code but the 44 is the size of the struct which is
  1179. # stable
  1180. >2 uleshort 44 Vision Research CINE Video,
  1181. >>4 uleshort 0 Grayscale,
  1182. >>4 uleshort 1 JPEG Compressed,
  1183. >>4 uleshort 2 RAW,
  1184. >>6 uleshort x version %d,
  1185. >>20 ulelong x %d frames,
  1186. >>48 ulelong x %dx
  1187. >>52 ulelong x \b%d
  1188. # Conflicts with other entries [BABYL]
  1189. # URL: http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_Bitmap_Array
  1190. # Note: container for OS/2 icon "IC", color icon "CI", color pointer "CP" or bitmap "BM"
  1191. #0 string BA PC bitmap array data
  1192. 0 string BA
  1193. # skip old Emacs RMAIL BABYL ./mail.news by checking for low header size
  1194. >2 ulelong <0x004c5942 OS/2 graphic array
  1195. !:mime image/x-os2-graphics
  1196. #!:apple ????BMPf
  1197. # cbSize; size of header like 28h 5Ch
  1198. >>2 ulelong x \b, cbSize %u
  1199. #>>2 ulelong x \b, cbSize %#x
  1200. # offNext; offset to data like 0 48h F2h 4Eh 64h C6h D2h D6h DAh E6h EAh 348h
  1201. >>6 ulelong >0 \b, data offset %u
  1202. #>>6 ulelong >0 \b, data offset %#x
  1203. #>>(6.l) ubequad !0 \b, data %#16.16llx
  1204. # dimensions of the intended device like 640 x 480 for VGA or 1024 x 768
  1205. >>10 uleshort >0 \b, display %u
  1206. >>>12 uleshort >0 x %u
  1207. # usType of first array element
  1208. #>>14 string x \b, usType %2.2s
  1209. # 1 space char after "1st"
  1210. # no *.bga examples found https://www.openwith.org/file-extensions/bga/1342
  1211. >>14 string BM \b; 1st
  1212. !:ext bmp/bga
  1213. >>14 string CI \b; 1st
  1214. !:ext ico
  1215. >>14 string CP \b; 1st
  1216. !:ext ico
  1217. >>14 string IC \b; 1st
  1218. !:ext ico
  1219. # no white-black pointer found
  1220. #>>14 string PT \b; 1st
  1221. #!:ext
  1222. >>14 indirect x
  1223. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  1224. # Update: Joerg Jenderek
  1225. # URL: http://fileformats.archiveteam.org/wiki/XPM
  1226. # Reference: http://www.x.org/docs/XPM/xpm.pdf
  1227. # http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-xpm.trid.xml
  1228. # Note: called "X PixMap bitmap" by TrID and "X-Windows Pixmap Image" by DROID via PUID x-fmt/208
  1229. # starting with c comment like: logo.xpm
  1230. 0 string /*\040
  1231. # 9 byte c-comment "/* XPM */" not at the beginning like: mozicon16.xpm mozicon50.xpm (thunderbird)
  1232. >0 search/0xCE /*\ XPM\ */
  1233. # skip DROID x-fmt-208-signature-id-620.xpm by looking for char array without explict length
  1234. # and match mh-logo.xpm (emacs)
  1235. >>&0 search/1249 []
  1236. >>>0 use xpm-image
  1237. # non standard because no 9 byte c-comment "/* XPM */" like: logo.xpm in qemu package
  1238. >0 default x
  1239. # words are separated by a white space which can be composed of space and tabulation characters
  1240. >>0 search/0x52 static\040char\040
  1241. # skip debug.c testmlc.c by looking for char array without explict length
  1242. # https://www.clamav.net/downloads/production/clamav-0.104.2.tar.gz
  1243. # clamav-0.104.2\libclammspack\mspack\debug.c
  1244. >>>&0 search/64 []
  1245. >>>>0 use xpm-image
  1246. # display X pixmap image information
  1247. 0 name xpm-image
  1248. >0 string x X pixmap image text
  1249. #!:mime text/plain
  1250. # https://reposcope.com/mimetype/image/x-xpixmap
  1251. # alias
  1252. #!:mime image/x-xpm
  1253. !:mime image/x-xpixmap
  1254. !:ext xpm
  1255. # NO pm example found!
  1256. #!:ext xpm/pm
  1257. # look for start of character array at beginning of a line like: psetupl.xpm (OpenOffice 4.1.7)
  1258. >0 search/0x406 \n"
  1259. # DEBUG VALUES string
  1260. #>>&0 string x '%s'
  1261. # width with optional white space before like: 16 24 32 48 1280
  1262. >>&0 regex/8 [0-9]{1,5} \b, %s
  1263. # height with white space like: 15 16 17 24 32 48 1024
  1264. >>>&0 regex/8 [0-9]{1,5} x %s
  1265. # number of colors with white space like: 1 2 3 4 5 8 11 14 162 255 but unrelistic 4294967295 by hardcopy tool
  1266. >>>>&0 regex/12 [0-9]{1,9} x %s
  1267. # chars_per_pixel with white space like: 1 2
  1268. >>>>>&0 regex/14 [0-9]{1,2} \b, %s chars/pixel
  1269. # non standard because not starting with 9 byte c-comment "/* XPM */"
  1270. >0 string !/*\ XPM\ */
  1271. >>0 string x \b, 1st line "%s"
  1272. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  1273. 0 uleshort 0xcc52 RLE image data,
  1274. >6 uleshort x %d x
  1275. >8 uleshort x %d
  1276. >2 uleshort >0 \b, lower left corner: %d
  1277. >4 uleshort >0 \b, lower right corner: %d
  1278. >10 ubyte&0x1 =0x1 \b, clear first
  1279. >10 ubyte&0x2 =0x2 \b, no background
  1280. >10 ubyte&0x4 =0x4 \b, alpha channel
  1281. >10 ubyte&0x8 =0x8 \b, comment
  1282. >11 ubyte >0 \b, %d color channels
  1283. >12 ubyte >0 \b, %d bits per pixel
  1284. >13 ubyte >0 \b, %d color map channels
  1285. # image file format (Robert Potter, potter@cs.rochester.edu)
  1286. 0 string Imagefile\ version- iff image data
  1287. # this adds the whole header (inc. version number), informative but longish
  1288. >10 string >\0 %s
  1289. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  1290. 0 ubelong 0x59a66a95 Sun raster image data
  1291. >4 ubelong >0 \b, %d x
  1292. >8 ubelong >0 %d,
  1293. >12 ubelong >0 %d-bit,
  1294. #>16 ubelong >0 %d bytes long,
  1295. >20 ubelong 0 old format,
  1296. #>20 ubelong 1 standard,
  1297. >20 ubelong 2 compressed,
  1298. >20 ubelong 3 RGB,
  1299. >20 ubelong 4 TIFF,
  1300. >20 ubelong 5 IFF,
  1301. >20 ubelong 0xffff reserved for testing,
  1302. >24 ubelong 0 no colormap
  1303. >24 ubelong 1 RGB colormap
  1304. >24 ubelong 2 raw colormap
  1305. #>28 ubelong >0 colormap is %d bytes long
  1306. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1307. #
  1308. # Update: Joerg Jenderek
  1309. # URL: http://fileformats.archiveteam.org/wiki/SGI_(image_file_format)
  1310. # https://en.wikipedia.org/wiki/Silicon_Graphics_Image
  1311. # Reference: https://paulbourke.net/dataformats/sgirgb/sgiversion.html
  1312. # http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-sgi.trid.xml
  1313. # Note: called "Silicon Graphics bitmap (generic)" by TrID,
  1314. # "Silicon Graphics Image" by DROID via PUID x-fmt/140 and shared MIME-info database from freedesktop.org,
  1315. # verfied by ImageMagick `identify -verbose *.sgi` as SGI (Irix RGB image) and
  1316. # verfied by XnView `nconvert -in sgi -info *.sgi` as SGI RGB
  1317. # look for magic number (integer 474=0x01DA) + storage format (0 or 1) + number of bytes per pixel channel (1 or 2)
  1318. # to skip few TeX font metric data (like pxmi.tfm pxmi1.tfm eksfi8a.tfm ./tex) with invalid "high" bytes/pixel (11 12)
  1319. 0 ubelong&0xFFffFEfc 0x01da0000
  1320. # skip DROID x-fmt-140-signature-id-623.bw with invalid "low" dimensions "0 x 0"
  1321. >6 long !0 SGI image data
  1322. #!:mime image/sgi
  1323. !:mime image/x-sgi
  1324. !:apple ????.SGI
  1325. # STORAGE format; allowed values 0~VERBATIM 1~RLE
  1326. #>>2 ubyte 0 \b, verbatim
  1327. >>2 ubyte 1 \b, RLE
  1328. #>>2 ubyte >1 STORAGE=%#x
  1329. # BPC; number of bytes per pixel component; allowed values 1 2
  1330. #>>3 ubyte 1 \b, normal precision
  1331. >>3 ubyte 2 \b, high precision
  1332. #>>3 ubyte x BPC=%#x
  1333. # DIMENSION; allowed values are 1~scanline 2~XSIZExYSIZE 3~XSIZExYSIZExZSIZE
  1334. >>4 ubeshort x \b, %d-D
  1335. # XSIZE; width of image in pixels
  1336. >>6 ubeshort x \b, %d x
  1337. # YSIZE; height of image in pixels
  1338. >>8 ubeshort x %d
  1339. # ZSIZE; number of channels in image; 1~B/W (greyscale) 3~RGB 4~RGB+ALPHA channel
  1340. >>10 ubeshort x \b, %d
  1341. # GRR: avoid
  1342. # Magdir\images, 1347: Warning: Current entry does not yet have a description for adding a EXTENSION type
  1343. >>>10 ubeshort 1 channel
  1344. # GRR: exception https://sembiance.com/fileFormatSamples/image/sgi/greytest.rgb
  1345. !:ext bw
  1346. # no examples found with .int suffix
  1347. #!:ext bw/int
  1348. # no examples found with .inta suffix for black/white+ALPHA channel
  1349. # no examples found with 2 channels
  1350. #>>>10 ubeshort 2 channels
  1351. #!:ext sgi
  1352. >>>10 ubeshort 3 channels
  1353. !:ext rgb/sgi
  1354. >>>10 ubeshort 4 channels
  1355. !:ext rgba/sgi
  1356. >>>10 default x channels
  1357. # no examples found with 5 and more channels
  1358. !:ext sgi
  1359. # IMAGENAME; null terminated ascii string of up to 79 characters
  1360. >>24 string >\0 \b, "%0.80s"
  1361. # PINMIN; minimum pixel value in the image; often 0
  1362. >>12 ubelong !0 \b, %u PINMIN
  1363. # PINMAX; maximum pixel value in the image; often 255
  1364. >>16 ubelong !255 \b, %u PINMAX
  1365. # DUMMY; 4 bytes of data should be set to 0
  1366. >>20 ubelong !0 \b, at 20 %#x
  1367. # COLORMAP; 0~normal 1~DITHEREDobsolete 2~SCREENobsolete 3~COLORMAP
  1368. >>104 ubelong !0 \b, %u COLORMAP
  1369. # DUMMY; 404 bytes should be set to 0 but not always true; makes header exactly 512 bytes
  1370. >>111 ubyte !0 \b, at 111 %#x
  1371. >>113 ubyte !0 \b, at 113 %#x
  1372. >>118 ubeshort !0 \b, at 118 %#4.4x
  1373. >>121 ubyte !0 \b, at 121 %#x
  1374. >>132 ubelong !0 \b, at 132 %#8.8x
  1375. >>135 ubyte !0 \b, at 135 %#x
  1376. >>137 ubequad !0 \b, at 137 %#16.16llx
  1377. 0 string IT01 FIT image data
  1378. >4 ubelong x \b, %d x
  1379. >8 ubelong x %d x
  1380. >12 ubelong x %d
  1381. #
  1382. 0 string IT02 FIT image data
  1383. >4 ubelong x \b, %d x
  1384. >8 ubelong x %d x
  1385. >12 ubelong x %d
  1386. #
  1387. 2048 string PCD_IPI Kodak Photo CD image pack file
  1388. >0xe02 ubyte&0x03 0x00 , landscape mode
  1389. >0xe02 ubyte&0x03 0x01 , portrait mode
  1390. >0xe02 ubyte&0x03 0x02 , landscape mode
  1391. >0xe02 ubyte&0x03 0x03 , portrait mode
  1392. 0 string PCD_OPA Kodak Photo CD overview pack file
  1393. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  1394. # Update: Joerg Jenderek
  1395. # URL: http://fileformats.archiveteam.org/wiki/Flexible_Image_Transport_System
  1396. # https://en.wikipedia.org/wiki/FITS
  1397. # Reference: https://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-fts.trid.xml
  1398. # Note: called "Flexible Image Transport System bitmap" by TrID, GIMP and DROID via PUID x-fmt/383
  1399. # "FITS document" with expanded acronym "Flexible Image Transport System" by shared MIME-info database from freedesktop.org
  1400. # verified as "Flexible Image Transport System" by XnView `nconvert -fullinfo M57.FIT MOON.FTS` ,
  1401. # as "FTS (Flexible Image Transport System)" by ImageMagick command `identify MOON.FTS` ,
  1402. # by NetPBM `fitstopnm M57.FIT | file` ,
  1403. # falsified by `fitsverify M57.FIT MOON.FTS`
  1404. # FITS is the Flexible Image Transport System, the de facto standard for
  1405. # data and image transfer, storage, etc., for the astronomical community.
  1406. # (FITS floating point formats are big-endian.)
  1407. # keyword is a 1- to 8-character, left-justified ASCII string; columns that do not contain data are filled with spaces
  1408. # The assignment indicator (=) always occupies columns nine and ten in the card
  1409. 0 string SIMPLE\ \ =
  1410. # skip DROID x-fmt-383-signature-id-57.fits by check for left padding spaces of 2nd card value
  1411. >89 ubeshort =0x2020 FITS image
  1412. # URL: https://heasarc.gsfc.nasa.gov/fitsio/fpack/
  1413. # Reference: https://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-fz.trid.xml
  1414. # https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/docs/fpackguide.pdf
  1415. # Note: called "Flexible Image Transport System bitmap (compressed)" by TrID
  1416. >>240 search/0x4790/b ZCMPTYPE= data, compression type
  1417. # fz suffix for compressed fits
  1418. !:ext fz
  1419. # Flexible Image Transport System compression value (followed by optional FITS comment) like: NOCOMPRESS GZIP_1 GZIP_2 HCOMPRESS_1 PLIO_1 RICE_1
  1420. #>>>&0 string x COMPRESSION=%0.13s
  1421. >>>&0 regex [A-Z_1-2]{4,11} %s
  1422. # not compressed Flexible Image Transport System with other filename suffix
  1423. >>240 default x data
  1424. !:ext fits/fit/fts
  1425. # five keywords that are required in every FITS file: SIMPLE, BITPIX, NAXIS, NAXISn, and END. EXTEND is also a required keyword if extensions are present in the file
  1426. # required keyword in standard on 3rd card contains integer number of bits used to represent each data value but in 2nd card for M57.FIT
  1427. >>80 search/81/b BITPIX\040\040=
  1428. #>>>&11 string x BIT=%-0.18s
  1429. # this is the number of bits per pixel for image data
  1430. >>>&20 string 8 \b, 8-bit, character or unsigned binary integer
  1431. # few samples with more right positioned values like: M57.FIT
  1432. # GRR: avoid warning: Magdir\images, 1380: Warning: description `, 8-bit, character or unsigned binary integer (too right positioned)' truncated
  1433. >>>&28 string 8 \b, 8-bit, character or unsigned binary integer
  1434. >>>>0 string x (too right positioned)
  1435. # few samples not right justified positioned like: MOON.FTS
  1436. >>>&11 string 8 \b, 8-bit, character or unsigned binary integer
  1437. >>>>0 string x (too left positioned)
  1438. # according to DROID but no examples found
  1439. #>>>&19 string 08 \b, 8-bit, character or unsigned binary integer
  1440. #>>>&19 string +8 \b, 8-bit, character or unsigned binary integer
  1441. >>>&19 string 16 \b, 16-bit, two's complement binary integer
  1442. >>>&18 string \04032 \b, 32-bit, two's complement binary integer
  1443. >>>&18 string -32 \b, 32-bit, floating point, single precision
  1444. >>>&18 string -64 \b, 64-bit, floating point, double precision
  1445. # second 64-bit variant like: blank.fits
  1446. >>>&18 string \04064 \b, 64-bit, two's complement binary integer
  1447. # in standard number of dimensions by keyword NAXIS on 3rd card image but in few cases on 2nd card like: M57.FIT
  1448. >>80 search/81/b NAXIS\040\040\040= \b,
  1449. # before optional comment 31 ASCII charactes left padded with spaces for integer (0-999) of data axis like: 0 (extension no data) 1 (spectrum) 2 (conventional bitmap) 3 (animated bitmap example.fit test.fits) 6 (DDTSUVDATA.fits)
  1450. #>>>>&0 string x NAXIS=%-0.31s
  1451. # single digit 0 implies no data or similar
  1452. >>>&0 search/31/b \0400\040 0 axes
  1453. !:mime application/fits
  1454. # single digit 1 implies one-dimensional entity such as a spectrum or a time series (no example found)
  1455. >>>&-1 search/31/b \0401\040 1 axis
  1456. !:mime application/fits
  1457. #!:mime image/fits
  1458. # single digit 2 implies conventional bitmap
  1459. >>>&0 search/31/b \0402\040 2 axes
  1460. !:mime image/fits
  1461. # single digit 3 implies data cubes of three dimensions (animated bitmap or similar)
  1462. >>>&0 search/31/b \0403\040 3 axes
  1463. !:mime image/fits
  1464. # data cubes more dimensions like: 5 (group.fits) 6 (DDTSUVDATA.fits)
  1465. >>>&0 default x
  1466. >>>>&0 regex/31/s =[0-9]{1,3} %s axis
  1467. !:mime application/fits
  1468. # often NAXIS1 as 4th card but sometimes at higher offset like: 29400 (IUElwp25637mxlo.fits) 20400 (NICMOSn4hk12010_mos.fits)
  1469. >>240 search/29400/bs NAXIS1\040\040= \b,
  1470. # before optional comment 31 ASCII charactes left padded with spaces for first axis like: 192 512 1024 1200 2000 2064 3600 ...
  1471. >>>&9 regex =[0-9]{1,31} %s
  1472. # often NAXIS2 as 5th card but sometimes not existent or at higher offset like: 29120 (IUElwp25637mxlo.fits) 20480 (NICMOSn4hk12010_mos.fits)
  1473. >>>320 search/29120/bs NAXIS2\040\040= x
  1474. # before optional comment 31 ASCII charactes left padded with spaces for second axis like: 2 4 165 512 800 1024 3600 ...
  1475. >>>>&9 regex =[0-9]{1,31} %s
  1476. # not standard cards
  1477. >>80 string !BITPIX\040\040= \b, at 80
  1478. # in M57.FIT like: "NAXIS ="
  1479. >>>80 string x "%-0.9s"
  1480. >>160 string !NAXIS\040\040\040= \b, at 160
  1481. # in M57.FIT like: "BITPIX ="
  1482. >>>160 string x "%-0.9s"
  1483. # other images
  1484. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  1485. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  1486. # stuff.
  1487. #
  1488. 0 ubeshort 0x1010 PEX Binary Archive
  1489. # DICOM medical imaging data
  1490. # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
  1491. # Note: "dcm" is the official file name extension
  1492. # XnView mention also "dc3" and "acr" as file name extension
  1493. 128 string DICM DICOM medical imaging data
  1494. !:mime application/dicom
  1495. !:ext dcm/dicom/dic
  1496. # XWD - X Window Dump file.
  1497. # URL: http://fileformats.archiveteam.org/wiki/XWD
  1498. # Reference: https://wiki.multimedia.cx/index.php?title=XWD
  1499. # http://mark0.net/download/triddefs_xml.7z/defs/x/xdm-x11.trid.xml
  1500. # Note: called "X-Windows Screen Dump (X11)" by TrID and
  1501. # "X-Windows Screen Dump" version X11 by DROID via PUID fmt/483
  1502. # verfied by XnView `nconvert -in xwd -info *`
  1503. # and ImageMagick 6.9.11 `identify -verbose *` as XWD X Windows system window dump
  1504. # and `xwud -in fig41.wxd -dumpheader`
  1505. # As described in /usr/X11R6/include/X11/XWDFile.h
  1506. # used by the xwd program.
  1507. # Bradford Castalia, idaeim, 1/01
  1508. # updated by Adam Buchbinder, 2/09 and Joerg Jenderek, May 2022
  1509. # The following assumes version 7 of the format; the first long is the length
  1510. # of the header, which is at least 25 4-byte longs, and the one at offset 8
  1511. # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  1512. # which is a maximum of 32.
  1513. # Size of the entire file header (bytes) like: 100 104 105 106 107 109 110 113 114 115 118 172
  1514. 0 ubelong >99
  1515. # pixmap_format; Pixmap format; 0~1-bit (XYBitmap) format 1~single-plane (XYPixmap) 2~bitmap with two or more planes (ZPixmap)
  1516. >8 ubelong <3
  1517. # pixmap_depth; Pixmap depth; value 1 - 32
  1518. >>12 ubelong <33
  1519. # file_version; XWD_FILE_VERSION=7
  1520. >>>4 ubelong 7
  1521. # skip DROID fmt-401-signature-id-618.xwd by test for existing border field
  1522. >>>>96 ubelong x X-Window screen dump image data, version X11
  1523. # ./images (version 1.205) labeled the above entry as "XWD X Window Dump image data"
  1524. # https://reposcope.com/mimetype/image/x-xwindowdump
  1525. !:mime image/x-xwindowdump
  1526. #!:ext xwd
  1527. !:ext xwd/dmp
  1528. # https://www.xnview.com/en/image_formats/ NO example with x11 suffix FOUND!
  1529. #!:ext xwd/dmp/x11
  1530. # https://www.nationalarchives.gov.uk/PRONOM/fmt/401 NO example with xdm suffix FOUND!
  1531. #!:ext xwd/dmp/x11/xmd
  1532. # file comment if header > 100; so not in MARBLES.XWD and hardcopy-x-window-v11.xwd
  1533. >>>>>0 ubelong >100
  1534. # comment or windows name
  1535. >>>>>>100 string >\0 \b, "%s"
  1536. # pixmap_width; pixmap width like: 576 800 1014 1280 1419 NOT -1414812757=abABabABh
  1537. >>>>>16 ubelong x \b, %dx
  1538. # pixmap_height; pixmap height like: 449 454 600 704 720 1001 1024 NOT -1414812757=abABabABh
  1539. >>>>>20 ubelong x \b%dx
  1540. # pixmap_depth; pixmap depth
  1541. >>>>>12 ubelong x \b%d
  1542. # XOffset; Bitmap X offset; pixel numbers to ignore at the beginning of each scan-line
  1543. #>>>>>24 ubelong x \b, %u ignore
  1544. # ByteOrder; byte order of image data: 0~least significant byte first 1~most significant byte first
  1545. >>>>>28 ubelong >0 \b, order %u
  1546. # BitmapUnit; bitmap base data size unit in each scan line like: 8 16 32
  1547. #>>>>>32 ubelong x \b, unit %u
  1548. # BitmapBitOrder; bit-order of image data; apparently same as ByteOrder
  1549. #>>>>>36 ubelong x \b, bit order %u
  1550. # BitmapPad; number of padding bits added to each scan line like: 8 16 32
  1551. #>>>>>40 ubelong x \b, pad %u
  1552. # BitsPerPixel; Bits per pixel: 1~StaticGray and GrayScale 2-15~StaticColor and PseudoColor 16,24,32~TrueColor and DirectColor
  1553. #>>>>>44 ubelong x \b, %u bits/pixel
  1554. # BytesPerLine; size of each scan line in bytes
  1555. #>>>>>48 ubelong x \b, %u bytes/line
  1556. # VisualClass; class of the image: 0~StaticGray 1~GrayScale 2~StaticColor 3~PseudoColor 4~TrueColor 5~DirectColor
  1557. #>>>>>52 ubelong x \b, %u Class
  1558. # RedMask; red RGB mask values used by ZPixmaps like: 0 0xff0000
  1559. #>>>>>56 ubelong !0 \b, %#x red
  1560. # GreenMask; green mask like: 0
  1561. #>>>>>60 ubelong !0 \b, %#x green
  1562. # BlueMask; blue mask like: 0 0xff
  1563. #>>>>>64 ubelong !0 \b, %#x blue
  1564. # BitsPerRgb; Size of each color mask in bits like: 0 1 8 24
  1565. #>>>>>68 ubelong x \b, %u bits/RGB
  1566. # NumberOfColors; number of colors in image like: 256 4 2 0 (WHAT DOES THIS MEAN?)
  1567. >>>>>72 ubelong x \b, %u colors
  1568. # ColorMapEntries; number of entries in color map like: 256 16 2 0~no color map
  1569. >>>>>76 ubelong x %u entries
  1570. # WindowWidth; window width
  1571. #>>>>>80 ubelong x \b, %u width
  1572. # WindowHeight; window height
  1573. #>>>>>84 ubelong x \b, %u height
  1574. # WindowX; Window upper left X coordinate like: 0 24 32 80 237 290 422 466 568 (lenna.dmp)
  1575. >>>>>88 ubelong !0 \b, x=%d
  1576. # WindowY; Window upper left Y coordinate like: 0 8 18 26 60 73 107 (fig41.xwd) 128
  1577. >>>>>92 ubelong !0 \b, y=%d
  1578. # WindowBorderWidth; Window border width; apparently pixmap_width=WindowWidth+2*WindowBorderWidth
  1579. # like: 1 (fig41.xwd) 2 (maze.dmp) 3 (lenna.dmp mandrill.dmp)
  1580. >>>>>96 ubelong >0 \b, %u border
  1581. # From: Joerg Jenderek
  1582. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/x/xdm-x10.trid.xml
  1583. # Note: called "X-Windows Screen Dump (X10)" by TrID and
  1584. # "X-Windows Screen Dump" version X10 by DROID via PUID x-fmt/300
  1585. # verfied by XnView `nconvert -in xwd -info *`
  1586. # HeaderSize is the size of the header in bytes; always 40 for X10 variant
  1587. 0 ubelong =0x000000028
  1588. # FileVersion; always 6 for X10 variant
  1589. >4 ubelong =6
  1590. # skip DROID x-fmt-300-signature-id-619.xdm by test existing border field
  1591. >>36 ubeshort x X-Window screen dump image data, version X10
  1592. !:mime image/x-xwindowdump
  1593. !:ext xwd
  1594. # http://www.nationalarchives.gov.uk/pronom/fmt/401 NO example with xdm suffix FOUND!
  1595. #!:ext xwd/xdm
  1596. # PixmapWidth; pixmap width like: 127 1280
  1597. >>>20 ubelong x \b, %d
  1598. # PixmapHeight; pixmap height like: 64 1024
  1599. >>>24 ubelong x \bx%d
  1600. # DisplayPlanes; number of display planes like: 1 4 8
  1601. >>>12 ubelong x \bx%u
  1602. # DisplayType; display type like: 1 3
  1603. #>>>8 ubelong x \b, type %u
  1604. # PixmapFormat; pixmap format like: 1~bitmap with two or more planes (ZPixmap) 0~single-plane bitmap (XYBitmap)
  1605. #>>>16 ubelong x \b, %u format
  1606. # WindowWidth; window width; probably PixmapWidth=WindowWidth+2*WindowBorderWidth
  1607. #>>>28 ubeshort x \b, width %u
  1608. # WindowHeight; window height; probably PixmapWidth=PixmapHeight+2*WindowBorderWidth
  1609. #>>>30 ubeshort x \b, height %u
  1610. # WindowX; window upper left X coordinate like: 0
  1611. >>>32 ubeshort !0 \b, x=%d
  1612. # WindowY; window upper left Y coordinate like: 0
  1613. >>>34 ubeshort !0 \b, y=%d
  1614. # WindowBorderWidth; window border width like: 0
  1615. >>>36 ubeshort !0 \b, %u border
  1616. # WindowNumColors; Number of color entries in window like: 2 16 256
  1617. #>>>38 ubeshort x \b, %u colors
  1618. # if the image is a PseudoColor image, a color map immediately follows the header. X10COLORMAP[WindowNumColors];
  1619. # EntryNumber; number of the color-map entry like: 0
  1620. #>>>40 ubeshort x \b, colors #%u
  1621. # Red; red-channel value
  1622. #>>>42 ubeshort !0 \b, red %#x
  1623. # Green; green-channel value
  1624. #>>>44 ubeshort !0 \b, green %#x
  1625. # Blue; blue-channel value
  1626. #>>>46 ubeshort !0 \b, blue %#x
  1627. # 2ND Entry like: 2
  1628. #>>>48 ubeshort x \b, colors #%u
  1629. # PDS - Planetary Data System
  1630. # These files use Parameter Value Language in the header section.
  1631. # Unfortunately, there is no certain magic, but the following
  1632. # strings have been found to be most likely.
  1633. 0 string NJPL1I00 PDS (JPL) image data
  1634. 2 string NJPL1I PDS (JPL) image data
  1635. 0 string CCSD3ZF PDS (CCSD) image data
  1636. 2 string CCSD3Z PDS (CCSD) image data
  1637. 0 string PDS_ PDS image data
  1638. 0 string LBLSIZE= PDS (VICAR) image data
  1639. # pM8x: ATARI STAD compressed bitmap format
  1640. #
  1641. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  1642. # p M 8 5/6 xx yy zz data...
  1643. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  1644. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  1645. # most frequent byte, xx and zz are runlength escape codes, where xx is
  1646. # used for runs of yy.
  1647. #
  1648. 0 string pM85 Atari ST STAD bitmap image data (hor)
  1649. >5 ubyte 0x00 (white background)
  1650. >5 ubyte 0xFF (black background)
  1651. 0 string pM86 Atari ST STAD bitmap image data (vert)
  1652. >5 ubyte 0x00 (white background)
  1653. >5 ubyte 0xFF (black background)
  1654. # From: Alex Myczko <alex@aiei.ch>
  1655. # https://www.atarimax.com/jindroush.atari.org/afmtatr.html
  1656. 0 uleshort 0x0296 Atari ATR image
  1657. # URL: http://fileformats.archiveteam.org/wiki/DEGAS_image
  1658. # Reference: https://wiki.multimedia.cx/index.php?title=Degas
  1659. # From: Joerg Jenderek
  1660. # http://mark0.net/download/triddefs_xml.7z/defs/b
  1661. # bitmap-pi2-degas.trid.xml bitmap-pi3-degas.trid.xml
  1662. # bitmap-pc1-degas.trid.xml bitmap-pc2-degas.trid.xml bitmap-pc3-degas.trid.xml
  1663. # Note: verified by NetPBM `pi3topbm sigirl1.pi3 | file`
  1664. # `deark -m degas -l -d2 ataribak.pi1`
  1665. # XnView `nconvert -fullinfo *.p??`
  1666. # DEGAS low-res uncompressed bitmap *.pi1
  1667. 0 beshort 0x0000
  1668. # skip some ISO 9660 CD-ROM filesystems like plpbt.iso by test for 4 non black colors in palette entries
  1669. >2 quad !0
  1670. # skip g3test.g3 by test for unused bits of 2nd color entry
  1671. >>4 ubeshort&0xF000 0
  1672. #>>>0 beshort x 1ST_VALUE=%x
  1673. #>>>-0 offset x FILE_SIZE=%lld
  1674. # standard DEGAS low-res uncompressed bitmap *.pi1 with file size 32034
  1675. >>>-0 offset =32034
  1676. #>>>>0 beshort x 1st_VALUE=%x
  1677. # like: 8ball.pi1 teddy.pi1 sonic01.pi1
  1678. >>>>0 use degas-bitmap
  1679. # about 61 DEGAS Elite low-res uncompressed bitmap *.pi1 with file size 32066
  1680. >>>-0 offset =32066
  1681. # like: spider.pi1 pinkgirl.pi1 frog3.pi1
  1682. >>>>0 use degas-bitmap
  1683. # about 55 DEGAS Elite low-res uncompressed bitmap *.pi1 with file size 32128
  1684. >>>-0 offset =32128
  1685. # like: mountain.pi1 bigspid.pi1 alf33.pi1
  1686. >>>>0 use degas-bitmap
  1687. # 1 DEGAS Elite low-res uncompressed bitmap *.pi1 with file size 44834
  1688. >>>-0 offset =44834
  1689. # like: kenshin.pi1
  1690. >>>>0 use degas-bitmap
  1691. # DEGAS mid-res uncompressed bitmap *.pi2 (strength=50) after GEM Images like:
  1692. # BEETHVEN.IMG CHURCH.IMG GAMEOVR4.IMG TURKEY.IMG clinton.img
  1693. 0 beshort 0x0001
  1694. #!:strength +0
  1695. # skip many control files like gnucash-4.8.setup.exe.aria2 by test for non black in 4 palette entries
  1696. >2 quad !0
  1697. # skip control file load-v0001.aria2 and many GEM Image data like
  1698. # GAMEOVR4.IMG BEETHVEN.IMG CHURCH.IMG TURKEY.IMG clinton.img
  1699. # by test for valid file sizes
  1700. # standard DEGAS mid-res uncompressed bitmap *.pi2 with file size 32034
  1701. >>-0 offset =32034
  1702. # (39/41) like: GEMINI03.PI2 ST_TOOLS.PI2 TBX_DEMO.PI2
  1703. >>>0 use degas-bitmap
  1704. # few DEGAS Elite mid-res uncompressed bitmap *.pi2 with file size 32066
  1705. >>-0 offset =32066
  1706. # (2/41) like: medres.pi2
  1707. >>>0 use degas-bitmap
  1708. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  1709. # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
  1710. # Update: Joerg Jenderek
  1711. # See http://fileformats.archiveteam.org/wiki/GEM_Raster
  1712. # For variations, also see:
  1713. # https://www.seasip.info/Gem/ff_img.html (Ventura)
  1714. # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
  1715. # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
  1716. # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
  1717. # header_size
  1718. >2 beshort 0x0008
  1719. >>0 use gem_info
  1720. >2 beshort 0x0009
  1721. >>0 use gem_info
  1722. # no example for NOSIG
  1723. >2 beshort 24
  1724. >>0 use gem_info
  1725. # no example for HYPERPAINT
  1726. >2 beshort 25
  1727. >>0 use gem_info
  1728. 16 string XIMG\0
  1729. >0 use gem_info
  1730. # no example
  1731. 16 string STTT\0\x10
  1732. >0 use gem_info
  1733. # no example or description
  1734. 16 string TIMG\0
  1735. >0 use gem_info
  1736. # DEGAS high-res uncompressed bitmap *.pi3
  1737. 0 beshort 0x0002
  1738. # skip Intel ia64 COFF msvcrt.lib by test for unused bits of 1st atari color palette entry
  1739. >2 ubeshort&0xF000 0
  1740. # skip few Adobe PhotoShop Brushes like Faux-Spitzen.abr by check
  1741. # for invalid Adobe PhotoShop Brush UTF16-LE string length
  1742. >>19 ubyte =0
  1743. # many like: 4th_ofj2.pi3 GEMINI03.PI3 PEOPLE18.PI3 POWERFIX.PI3 abydos.pi3 highres.pi3 sigirl1.pi3 vanna5.pi3
  1744. >>>0 use degas-bitmap
  1745. # Adobe PhotoShop Brush UTF16-LE string length 15 "Gitter - klein " 8 "Kreis 1 "
  1746. >>19 ubyte !0
  1747. #>>19 ubyte !0 \b, NOTE LENGTH %u
  1748. #>>>21 lestring16 x \b, BRUSH NOTE "%s"
  1749. >>>(19.b*2) ubequad x
  1750. # maybe last character of Adobe PhotoShop Brush UTF16-LE string and terminating nul char like
  1751. # 006e0000 for n in "Faux-Spitzen.abr" 00310000 for 1 in "Verschiedene Spitzen.abr"
  1752. # 00000000 "LEREDACT.PI3" 03730773 "TBX_DEMO.PI3"
  1753. #>>>>&8 ubelong x \b, LAST CHAR+NIL %8.8x
  1754. >>>>&8 ubelong&0xff00ffFF !0
  1755. # skip many Adobe Photoshop Color swatch (ANPA-Farben.aco TOYO-Farbsystem.aco) with invalid 3rd color entry (1319 2201 2206 21f5 2480 24db 25fd)
  1756. >>>>>6 ubeshort&0xF000 0
  1757. # skip few Adobe Photoshop Color swatch (FOCOLTONE-Farben.aco "PANTONE process coated.aco") with invalid 4th color entry (ffff)
  1758. >>>>>>8 ubeshort&0xF000 0
  1759. # many DEGAS bitmap like: ARABDEMO.PI3 ELMRSESN.PI3 GEMVIEW.PI3 LEREDACT.PI3 PICCOLO.PI3 REPRO_JR.PI3 ST_TOOLS.PI3 TBX_DEMO.PI3 evgem7.pi3
  1760. >>>>>>>0 use degas-bitmap
  1761. # test for last character of Adobe PhotoShop Brush UTF16-LE string and terminating nul char
  1762. >>>>&8 ubelong&0xff00ffFF =0
  1763. # select last DEGAS bitmaps by invalid last char of brush note like BASICNES.PI3 DB_HELP.PI3 DB_WRITR.PI3 LEREDACT.PI3
  1764. >>>>>&-4 ubelong&0x00FF0000 <0x00200000
  1765. >>>>>>0 use degas-bitmap
  1766. # last character of Adobe PhotoShop Brush UTF16-LE note
  1767. #>>>>>&-4 ubelong&0x00FF0000 >0x001F0000 \b, THAT IS ABR
  1768. # DEGAS low-res compressed bitmap *.pc1 like: BATTLSHP.PC1 GNUCHESS.PC1 MEDUSABL.PC1 MOONLORD.PC1 WILDROSE.PC1
  1769. 0 beshort 0x8000
  1770. # skip lif files handled via ./lif by test for unused bits of 1st palette entry
  1771. >2 ubeshort&0xF000 0
  1772. # skip CRI ADX ADPCM audio (R04HT.adx R03T-15552.adx) with 44100 Hz misinterpreted as 5th color entry value AC44h
  1773. >>10 ubeshort&0xF000 0
  1774. # skip few (fmt-840-signature-id-1195.adx fmt-840-signature-id-1199.adx) by test for 4 first non black colors in palette entries
  1775. >>>2 quad !0
  1776. >>>>0 use degas-bitmap
  1777. # DEGAS mid-res compressed bitmap *.pc2 like: abydos.pc2 ARTIS3.PC2 SMTHDRAW.PC2 STAR_2K.PC2 TX2_DEMO.PC2
  1778. 0 beshort 0x8001
  1779. # skip many (1274/1369) PostScript Type 1 font (DarkGardenMK.pfb coupbi.pfb MONOBOLD.PFB) with invalid 1st atari color palette entry 5506 5b06 6906 7906 7e06 fb15
  1780. >2 ubeshort&0xF000 0
  1781. # skip some (95/1369) PostScript Type 1 font (fmt-525-signature-id-816.pfb LUXEMBRG.PFB) with invalid 3rd atari color palette entry 2521
  1782. >>6 ubeshort&0xF000 0
  1783. >>>0 use degas-bitmap
  1784. # DEGAS high-res compressed bitmap *.pc3 like: abydos.pc3 COYOTE.PC3 ELEPHANT.PC3 TX2_DEMO.PC3 SMTHDRAW.PC3
  1785. 0 beshort 0x8002
  1786. # skip some (36/212) Python Pickle (factor_cache.pickle environment.pickle) with invalid 1st atari color entry (2863 6363 7d71)
  1787. >2 ubeshort&0xF000 0
  1788. >>0 use degas-bitmap
  1789. # display information of Atari DEGAS and DEGAS Elite bitmap images
  1790. 0 name degas-bitmap
  1791. >0 ubyte x Atari DEGAS
  1792. #!:mime application/octet-stream
  1793. !:mime image/x-atari-degas
  1794. # compressed
  1795. >0 ubyte =0x80 Elite compressed
  1796. # uncompressed
  1797. #>0 ubyte =0x00 uncompressed
  1798. #>0 ubyte =0x00 un.
  1799. >0 ubyte =0x00
  1800. # check for existence of footer for DEGAS Elite images
  1801. >>32042 ubequad x Elite
  1802. >0 beshort 0x0000 bitmap
  1803. !:ext pi1
  1804. >0 beshort 0x0001 bitmap
  1805. !:ext pi2
  1806. >0 beshort 0x0002 bitmap
  1807. # no example with SUH extension found
  1808. #!:ext pi3/suh
  1809. !:ext pi3
  1810. >0 beshort 0x8000 bitmap
  1811. !:ext pc1
  1812. >0 beshort 0x8001 bitmap
  1813. !:ext pc2
  1814. >0 beshort 0x8002 bitmap
  1815. !:ext pc3
  1816. # low resolution; 320x200, 16 colors
  1817. >1 ubyte =0 320 x 200 x 16
  1818. # medium resolution; 640x200, 4 colors
  1819. >1 ubyte =1 640 x 200 x 4
  1820. # high resolution; 640x400, 2 colors
  1821. >1 ubyte =2 640 x 400 x 2
  1822. # http://fileformats.archiveteam.org/wiki/Atari_ST_color_palette
  1823. # hardware_palette[16]; 9 bit ?????RRR?GGG?BBB; 12 bit ????RRRRGGGGBBBB for Atari STE
  1824. # for Atari DEGAS apparently no Spectrum 512 Enhanced 15 bit palette RGB?RRRRGGGGBBBB
  1825. # Red Green Blue unused bit ? often 0 but not bilboule.pi1; color_value (examples or numbers)
  1826. # 1st color palette entry like: 0777 (61) 0fff (LEREDACT.PI3) 0fcf (devgem7.pi3) 0001 (9)
  1827. >2 ubeshort x \b, color palette %4.4x
  1828. # 2nd palette entry like: 0000 (32) 0700 (38) 0f00 (LEREDACT.PI3 devgem7.pi3)
  1829. >4 ubeshort x %4.4x
  1830. # 3rd palette entry
  1831. >6 ubeshort x %4.4x
  1832. # 4th palette entry like: 0000 (72)
  1833. >8 ubeshort x %4.4x
  1834. # 5th palette entry
  1835. >10 ubeshort x %4.4x
  1836. >2 ubeshort x ...
  1837. # 6th palette entry
  1838. #>12 ubeshort x %4.4x
  1839. # 7th palette entry like: 0000 (16) 0001 (ELMRSESN.PI3 elmrsesn.pi3) 0070 (51) 00f0 (BASICNES.PI3 LEREDACT.PI3) 00f8 (devgem7.pi3)
  1840. #>14 ubeshort x %4.4x
  1841. # 8th palette entry
  1842. #>16 ubeshort x %4.4x
  1843. # 9 palette entry
  1844. #>18 ubeshort x %4.4x
  1845. # 10 palette entry
  1846. #>20 ubeshort x %4.4x
  1847. # 11 palette entry
  1848. #>22 ubeshort x %4.4x
  1849. # 12 palette entry
  1850. #>24 ubeshort x %4.4x
  1851. # 13 palette entry
  1852. #>26 ubeshort x %4.4x
  1853. # 14th palette entry
  1854. #>28 ubeshort x %4.4x
  1855. # 15th palette entry
  1856. #>30 ubeshort x %4.4x
  1857. # 16th palette entry
  1858. #>32 ubeshort x %4.4x
  1859. # data[16000] for uncompressed images; pixel data
  1860. #>34 ubequad x \b, DATA %#16.16llx...
  1861. # footer for Elite variant images
  1862. # https://www.fileformat.info/format/atari/egff.htm
  1863. # https://pulkomandy.tk/projects/GrafX2/wiki/Develop/FileFormats/Atari
  1864. # left_color_animation[4]; like: 0000000000000000 0000000100020003 fffafff000000030 (bigspid.pi1)
  1865. #>32034 ubequad !0 \b, color animations %16.16llx (left)
  1866. # right_color_animation[4]; like: 0000000000000000 0000000100020003
  1867. #>>32042 ubequad !0 %16.16llx (right)
  1868. # channel_direction[4]; 0~left 1~none 2~right like: 0001000100010001 0002000000010001 (cycle2.pi1)
  1869. # sometimes unexpected like: feaafc0000000000 (bigspid.pi1)
  1870. #>32050 ubequad !0 \b, channel directions %16.16llx
  1871. # channel_delay[4]; 128 - channel delay, timebase 1/60 s
  1872. #>32058 ubequad !0 \b, channel delays %16.16llx
  1873. # From: Joerg Jenderek
  1874. # URL: http://fileformats.archiveteam.org/wiki/GED
  1875. # https://recoil.sourceforge.net/formats.html#Atari-8-bit
  1876. # Reference: https://sourceforge.net/projects/recoil/files/recoil/6.3.4/recoil-6.3.4.tar.gz
  1877. # recoil-6.3.4/recoil.c
  1878. # http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-ged.trid.xml
  1879. # Note: called "Atari GED bitmap" by TrID; file size 11302
  1880. # and verified by RECOIL graphic tool
  1881. 0 string \xFF\xFF0SO\x7F Atari GED bitmap, 160x200
  1882. #!:mime application/octet-stream
  1883. !:mime image/x-atari-ged
  1884. !:ext ged
  1885. # From: Joerg Jenderek
  1886. # URL: http://fileformats.archiveteam.org/wiki/ImageLab/PrintTechnic
  1887. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-b_w.trid.xml
  1888. # Note: called "ImageLab bitmap" by TrID
  1889. # verfied by XnView `nconvert -fullinfo "MAEDCHEN.B&W"`
  1890. 0 string B&W256 ImageLab bitmap
  1891. !:mime image/x-ilab
  1892. # https://www.xnview.com/de/image_formats/
  1893. # GRR: add char & inside parse_ext in ../../src/apprentice.c to avoid in file version 5.40 error like:
  1894. # Magdir\images, 1090: Warning: EXTENSION type ` b_w/b&w' has bad char '&'
  1895. !:ext b_w/b&w
  1896. # Width
  1897. >6 ubeshort x \b, %u
  1898. # Height
  1899. >8 ubeshort x x %u
  1900. # XXX:
  1901. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  1902. # magic.
  1903. # SGI RICE image file <mpruett@sgi.com>
  1904. #0 ubeshort 0x5249 RICE image
  1905. #>2 ubeshort x v%d
  1906. #>4 ubeshort x (%d x
  1907. #>6 ubeshort x %d)
  1908. #>8 ubeshort 0 8 bit
  1909. #>8 ubeshort 1 10 bit
  1910. #>8 ubeshort 2 12 bit
  1911. #>8 ubeshort 3 13 bit
  1912. #>10 ubeshort 0 4:2:2
  1913. #>10 ubeshort 1 4:2:2:4
  1914. #>10 ubeshort 2 4:4:4
  1915. #>10 ubeshort 3 4:4:4:4
  1916. #>12 ubeshort 1 RGB
  1917. #>12 ubeshort 2 CCIR601
  1918. #>12 ubeshort 3 RP175
  1919. #>12 ubeshort 4 YUV
  1920. # PCX image files
  1921. # From: Dan Fandrich <dan@coneharvesters.com>
  1922. # updated by Joerg Jenderek at Feb 2013, Nov 2023 by https://en.wikipedia.org/wiki/PCX
  1923. # https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
  1924. # URL: http://fileformats.archiveteam.org/wiki/PCX
  1925. # Note: called "PCX image" with acronym "PiCture eXchange" by shared MIME-info database from freedesktop.org
  1926. # verfied partly as pcx "Zsoft Paintbrush" format by XnView `nconvert -in pcx -fullinfo *.pcx` and
  1927. # by ImageMagick version 7.1.1-21 command `identify *.pcx`
  1928. # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
  1929. # test for bytes 0x0a,version byte (0,2,3,4,5),compression byte flag(0,1), bit depth (>0) of PCX or T5.DBT,T6.DBT
  1930. 0 ubelong&0xffF8fe00 0x0a000000
  1931. # for PCX bit depth > 0
  1932. >3 ubyte >0
  1933. # test for valid versions
  1934. >>1 ubyte <6
  1935. >>>1 ubyte !1
  1936. # skip DROID fmt-89-signature-id-62.pcx fmt-88-signature-id-63.pcx fmt-87-signature-id-64.pcx fmt-86-signature-id-65.pcx with invalid dimensions
  1937. >>>>8 long !0 PCX
  1938. !:mime image/vnd.zbrush.pcx
  1939. # deprecated
  1940. #!:mime image/x-pcx
  1941. !:ext pcx/pcc
  1942. # also examples like: abydos.st E-DIODE.ST MUSIC-13.ST ROSE.ST
  1943. #!:ext pcx/pcc/st
  1944. # Note: called as "PCX bitmap (v2.5)" by TrID via bitmap-pcx.trid.xml and "PCX" version 0 by DROID via PUID fmt/86
  1945. >>>>>1 ubyte 0 ver. 2.5 image data
  1946. # Note: called as "PCX bitmap (v2.8, palette)" by TrID via bitmap-pcx-v28p.trid.xml and "PCX" version 2 by DROID via PUID fmt/87
  1947. >>>>>1 ubyte 2 ver. 2.8 image data, with palette
  1948. # Note: called as "PCX bitmap (v2.8)" by TrID via bitmap-pcx-v28.trid.xml and "PCX" version 3 by DROID via PUID fmt/88
  1949. >>>>>1 ubyte 3 ver. 2.8 image data, without palette
  1950. # Note: called as "PCX bitmap (Win)" by TrID via bitmap-pcx-win.trid.xml and "PCX" version 4 by DROID via PUID fmt/89
  1951. >>>>>1 ubyte 4 for Windows image data
  1952. # Note: called as "PCX bitmap (v3.0) by TrID via bitmap-pcx-v30.trid.xml and "PCX" version 5 by DROID via PUID fmt/90
  1953. >>>>>1 ubyte 5 ver. 3.0 image data
  1954. >>>>>4 uleshort x bounding box [%d,
  1955. >>>>>6 uleshort x %d] -
  1956. >>>>>8 uleshort x [%d,
  1957. >>>>>10 uleshort x %d],
  1958. >>>>>65 ubyte >1 %d planes each of
  1959. >>>>>3 ubyte x %d-bit
  1960. >>>>>68 ubyte 1 colour,
  1961. >>>>>68 ubyte 2 grayscale,
  1962. # this should not happen
  1963. >>>>>68 default x image,
  1964. >>>>>12 uleshort >0 %d x
  1965. >>>>>>14 uleshort x %d dpi,
  1966. >>>>>2 ubyte 0 uncompressed
  1967. >>>>>2 ubyte 1 RLE compressed
  1968. # Adobe Photoshop
  1969. # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
  1970. # URL: http://fileformats.archiveteam.org/wiki/PSD
  1971. # Reference: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
  1972. # Note: verfied by XnView `nconvert -fullinfo *.psd *.psb *.pdd`
  1973. # and ImageMagick `identify -verbose *.pdd`
  1974. 0 string 8BPS
  1975. # skip DROID x-fmt-92-signature-id-277.psd by checking valid width
  1976. >18 ubelong >0 Adobe Photoshop
  1977. !:mime image/vnd.adobe.photoshop
  1978. !:apple ????8BPS
  1979. # version: always equal to 1, but 2 for PSB
  1980. >>4 beshort 1
  1981. # URL: http://fileformats.archiveteam.org/wiki/PhotoDeluxe
  1982. # EXTRAS/PHOTOS/DEMOPIX/ORIGINAL.PDD
  1983. >>>34 search/0xC0d7 PHUT Image (PhotoDeluxe)
  1984. !:ext pdd
  1985. >>>34 default x Image
  1986. !:ext psd
  1987. # URL: http://fileformats.archiveteam.org/wiki/PSB
  1988. >>4 beshort 2 Image (PSB)
  1989. !:ext psb
  1990. # width in pixels: 1-30000 1-300000 for PSB
  1991. >>18 belong x \b, %d x
  1992. >>14 belong x %d,
  1993. # The color mode; 0~Bitmap 1~Grayscale 2~Indexed 3~RGB 4~CMYK 7~Multichannel 9~Duotone 9~Lab
  1994. >>24 beshort 0 bitmap
  1995. >>24 beshort 1 grayscale
  1996. # the number of channels; range is 1 to 56
  1997. >>>12 beshort 2 with alpha
  1998. >>24 beshort 2 indexed
  1999. >>24 beshort 3 RGB
  2000. >>>12 beshort 4 \bA
  2001. >>24 beshort 4 CMYK
  2002. >>>12 beshort 5 \bA
  2003. >>24 beshort 7 multichannel
  2004. >>24 beshort 8 duotone
  2005. >>24 beshort 9 lab
  2006. >>12 beshort > 1
  2007. >>>12 beshort x \b, %dx
  2008. >>12 beshort 1 \b,
  2009. >>22 beshort x %d-bit channel
  2010. >>12 beshort > 1 \bs
  2011. # 6 reserved bytes; must be zero, but spaces inside ImageMagick input.psd
  2012. # https://download.imagemagick.org/ImageMagick/download/ImageMagick-7.0.11-11.zip
  2013. # ImageMagick-7.0.11-11\PerlMagick\t\input.psd
  2014. >>6 bequad&0xFFffFFffFFff0000 !0 \b, at offset 6
  2015. >>>6 belong x 0x%8.8x
  2016. >>>6 beshort x \b%4.4x
  2017. # From: Joerg Jenderek
  2018. # URL: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
  2019. # http://fileformats.archiveteam.org/wiki/Photoshop
  2020. # Reference: http://www.nomodes.com/aco.html
  2021. # Note: registers as Photoshop.SwatchesFile for Photoshop.exe on Windows
  2022. # check for valid versions like: 2 (newest) 1 (old) 0 (oldest no examples)
  2023. 0 ubeshort <3
  2024. # skip few Atari DEGAS med-res bitmap (DIAGRAM1.PI2) and many ISO 9660 CD-ROM by check for invalid low color numbers (0)
  2025. >2 ubeshort >0
  2026. # skip few Targa (bmpsuite-15col.tga rgb24_top_left_colormap.tga) by check for invalid high color space ID (F0 1D)
  2027. >>4 ubeshort <16
  2028. # skip many (69/327) Targa image *.TGA by check of accessing near the ending of first color space section (size=nc*5*2)
  2029. >>>(2.S*10) ubelong x
  2030. # RGB branch for Adobe Photoshop Color swatch
  2031. >>>>4 ubeshort =0
  2032. # skip many (220/327) Targa by check of for invalid high RGB color z value (hexadecimal 2 3 2e03 4600 5e04 7502 8002 8b05 c700)
  2033. >>>>>12 ubeshort =0
  2034. # RGB branch for Adobe Photoshop Color swatch for older versions
  2035. >>>>>>0 ubeshort <2
  2036. >>>>>>>0 use adobe-aco
  2037. # RGB branch for Adobe Photoshop Color swatch for newer version 2
  2038. >>>>>>0 ubeshort =2
  2039. # skip many (74/176) Atari DEGAS hi-res bitmap (*.PI3) by check for invalid low color name length (0)
  2040. >>>>>>>16 ubeshort >0
  2041. >>>>>>>>0 use adobe-aco
  2042. # non RGB branch for Adobe Photoshop Color swatch
  2043. >>>>4 ubeshort !0
  2044. # non RGB branch for Adobe Photoshop Color swatch for older versions
  2045. >>>>>0 ubeshort <2
  2046. # skip many GEM Image (CHURCH.IMG TIGER.IMG) by check for invalid second high color space ID (55 114 143 157 256 288 450)
  2047. >>>>>>14 ubeshort <16
  2048. >>>>>>>0 use adobe-aco
  2049. # non RGB branch for Adobe Photoshop Color swatch for newer version 2
  2050. >>>>>0 ubeshort =2
  2051. # skip few Atari DEGAS hi-res bitmap (pal1wb-blue.pi3) and few ABR by check for invalid "high" nil bytes (7) before color name length
  2052. >>>>>>14 ubeshort =0
  2053. >>>>>>>0 use adobe-aco
  2054. # display Adobe Photoshop Color swatch file information (version, number of colors, color spaces, coordinates, names)
  2055. 0 name adobe-aco
  2056. >0 ubeshort x Adobe Photoshop Color swatch, version %u
  2057. #!:mime application/octet-stream
  2058. !:mime application/x-adobe-aco
  2059. !:apple ????8BCO
  2060. !:ext aco
  2061. >0 ubeshort <2
  2062. >>(2.S*10) ubelong x
  2063. # version 2 section after version 1 section
  2064. >>>&0 ubeshort 2 and 2
  2065. # nc; number of colors like: 20 50 86 88 126 204 300 1050 1137 1280 2092 3010 4096
  2066. >2 ubeshort x \b, %u colors
  2067. # maybe last 4 bytes of first section (probably y z color value) like: 0 0x66660000 0xfe700000 0xffff0000
  2068. #>(2.S*10) ubelong x 1ST_SECTION_END=%#8.8x
  2069. >0 ubeshort <2 \b; 1st
  2070. # first older Adobe Photoshop Color entry
  2071. >>4 use aco-color
  2072. >>>2 ubeshort >1 \b; 2nd
  2073. # second older Adobe Photoshop Color entry
  2074. >>>>14 use aco-color
  2075. >0 ubeshort =2 \b; 1st
  2076. # first new Adobe Photoshop Color entry
  2077. >>4 use aco-color-v2
  2078. >>>2 ubeshort >1 \b; 2nd
  2079. # jump first color name length words
  2080. >>>>(16.S*2) ubequad x
  2081. # second new Adobe Photoshop Color entry
  2082. >>>>>&10 use aco-color-v2
  2083. # display Adobe Photoshop Color entry (color space, color coordinates)
  2084. 0 name aco-color
  2085. # each color spec entry occupies five words
  2086. # color space: 0~RGB 1~HSB 2~CMYK 3~Pantone 4~Focoltone 5~Trumatch 6~Toyo 7~Lab 8~Grayscale 9?~wideCMYK 10~HKS ...
  2087. #>0 ubeshort x COLOR_ENTRY
  2088. >0 ubeshort 0 RGB
  2089. >0 ubeshort 1 HSB
  2090. >0 ubeshort 2 CMYK
  2091. >0 ubeshort 3 Pantone
  2092. >0 ubeshort 4 Focoltone
  2093. >0 ubeshort 5 Trumatch
  2094. >0 ubeshort 6 Toyo
  2095. >0 ubeshort 7 Lab
  2096. >0 ubeshort 8 Grayscale
  2097. >0 ubeshort 9 wide CMYK
  2098. >0 ubeshort 10 HKS
  2099. # unofficial
  2100. # >0 ubeshort 12 foo
  2101. # >0 ubeshort 13 bar
  2102. # >0 ubeshort 14 FOO
  2103. # >0 ubeshort 15 BAR
  2104. >0 ubeshort x space (%u)
  2105. # color coordinate w
  2106. >2 ubeshort x \b, w %#x
  2107. # color coordinate x
  2108. >4 ubeshort x \b, x %#x
  2109. # color coordinate y
  2110. >6 ubeshort x \b, y %#x
  2111. # color coordinate z; zero for RGB space
  2112. >8 ubeshort x \b, z %#x
  2113. # display Adobe Photoshop Color entry version 2 (color space, color coordinates names)
  2114. 0 name aco-color-v2
  2115. >0 use aco-color
  2116. #>10 ubeshort x \b, NUL_BYTES %#x
  2117. # color name length plus one (len+1) like: 7 8 9 13 14 15 16 17 22 26
  2118. #>>12 ubeshort x \b, LENGTH %u
  2119. >>12 ubeshort-1 x \b, %u chars
  2120. # len words; UTF-16 representation of the color name like: "DIC 1s" "PANTONE Process Yellow PC"
  2121. >>14 bestring16 x "%s"
  2122. # followed by nil word
  2123. # XV thumbnail indicator (ThMO)
  2124. # URL: https://en.wikipedia.org/wiki/Xv_(software)
  2125. # Reference: http://fileformats.archiveteam.org/wiki/XV_thumbnail
  2126. # Update: Joerg Jenderek
  2127. 0 string P7\ 332 XV thumbnail image data
  2128. #0 string P7\ 332 XV "thumbnail file" (icon) data
  2129. !:mime image/x-xv-thumbnail
  2130. # thumbnail .xvpic/foo.bar for graphic foo.bar
  2131. !:ext p7/gif/tif/xpm/jpg
  2132. # NITF is defined by United States MIL-STD-2500A
  2133. 0 string NITF National Imagery Transmission Format
  2134. >25 string >\0 dated %.14s
  2135. 0 name gem_info
  2136. # version is 2 for some XIMG and 1 for all others
  2137. >0 ubeshort <0x0003 GEM
  2138. # https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
  2139. !:mime image/x-gem
  2140. # header_size 24 25 27 59 779 words for colored bitmaps
  2141. >>2 ubeshort >9
  2142. >>>16 string STTT\0\x10 STTT
  2143. >>>16 string TIMG\0 TIMG
  2144. # HYPERPAINT or NOSIG variant
  2145. >>>16 string \0\x80
  2146. >>>>2 ubeshort =24 NOSIG
  2147. >>>>2 ubeshort !24 HYPERPAINT
  2148. # NOSIG or XIMG variant
  2149. >>>16 default x
  2150. >>>>16 string !XIMG\0 NOSIG
  2151. >>16 string =XIMG\0 XIMG Image data
  2152. !:ext img/ximg
  2153. # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
  2154. >>16 string !XIMG\0 Image data
  2155. !:ext img
  2156. # header_size is 9 for Ventura files and 8 for other GEM Paint files
  2157. >>2 ubeshort 9 (Ventura)
  2158. #>>2 ubeshort 8 (Paint)
  2159. >>12 ubeshort x %d x
  2160. >>14 ubeshort x %d,
  2161. # 1 4 8
  2162. >>4 ubeshort x %d planes,
  2163. # in tenths of a millimetre
  2164. >>8 ubeshort x %d x
  2165. >>10 ubeshort x %d pixelsize
  2166. # pattern_size 1-8. 2 for GEM Paint
  2167. >>6 ubeshort !2 \b, pattern size %d
  2168. # GEM Metafile (Wolfram Kleff)
  2169. 0 ulelong 0x0018FFFF GEM Metafile data
  2170. >4 uleshort x version %d
  2171. #
  2172. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  2173. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  2174. #
  2175. 0 string \0\nSMJPEG SMJPEG
  2176. >8 ubelong x %d.x data
  2177. # According to the specification you could find any number of _TXT
  2178. # headers here, but I can't think of any way of handling that. None of
  2179. # the SMJPEG files I tried it on used this feature. Even if such a
  2180. # file is encountered the output should still be reasonable.
  2181. >16 string _SND \b,
  2182. >>24 ubeshort >0 %d Hz
  2183. >>26 ubyte 8 8-bit
  2184. >>26 ubyte 16 16-bit
  2185. >>28 string NONE uncompressed
  2186. # >>28 string APCM ADPCM compressed
  2187. >>27 ubyte 1 mono
  2188. >>28 ubyte 2 stereo
  2189. # Help! Isn't there any way to avoid writing this part twice?
  2190. # Yes, use a name/use
  2191. >>32 string _VID \b,
  2192. # >>>48 string JFIF JPEG
  2193. >>>40 ubelong >0 %d frames
  2194. >>>44 ubeshort >0 (%d x
  2195. >>>46 ubeshort >0 %d)
  2196. >16 string _VID \b,
  2197. # >>32 string JFIF JPEG
  2198. >>24 ubelong >0 %d frames
  2199. >>28 ubeshort >0 (%d x
  2200. >>30 ubeshort >0 %d)
  2201. 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
  2202. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  2203. 0 string KiSS KISS/GS
  2204. >4 ubyte 16 color
  2205. >>5 ubyte x %d bit
  2206. >>8 uleshort x %d colors
  2207. >>10 uleshort x %d groups
  2208. >4 ubyte 32 cell
  2209. >>5 ubyte x %d bit
  2210. >>8 uleshort x %d x
  2211. >>10 uleshort x %d
  2212. >>12 uleshort x +%d
  2213. >>14 uleshort x +%d
  2214. # Webshots (www.webshots.com), by John Harrison
  2215. 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  2216. # Hercules DASD image files
  2217. # From Jan Jaeger <jj@septa.nl> and Jay Maynard <jaymaynard@gmail.com>
  2218. # Common Hercules CKD image files
  2219. 0 name HercCKD
  2220. >0 lelong x \b, %d heads per cylinder
  2221. >4 lelong x \b, track size %d bytes
  2222. >8 ubyte >0x2F
  2223. >>8 ubyte 0x45 \b, device type 9345
  2224. >>8 ubyte !0x45 \b, device type 33%2.2X
  2225. >8 ubyte <0x30 \b, device type 23%2.2X
  2226. 0 string CKD_P370 Hercules CKD DASD image file
  2227. >8 use HercCKD
  2228. 0 string CKD_C370 Hercules compressed CKD DASD image file
  2229. >8 use HercCKD
  2230. >552 lelong x \b, %d total cylinders
  2231. >>557 byte 0 \b, no compression
  2232. >>557 byte 1 \b, ZLIB compression
  2233. >>557 byte 2 \b, BZ2 compression
  2234. 0 string CKD_S370 Hercules CKD DASD shadow file
  2235. >8 use HercCKD
  2236. 0 string CKD_P064 Hercules CKD64 DASD image file
  2237. >8 use HercCKD
  2238. 0 string CKD_C064 Hercules compressed CKD64 DASD image file
  2239. >8 use HercCKD
  2240. >524 lelong x \b, %d total cylinders
  2241. >>585 byte 0 \b, no compression
  2242. >>585 byte 1 \b, ZLIB compression
  2243. >>585 byte 2 \b, BZ2 compression
  2244. 0 string CKD_S064 Hercules CKD64 DASD shadow file
  2245. >8 use HercCKD
  2246. # Squeak images and programs - etoffi@softhome.net
  2247. 0 string \146\031\0\0 Squeak image data
  2248. 0 search/1 'From\040Squeak Squeak program text
  2249. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  2250. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  2251. 0 string PaRtImAgE-VoLuMe PartImage
  2252. >0x0020 string 0.6.1 file version %s
  2253. >>0x0060 ulelong >-1 volume %d
  2254. #>>0x0064 8 byte identifier
  2255. #>>0x007c reserved
  2256. >>0x0200 string >\0 type %s
  2257. >>0x1400 string >\0 device %s,
  2258. >>0x1600 string >\0 original filename %s,
  2259. # Some fields omitted
  2260. >>0x2744 ulelong 0 not compressed
  2261. >>0x2744 ulelong 1 gzip compressed
  2262. >>0x2744 ulelong 2 bzip2 compressed
  2263. >>0x2744 ulelong >2 compressed with unknown algorithm
  2264. >0x0020 string >0.6.1 file version %s
  2265. >0x0020 string <0.6.1 file version %s
  2266. # DCX is multi-page PCX, using a simple header of up to 1024
  2267. # offsets for the respective PCX components.
  2268. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  2269. # Update: Joerg Jenderek
  2270. # URL: http://fileformats.archiveteam.org/wiki/DCX
  2271. 0 ulelong 987654321 DCX multi-page
  2272. # http://www.nationalarchives.gov.uk/pronom/x-fmt/348
  2273. !:mime image/x-dcx
  2274. !:ext dcx
  2275. # The first file offset usually starts at file offset 0x1004
  2276. # print 1 space after 0x100? offset and then handles PCX images by ./images
  2277. >4 ulelong x \b, at %#x
  2278. >(4.l) indirect x
  2279. # possible 2nd PCX image
  2280. #>8 ulelong !0 \b, at %#x
  2281. #>>(8.l) indirect x
  2282. # possible 3rd PCX image
  2283. #>12 ulelong !0 \b, at %#x
  2284. #>>(12.l) indirect x
  2285. # Simon Walton <simonw@matteworld.com>
  2286. # Kodak Cineon format for scanned negatives
  2287. # http://www.kodak.com/US/en/motion/support/dlad/
  2288. 0 ulelong 0xd75f2a80 Cineon image data
  2289. >200 ubelong >0 \b, %d x
  2290. >204 ubelong >0 %d
  2291. # Bio-Rad .PIC is an image format used by microscope control systems
  2292. # and related image processing software used by biologists.
  2293. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  2294. # BOOL values are two-byte integers; use them to rule out false positives.
  2295. # https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
  2296. # Samples: https://www.loci.wisc.edu/software/sample-data
  2297. 14 uleshort <2
  2298. >62 uleshort <2
  2299. >>54 uleshort 12345 Bio-Rad .PIC Image File
  2300. >>>0 uleshort >0 %d x
  2301. >>>2 uleshort >0 %d,
  2302. >>>4 uleshort =1 1 image in file
  2303. >>>4 uleshort >1 %d images in file
  2304. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  2305. # The description of *.mrw format can be found at
  2306. # http://www.dalibor.cz/minolta/raw_file_format.htm
  2307. 0 string \000MRM Minolta Dimage camera raw image data
  2308. # Summary: DjVu image / document
  2309. # Extension: .djvu
  2310. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  2311. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  2312. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  2313. 0 string AT&TFORM
  2314. >12 string DJVM DjVu multiple page document
  2315. !:mime image/vnd.djvu
  2316. >12 string DJVU DjVu image or single page document
  2317. !:mime image/vnd.djvu
  2318. >12 string DJVI DjVu shared document
  2319. !:mime image/vnd.djvu
  2320. >12 string THUM DjVu page thumbnails
  2321. !:mime image/vnd.djvu
  2322. # Originally by Marc Espie
  2323. # Modified by Robert Minsk <robertminsk at yahoo.com>
  2324. # https://www.openexr.com/openexrfilelayout.pdf
  2325. 0 ulelong 20000630 OpenEXR image data,
  2326. !:mime image/x-exr
  2327. >4 ulelong&0x000000ff x version %d,
  2328. >4 ulelong ^0x00000200 storage: scanline
  2329. >4 ulelong &0x00000200 storage: tiled
  2330. >8 search/0x1000 compression\0 \b, compression:
  2331. >>&16 ubyte 0 none
  2332. >>&16 ubyte 1 rle
  2333. >>&16 ubyte 2 zips
  2334. >>&16 ubyte 3 zip
  2335. >>&16 ubyte 4 piz
  2336. >>&16 ubyte 5 pxr24
  2337. >>&16 ubyte 6 b44
  2338. >>&16 ubyte 7 b44a
  2339. >>&16 ubyte 8 dwaa
  2340. >>&16 ubyte 9 dwab
  2341. >>&16 ubyte >9 unknown
  2342. >8 search/0x1000 dataWindow\0 \b, dataWindow:
  2343. >>&10 ulelong x (%d
  2344. >>&14 ulelong x %d)-
  2345. >>&18 ulelong x \b(%d
  2346. >>&22 ulelong x %d)
  2347. >8 search/0x1000 displayWindow\0 \b, displayWindow:
  2348. >>&10 ulelong x (%d
  2349. >>&14 ulelong x %d)-
  2350. >>&18 ulelong x \b(%d
  2351. >>&22 ulelong x %d)
  2352. >8 search/0x1000 lineOrder\0 \b, lineOrder:
  2353. >>&14 ubyte 0 increasing y
  2354. >>&14 ubyte 1 decreasing y
  2355. >>&14 ubyte 2 random y
  2356. >>&14 ubyte >2 unknown
  2357. # SMPTE Digital Picture Exchange Format, SMPTE DPX
  2358. #
  2359. # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
  2360. # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
  2361. # Robert Minsk <robertminsk at yahoo.com>
  2362. # Modified by Harry Mallon <hjmallon at gmail.com>
  2363. 0 string SDPX DPX image data, big-endian,
  2364. !:mime image/x-dpx
  2365. >0 use dpx_info
  2366. 0 string XPDS DPX image data, little-endian,
  2367. !:mime image/x-dpx
  2368. >0 use \^dpx_info
  2369. 0 name dpx_info
  2370. >768 ubeshort <4
  2371. >>772 ubelong x %dx
  2372. >>776 ubelong x \b%d,
  2373. >768 ubeshort >3
  2374. >>776 ubelong x %dx
  2375. >>772 ubelong x \b%d,
  2376. >768 ubeshort 0 left to right/top to bottom
  2377. >768 ubeshort 1 right to left/top to bottom
  2378. >768 ubeshort 2 left to right/bottom to top
  2379. >768 ubeshort 3 right to left/bottom to top
  2380. >768 ubeshort 4 top to bottom/left to right
  2381. >768 ubeshort 5 top to bottom/right to left
  2382. >768 ubeshort 6 bottom to top/left to right
  2383. >768 ubeshort 7 bottom to top/right to left
  2384. # From: Tom Hilinski <tom.hilinski@comcast.net>
  2385. # Update: Joerg Jenderek
  2386. # URL: https://en.wikipedia.org/wiki/NetCDF
  2387. # http://fileformats.archiveteam.org/wiki/NetCDF
  2388. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/n/netcdf.trid.xml
  2389. # https://www.loc.gov/preservation/digital/formats/fdd/fdd000330.shtml
  2390. # Note: called "NetCDF Network Common Data Form" by TrID and
  2391. # "netCDF-3 Classic" by DROID via PUID fmt/282
  2392. # https://www.unidata.ucar.edu/packages/netcdf/
  2393. 0 string CDF\001
  2394. # skip DROID fmt-282-signature-id-298.nc by test for more content bytes
  2395. >3 uleshort >0 NetCDF Data Format data
  2396. #!:mime application/netcdf
  2397. # https://reposcope.com/mimetype/application/x-netcdf
  2398. !:mime application/x-netcdf
  2399. !:ext nc
  2400. # https://fileinfo.com/extension/cdf
  2401. # https://www.file-extensions.org/cdf-file-extension-unidata-network-common-data-form
  2402. # in 1994 changed from CDF to NC file extension avoid a clash with other file formats
  2403. #!:ext nc/cdf
  2404. # 64-bit offset netcdf Classic https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications
  2405. # Note: called "netCDF-3 64-bit" by DROID via PUID fmt/283
  2406. 0 string CDF\002
  2407. # skip DROID fmt-283-signature-id-299.nc by test for more content bytes
  2408. >3 uleshort >0 NetCDF Data Format data (64-bit offset)
  2409. #!:mime application/netcdf
  2410. !:mime application/x-netcdf
  2411. !:ext nc
  2412. # From: Michael Liu
  2413. # https://en.wikipedia.org/wiki/Common_Data_Format
  2414. 0 ubelong 0xCDF30001 Common Data Format (Version 3 or later) data
  2415. !:mime application/x-cdf
  2416. 0 ubelong 0xCDF26002 Common Data Format (Version 2.6 or 2.7) data
  2417. !:mime application/x-cdf
  2418. 0 ubelong 0x0000FFFF Common Data Format (Version 2.5 or earlier) data
  2419. !:mime application/x-cdf
  2420. # Hierarchical Data Format, used to facilitate scientific data exchange
  2421. # specifications at http://hdf.ncsa.uiuc.edu/
  2422. # URL: http://fileformats.archiveteam.org/wiki/HDF
  2423. # https://en.wikipedia.org/wiki/Hierarchical_Data_Format
  2424. # Reference: https://portal.hdfgroup.org/download/attachments/52627880/HDF5_File_Format_Specification_Version-3.0.pdf
  2425. 0 ubelong 0x0e031301 Hierarchical Data Format (version 4) data
  2426. !:mime application/x-hdf
  2427. !:ext hdf/hdf4/h4
  2428. 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
  2429. #!:mime application/x-hdf
  2430. !:mime application/x-hdf5
  2431. !:ext h5/hdf5/hdf/he5
  2432. 512 string \211HDF\r\n\032\n
  2433. # skip Matlab v5 mat-file testhdf5_7.4_GLNX86.mat handled by ./mathematica
  2434. >0 string !MATLAB Hierarchical Data Format (version 5) with 512 bytes user block
  2435. #!:mime application/x-hdf
  2436. !:mime application/x-hdf5
  2437. !:ext h5/hdf5/hdf/he5
  2438. 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
  2439. #!:mime application/x-hdf
  2440. !:mime application/x-hdf5
  2441. !:ext h5/hdf5/hdf/he5
  2442. 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
  2443. #!:mime application/x-hdf
  2444. !:mime application/x-hdf5
  2445. !:ext h5/hdf5/hdf/he5
  2446. 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
  2447. #!:mime application/x-hdf
  2448. !:mime application/x-hdf5
  2449. !:ext h5/hdf5/hdf/he5
  2450. # From: Tobias Burnus <burnus@net-b.de>
  2451. # Xara (for a while: Corel Xara) is a graphic package, see
  2452. # http://www.xara.com/ for Windows and as GPL application for Linux
  2453. 0 string XARA\243\243 Xara graphics file
  2454. # From: Joerg Jenderek
  2455. # URL: http://fileformats.archiveteam.org/wiki/Corel_Gallery
  2456. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/b/bmf-corel.trid.xml
  2457. # Note: called "Corel Binary Material Format" by TrID and
  2458. # "Corel Flow" by XnView
  2459. 0 string @CorelBMF\n\rCorel\040Corporation Corel GALLERY Clipart
  2460. !:mime image/x-corel-bmf
  2461. !:ext bmf
  2462. # https://www.cartesianinc.com/Tech/
  2463. # Reference: http://fileformats.archiveteam.org/wiki/Cartesian_Perceptual_Compression
  2464. 0 string CPC\262 Cartesian Perceptual Compression image
  2465. !:mime image/x-cpi
  2466. !:ext cpi/cpc
  2467. # From Albert Cahalan <acahalan@gmail.com>
  2468. # puredigital used it for the CVS disposable camcorder
  2469. #8 lelong 4 ZBM bitmap image data
  2470. #>4 uleshort x %u x
  2471. #>6 uleshort x %u
  2472. # From Albert Cahalan <acahalan@gmail.com>
  2473. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  2474. 0 string C565 OLPC firmware icon image data
  2475. >4 uleshort x %u x
  2476. >6 uleshort x %u
  2477. # Applied Images - Image files from Cytovision
  2478. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  2479. 0 string \xce\xda\xde\xfa Cytovision Metaphases file
  2480. 0 string \xed\xad\xef\xac Cytovision Karyotype file
  2481. 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
  2482. 0 string \xed\xfe\xda\xbe Cytovision FLEX file
  2483. 0 string \xed\xab\xed\xfe Cytovision FLEX file
  2484. 0 string \xad\xfd\xea\xad Cytovision RATS file
  2485. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  2486. # From Tano M Fotang <mfotang@quanteq.com>
  2487. 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
  2488. # Type: PCO B16 image files
  2489. # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
  2490. # From: Florian Philipp <florian.philipp@binarywings.net>
  2491. # Extension: .b16
  2492. # Description: Pixel image format produced by PCO Camware, typically used
  2493. # together with PCO cameras.
  2494. # Note: Different versions exist for e.g. 8 bit and 16 bit images.
  2495. # Documentation is incomplete.
  2496. 0 string/b PCO- PCO B16 image data
  2497. >12 ulelong x \b, %dx
  2498. >16 ulelong x \b%d
  2499. >20 ulelong 0 \b, short header
  2500. >20 ulelong -1 \b, extended header
  2501. >>24 ulelong 0 \b, grayscale
  2502. >>>36 ulelong 0 linear LUT
  2503. >>>36 ulelong 1 logarithmic LUT
  2504. >>>28 ulelong x [%d
  2505. >>>32 ulelong x \b,%d]
  2506. >>24 ulelong 1 \b, color
  2507. >>>64 ulelong 0 linear LUT
  2508. >>>64 ulelong 1 logarithmic LUT
  2509. >>>40 ulelong x r[%d
  2510. >>>44 ulelong x \b,%d]
  2511. >>>48 ulelong x g[%d
  2512. >>>52 ulelong x \b,%d]
  2513. >>>56 ulelong x b[%d
  2514. >>>60 ulelong x \b,%d]
  2515. # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
  2516. # From: Markus Heidelberg <markus.heidelberg at web.de>
  2517. 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
  2518. !:mime image/x-polar-monitor-bitmap
  2519. # From: Rick Richardson <rickrich@gmail.com>
  2520. # updated by: Joerg Jenderek
  2521. # URL: http://techmods.net/nuvi/
  2522. 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
  2523. # extension is also used for
  2524. # Sony SRF raw image (image/x-sony-srf)
  2525. # SRF map
  2526. # Terragen Surface Map (https://www.planetside.co.uk/terragen)
  2527. # FileLocator Pro search criteria file (https://www.mythicsoft.com/filelocatorpro)
  2528. !:ext srf
  2529. #!:mime image/x-garmin-srf
  2530. # version 1.00,2.00,2.10,2.40,2.50
  2531. >0x2f string >0 \b, version %4.4s
  2532. # width (2880,2881,3240)
  2533. >0x55 uleshort >0 \b, %dx
  2534. # height (80,90)
  2535. >>0x53 uleshort x \b%d
  2536. # From: Joerg Jenderek
  2537. # URL: http://fileformats.archiveteam.org/wiki/Imageiio/imaginfo_(Ulead)
  2538. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pe3.trid.xml
  2539. # Note: called "Ulead Imageiio/Imaginfo thumbnail" by TrID
  2540. 0 string IIO1$ Ulead Photo Explorer 3
  2541. #!:mime application/octet-stream
  2542. !:mime image/x-ulead-pe3
  2543. # IMAGEIIO.PE3
  2544. !:ext pe3
  2545. # look for DOS/Windows drive letter
  2546. >5 search/192/s :\\
  2547. # directory or full name of corresponding imaginfo.pe3 like: "T:\SAMPLES\TEXTURES\SKY_SNOW\IIOE371.TMP "S:\PI3\PIMPACT3\PROGRAMS\PATTERNS\imaginfo.pe3"
  2548. >>&-1 string x "%s"
  2549. # look for DOS/Windows network path if no drive letter part
  2550. >5 default x
  2551. >>5 search/192/s \x5c\x5c
  2552. # full name of corresponding imaginfo.pe3 like: "\\Lionking\upi\SAMPLES\IMAGES\ANIMALS\imaginfo.pe3"
  2553. >>>&0 string x "%s"
  2554. # Type: Ulead Photo Explorer5 (.pe5)
  2555. # URL: http://fileformats.archiveteam.org/wiki/Imageiio/imaginfo_(Ulead)
  2556. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pe4.trid.xml
  2557. # From: Simon Horman <horms@debian.org>
  2558. # Update: Joerg Jenderek
  2559. # Note: some called "Ulead Imageiio/Imaginfo thumbnail" by TrID
  2560. # and used in various Ulead applications
  2561. 0 string IIO2H Ulead Photo Explorer 4 or 5
  2562. #!:mime application/octet-stream
  2563. !:mime image/x-ulead-pe4
  2564. # IMAGEIIO.PE4
  2565. !:ext pe4/pe5
  2566. # look in most samples for JPEG signature like: SAMPLES/IMAGES/SCENES/IMAGINFO.PE4
  2567. >0x4c2 search/0xE02/s JFIF with JPEG image data
  2568. >>&-6 use jpeg
  2569. # near the end list of image names like: Img0001.pcd 1116012L.JPG NCARD4.TPL
  2570. #
  2571. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pe3-imaginfo.trid.xml
  2572. 11 string \001\0\0\0\0
  2573. # check for version 3 part
  2574. >19 string \0\001\0\003\0
  2575. >>0 use ulead-imaginfo
  2576. # From: Joerg Jenderek
  2577. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pe4-imaginfo.trid.xml
  2578. # check for version 4 part
  2579. >19 string \0\0\0\004\0
  2580. >>0 use ulead-imaginfo
  2581. # display information about Ulead Imaginfo thumbnail (version, directory, image extension)
  2582. 0 name ulead-imaginfo
  2583. >22 ubyte x Ulead Imaginfo thumbnail
  2584. #!:mime application/octet-stream
  2585. !:mime image/x-ulead-imaginfo
  2586. >22 ubyte =3 \b, version 3
  2587. # IMAGINFO.PE3
  2588. !:ext pe3
  2589. >22 ubyte =4 \b, version 4
  2590. # IMAGINFO.PE4
  2591. !:ext pe4
  2592. # MAYBE ALSO VERSION 5 ?
  2593. #>22 ubyte =5 \b, version 5
  2594. #!:ext pe5
  2595. >22 ubyte x
  2596. # look for DOS/Windows driver letter
  2597. >>4 search/192/s :\x5c
  2598. # skip f:\Programme\iPhoto Plus 4\Template\Business Cards\IMAGINFO.PE4
  2599. # by looking for driver letter in range A-Z
  2600. >>>&-1 ubyte >0x40
  2601. # directory path like: "E:\iPE\CDSample\Images\Scenes" "D:\XmasCard\Samples" "C:\TEMP\PLANTS"
  2602. >>>>&-5 pstring/l >0 \b, "%s"
  2603. # look for DOS/Windows network path if no valid drive letter part
  2604. >>>&-1 default x
  2605. >>>>4 search/192/s \x5c\x5c
  2606. # directory path like: "\\FSX\SYS\OPPS\IPE.ENG\TEMPLATE\BUSINESS" "\\Lionking\upi\SAMPLES\IMAGES\ANIMALS"
  2607. >>>>>&-4 pstring/l >0 \b, "%s"
  2608. # look for DOS/Windows network path if no drive letter part
  2609. >>4 default x
  2610. >>>4 search/192/s \x5c\x5c
  2611. # directory path like: "\\FSX\SYS\opps\ipe.eng\samples" "\\DANIEL\IPE_CD\IPE.ITA"
  2612. >>>>&-4 pstring/l >0 \b, "%s"
  2613. # look for point character inside image names
  2614. >56 search/38/s .
  2615. # image name extension like: bmp jpg pcd tpl
  2616. >>&1 string x with %-.3s images
  2617. # Summary: Ulead Pattern image (Corel Corporation)
  2618. # URL: https://en.wikipedia.org/wiki/Ulead_Systems
  2619. # https://www.file-extensions.org/pst-file-extension-ulead-pattern-image-format
  2620. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pst-ulead.trid.xml
  2621. # From: Joerg Jenderek
  2622. # Note: used also by CorelDraw Essentials 3 version 13.0.0.800
  2623. # there seems to exist other versions
  2624. 0 ubelong 0xFFFF0100
  2625. >8 search/21 PresetInfo Ulead pattern image
  2626. #!:mime application/octet-stream
  2627. !:mime image/x-ulead-pst
  2628. !:ext pst
  2629. # string length like: 16 18 19 21 24
  2630. #>>4 uleshort x n=%u
  2631. # like: BlendPresetInfo DropShadowPresetInfo FileNewPresetInfo VectorExtrudePresetInfo EnvelopePresetInfo ContourPresetInfo DistortionPresetInfo
  2632. >>4 pstring/h x "%s"
  2633. # Type: X11 cursor
  2634. # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  2635. # From: Mathias Brodala <info@noctus.net>
  2636. 0 string Xcur X11 cursor
  2637. # Type: Olympus ORF raw images.
  2638. # URL: https://libopenraw.freedesktop.org/wiki/Olympus_ORF
  2639. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2640. 0 string MMOR Olympus ORF raw image data, big-endian
  2641. !:mime image/x-olympus-orf
  2642. 0 string IIRO Olympus ORF raw image data, little-endian
  2643. !:mime image/x-olympus-orf
  2644. 0 string IIRS Olympus ORF raw image data, little-endian
  2645. !:mime image/x-olympus-orf
  2646. # Type: files used in modern AVCHD camcoders to store clip information
  2647. # Extension: .cpi
  2648. # From: Alexander Danilov <alexander.a.danilov@gmail.com>
  2649. 0 string HDMV0100 AVCHD Clip Information
  2650. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2651. # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
  2652. # Radiance HDR; usually has .pic or .hdr extension.
  2653. 0 string #?RADIANCE\n Radiance HDR image data
  2654. !:mime image/vnd.radiance
  2655. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2656. # URL: https://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
  2657. # Used by the pfstools packages. The regex matches for the image size could
  2658. # probably use some work. The MIME type is made up; if there's one in
  2659. # actual common use, it should replace the one below.
  2660. 0 string PFS1\x0a PFS HDR image data
  2661. #!mime image/x-pfs
  2662. >1 regex [0-9]*\ \b, %s
  2663. >>1 regex \ [0-9]{4} \bx%s
  2664. # Type: Foveon X3F
  2665. # URL: https://www.photofo.com/downloads/x3f-raw-format.pdf
  2666. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  2667. # Note that the MIME type isn't defined anywhere that I can find; if
  2668. # there's a canonical type for this format, it should replace this one.
  2669. 0 string FOVb Foveon X3F raw image data
  2670. !:mime image/x-x3f
  2671. >6 uleshort x \b, version %d.
  2672. >4 uleshort x \b%d
  2673. >28 ulelong x \b, %dx
  2674. >32 ulelong x \b%d
  2675. # Paint.NET file
  2676. # From Adam Buchbinder <adam.buchbinder@gmail.com>
  2677. 0 string PDN3 Paint.NET image data
  2678. !:mime image/x-paintnet
  2679. # Not really an image.
  2680. # From: "Tano M. Fotang" <mfotang@quanteq.com>
  2681. 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
  2682. # doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
  2683. # example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
  2684. 90 ubequad 0x574D50484F544F00 JPEG-XR Image
  2685. >98 ubyte&0x08 =0x08 \b, hard tiling
  2686. >99 ubyte&0x80 =0x80 \b, tiling present
  2687. >99 ubyte&0x40 =0x40 \b, codestream present
  2688. >99 ubyte&0x38 x \b, spatial xform=
  2689. >99 ubyte&0x38 0x00 \bTL
  2690. >99 ubyte&0x38 0x08 \bBL
  2691. >99 ubyte&0x38 0x10 \bTR
  2692. >99 ubyte&0x38 0x18 \bBR
  2693. >99 ubyte&0x38 0x20 \bBT
  2694. >99 ubyte&0x38 0x28 \bRB
  2695. >99 ubyte&0x38 0x30 \bLT
  2696. >99 ubyte&0x38 0x38 \bLB
  2697. >100 ubyte&0x80 =0x80 \b, short header
  2698. >>102 ubeshort+1 x \b, %d
  2699. >>104 ubeshort+1 x \bx%d
  2700. >100 ubyte&0x80 =0x00 \b, long header
  2701. >>102 ubelong+1 x \b, %x
  2702. >>106 ubelong+1 x \bx%x
  2703. >101 ubeshort&0xf x \b, bitdepth=
  2704. >>101 ubeshort&0xf 0x0 \b1-WHITE=1
  2705. >>101 ubeshort&0xf 0x1 \b8
  2706. >>101 ubeshort&0xf 0x2 \b16
  2707. >>101 ubeshort&0xf 0x3 \b16-SIGNED
  2708. >>101 ubeshort&0xf 0x4 \b16-FLOAT
  2709. >>101 ubeshort&0xf 0x5 \b(reserved 5)
  2710. >>101 ubeshort&0xf 0x6 \b32-SIGNED
  2711. >>101 ubeshort&0xf 0x7 \b32-FLOAT
  2712. >>101 ubeshort&0xf 0x8 \b5
  2713. >>101 ubeshort&0xf 0x9 \b10
  2714. >>101 ubeshort&0xf 0xa \b5-6-5
  2715. >>101 ubeshort&0xf 0xb \b(reserved %d)
  2716. >>101 ubeshort&0xf 0xc \b(reserved %d)
  2717. >>101 ubeshort&0xf 0xd \b(reserved %d)
  2718. >>101 ubeshort&0xf 0xe \b(reserved %d)
  2719. >>101 ubeshort&0xf 0xf \b1-BLACK=1
  2720. >101 ubeshort&0xf0 x \b, colorfmt=
  2721. >>101 ubeshort&0xf0 0x00 \bYONLY
  2722. >>101 ubeshort&0xf0 0x10 \bYUV240
  2723. >>101 ubeshort&0xf0 0x20 \bYWV422
  2724. >>101 ubeshort&0xf0 0x30 \bYWV444
  2725. >>101 ubeshort&0xf0 0x40 \bCMYK
  2726. >>101 ubeshort&0xf0 0x50 \bCMYKDIRECT
  2727. >>101 ubeshort&0xf0 0x60 \bNCOMPONENT
  2728. >>101 ubeshort&0xf0 0x70 \bRGB
  2729. >>101 ubeshort&0xf0 0x80 \bRGBE
  2730. >>101 ubeshort&0xf0 >0x80 \b(reserved %#x)
  2731. # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
  2732. #
  2733. # BPG (Better Portable Graphics) format
  2734. # https://bellard.org/bpg/
  2735. # http://fileformats.archiveteam.org/wiki/BPG
  2736. #
  2737. 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
  2738. !:mime image/bpg
  2739. # From: Joerg Jenderek
  2740. # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
  2741. 0 string icns Mac OS X icon
  2742. !:mime image/x-icns
  2743. !:apple ????icns
  2744. !:ext icns
  2745. >4 ubelong >0
  2746. # file size
  2747. >>4 ubelong x \b, %d bytes
  2748. # icon type
  2749. >>8 string x \b, "%4.4s" type
  2750. # TIM images
  2751. # URL: http://fileformats.archiveteam.org/wiki/TIM_(PlayStation_graphics)
  2752. # Reference: https://mrclick.zophar.net/TilEd/download/timgfx.txt
  2753. # Update: Joerg Jenderek
  2754. # Note: called as "PSX TIM *bpp bitmap" by bitmap-tim-*.trid.xml
  2755. # verified as "TIM PSX" by XnView `nconvert -fullinfo *.tim` and
  2756. # by RECOIL `recoil2png -o TMP.PNG input.tim; file TMP.PNG` and often
  2757. # as "PSX TIM" by ImageMagick version 7.1.0-10 command `identify *.tim`
  2758. # here signed integers are used but according to Kaitai unsigned
  2759. 0 ulelong 0x00000010
  2760. # 32 Flag bits *cttt; c~CLUT flag t~type 000~4BPP 001~8BPP 010~16BPP 011~24BPP 100~Mixed
  2761. #>4 ulelong x FLAGS=%#x
  2762. # 12+Size of CLUT (2Ch for 4BPP; 20Ch 40Ch 60Ch 80Ch C0Ch for 8BPP) or
  2763. # +image data size (800Ch 2000Ch 2580C for 16BPP) (02000003h for dBase memo test.dbt)
  2764. #>8 ulelong x \b, 12+CLUT or data size=%#8.8x
  2765. # CLUT or data size remainder is 12 (Ch), but 03 for dBase memo test.dbt
  2766. #>8 ubyte&0x0F =0x0C \b, SIZE REMAINDER IS 12
  2767. # skip dBase III memo test.dbt with invalid flags 22D10189h
  2768. >4 ulelong&0xffFFffF0 =0 Sony PlayStation PSX image,
  2769. # file (version 5.40) labeled the above entry as "TIM image"
  2770. !:mime image/x-sony-tim
  2771. !:ext tim
  2772. #>>4 ulelong&0x00000007 x \b, BPP~%u
  2773. # 4BPP and 8BPP examples exist with CLUT or without CLUT
  2774. >>4 ulelong&0x07 0x0 4-Bit,
  2775. >>4 ulelong&0x07 0x1 8-Bit,
  2776. # 16BPP and 24BPP examples have no CLUT
  2777. >>4 ulelong 0x2 15-Bit,
  2778. >>4 ulelong 0x3 24-Bit,
  2779. # no example
  2780. >>4 ulelong&0x07 0x4 Mixed-Bit,
  2781. # CLUT flag set
  2782. >>4 ulelong &8
  2783. # 12 + size of CLUT like: 1000Ch 800Ch 400Ch 40Ch and 2FEh (KAGE.TIM)
  2784. #>>>(8.l+8) ulelong x \b, 12+CLUT SIZE=%#8.8x
  2785. >>>(8.l+12) uleshort x Pixel at (%d,
  2786. >>>(8.l+14) uleshort x \b%d) Size=
  2787. # image width (to get actual width multiply by 4 for 4BPP and by 2 for 8BPP)
  2788. >>>>4 ulelong 0x8
  2789. >>>>>(8.l+16) uleshort*4 x \b%d
  2790. >>>>4 ulelong 0x9
  2791. >>>>>(8.l+16) uleshort*2 x \b%d
  2792. # image height like: 32 64 128 144 160 208 256
  2793. >>>(8.l+18) uleshort x \bx%d,
  2794. >>>4 ulelong 0x8 16 CLUT Entries at
  2795. >>>4 ulelong 0x9 256 CLUT Entries at
  2796. >>>12 uleshort x (%d,
  2797. >>>14 uleshort x \b%d)
  2798. # no Color LookUp Table (CLUT)
  2799. >>4 ulelong ^8
  2800. # image origin X Y
  2801. >>>12 uleshort x Pixel at (%d,
  2802. >>>14 uleshort x \b%d) Size=
  2803. # real image width = multiply by 4 (4BPP) 2 (8BPP) 1 (16BPP) 2/3 (24BPP)
  2804. >>>>4 ulelong 0x0
  2805. >>>>>16 uleshort*4 x \b%d
  2806. >>>>4 ulelong 0x1
  2807. >>>>>16 uleshort*2 x \b%d
  2808. >>>>4 ulelong 0x2
  2809. >>>>>16 uleshort x \b%d
  2810. >>>>4 ulelong 0x3
  2811. # GRR: NOT working
  2812. #>>>>>16 uleshort*2/3 x \b%d
  2813. >>>>>16 uleshort x \b2/3*%d
  2814. # mixed format width not explained!
  2815. >>>>4 ulelong 0x4
  2816. >>>>>16 uleshort x \b%d
  2817. # image height like: 64 240 256
  2818. >>>18 uleshort x \bx%d
  2819. # TIM image data
  2820. # MDEC streams
  2821. 0 ulelong 0x80010160 MDEC video stream,
  2822. >16 uleshort x %dx
  2823. >18 uleshort x \b%d
  2824. #>8 ulelong x %d frames
  2825. #>4 uleshort x secCount=%d;
  2826. #>6 uleshort x nSectors=%d;
  2827. #>12 ulelong x frameSize=%d;
  2828. # BS encoded bitstreams
  2829. 2 uleshort 0x3800 BS image,
  2830. # GRR: the above line is also true for binary Computer Graphics Metafile SAB00012.CGM with long parameter length 56 (=38h)
  2831. >6 uleshort x Version %d,
  2832. >4 uleshort x Quantization %d,
  2833. >0 uleshort x (Decompresses to %d words)
  2834. # Type: farbfeld image.
  2835. # Url: http://tools.suckless.org/farbfeld/
  2836. # From: Ian D. Scott <ian@iandouglasscott.com>
  2837. #
  2838. 0 string farbfeld farbfeld image data,
  2839. >8 ubelong x %dx
  2840. >12 ubelong x \b%d
  2841. # Type: Microsoft DirectDraw Surface (DXGI formats)
  2842. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  2843. # From: Morten Hustveit <morten@debian.org>
  2844. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  2845. 0 name ms-directdraw-dx10
  2846. >0 ulelong x \b, DXGI format:
  2847. >0 ulelong 1 R32G32B32A32_TYPELESS
  2848. >0 ulelong 2 R32G32B32A32_FLOAT
  2849. >0 ulelong 3 R32G32B32A32_UINT
  2850. >0 ulelong 4 R32G32B32A32_SINT
  2851. >0 ulelong 5 R32G32B32_TYPELESS
  2852. >0 ulelong 6 R32G32B32_FLOAT
  2853. >0 ulelong 7 R32G32B32_UINT
  2854. >0 ulelong 8 R32G32B32_SINT
  2855. >0 ulelong 9 R16G16B16A16_TYPELESS
  2856. >0 ulelong 10 R16G16B16A16_FLOAT
  2857. >0 ulelong 11 R16G16B16A16_UNORM
  2858. >0 ulelong 12 R16G16B16A16_UINT
  2859. >0 ulelong 13 R16G16B16A16_SNORM
  2860. >0 ulelong 14 R16G16B16A16_SINT
  2861. >0 ulelong 15 R32G32_TYPELESS
  2862. >0 ulelong 16 R32G32_FLOAT
  2863. >0 ulelong 17 R32G32_UINT
  2864. >0 ulelong 18 R32G32_SINT
  2865. >0 ulelong 19 R32G8X24_TYPELESS
  2866. >0 ulelong 20 D32_FLOAT_S8X24_UINT
  2867. >0 ulelong 21 R32_FLOAT_X8X24_TYPELESS
  2868. >0 ulelong 22 X32_TYPELESS_G8X24_UINT
  2869. >0 ulelong 23 R10G10B10A2_TYPELESS
  2870. >0 ulelong 24 R10G10B10A2_UNORM
  2871. >0 ulelong 25 R10G10B10A2_UINT
  2872. >0 ulelong 26 R11G11B10_FLOAT
  2873. >0 ulelong 27 R8G8B8A8_TYPELESS
  2874. >0 ulelong 28 R8G8B8A8_UNORM
  2875. >0 ulelong 29 R8G8B8A8_UNORM_SRGB
  2876. >0 ulelong 30 R8G8B8A8_UINT
  2877. >0 ulelong 31 R8G8B8A8_SNORM
  2878. >0 ulelong 32 R8G8B8A8_SINT
  2879. >0 ulelong 33 R16G16_TYPELESS
  2880. >0 ulelong 34 R16G16_FLOAT
  2881. >0 ulelong 35 R16G16_UNORM
  2882. >0 ulelong 36 R16G16_UINT
  2883. >0 ulelong 37 R16G16_SNORM
  2884. >0 ulelong 38 R16G16_SINT
  2885. >0 ulelong 39 R32_TYPELESS
  2886. >0 ulelong 40 D32_FLOAT
  2887. >0 ulelong 41 R32_FLOAT
  2888. >0 ulelong 42 R32_UINT
  2889. >0 ulelong 43 R32_SINT
  2890. >0 ulelong 44 R24G8_TYPELESS
  2891. >0 ulelong 45 D24_UNORM_S8_UINT
  2892. >0 ulelong 46 R24_UNORM_X8_TYPELESS
  2893. >0 ulelong 47 X24_TYPELESS_G8_UINT
  2894. >0 ulelong 48 R8G8_TYPELESS
  2895. >0 ulelong 49 R8G8_UNORM
  2896. >0 ulelong 50 R8G8_UINT
  2897. >0 ulelong 51 R8G8_SNORM
  2898. >0 ulelong 52 R8G8_SINT
  2899. >0 ulelong 53 R16_TYPELESS
  2900. >0 ulelong 54 R16_FLOAT
  2901. >0 ulelong 55 D16_UNORM
  2902. >0 ulelong 56 R16_UNORM
  2903. >0 ulelong 57 R16_UINT
  2904. >0 ulelong 58 R16_SNORM
  2905. >0 ulelong 59 R16_SINT
  2906. >0 ulelong 60 R8_TYPELESS
  2907. >0 ulelong 61 R8_UNORM
  2908. >0 ulelong 62 R8_UINT
  2909. >0 ulelong 63 R8_SNORM
  2910. >0 ulelong 64 R8_SINT
  2911. >0 ulelong 65 A8_UNORM
  2912. >0 ulelong 66 R1_UNORM
  2913. >0 ulelong 67 R9G9B9E5_SHAREDEXP
  2914. >0 ulelong 68 R8G8_B8G8_UNORM
  2915. >0 ulelong 69 G8R8_G8B8_UNORM
  2916. >0 ulelong 70 BC1_TYPELESS
  2917. >0 ulelong 71 BC1_UNORM
  2918. >0 ulelong 72 BC1_UNORM_SRGB
  2919. >0 ulelong 73 BC2_TYPELESS
  2920. >0 ulelong 74 BC2_UNORM
  2921. >0 ulelong 75 BC2_UNORM_SRGB
  2922. >0 ulelong 76 BC3_TYPELESS
  2923. >0 ulelong 77 BC3_UNORM
  2924. >0 ulelong 78 BC3_UNORM_SRGB
  2925. >0 ulelong 79 BC4_TYPELESS
  2926. >0 ulelong 80 BC4_UNORM
  2927. >0 ulelong 81 BC4_SNORM
  2928. >0 ulelong 82 BC5_TYPELESS
  2929. >0 ulelong 83 BC5_UNORM
  2930. >0 ulelong 84 BC5_SNORM
  2931. >0 ulelong 85 B5G6R5_UNORM
  2932. >0 ulelong 86 B5G5R5A1_UNORM
  2933. >0 ulelong 87 B8G8R8A8_UNORM
  2934. >0 ulelong 88 B8G8R8X8_UNORM
  2935. >0 ulelong 89 R10G10B10_XR_BIAS_A2_UNORM
  2936. >0 ulelong 90 B8G8R8A8_TYPELESS
  2937. >0 ulelong 91 B8G8R8A8_UNORM_SRGB
  2938. >0 ulelong 92 B8G8R8X8_TYPELESS
  2939. >0 ulelong 93 B8G8R8X8_UNORM_SRGB
  2940. >0 ulelong 94 BC6H_TYPELESS
  2941. >0 ulelong 95 BC6H_UF16
  2942. >0 ulelong 96 BC6H_SF16
  2943. >0 ulelong 97 BC7_TYPELESS
  2944. >0 ulelong 98 BC7_UNORM
  2945. >0 ulelong 99 BC7_UNORM_SRGB
  2946. >0 ulelong 100 AYUV
  2947. >0 ulelong 101 Y410
  2948. >0 ulelong 102 Y416
  2949. >0 ulelong 103 NV12
  2950. >0 ulelong 104 P010
  2951. >0 ulelong 105 P016
  2952. >0 ulelong 106 420_OPAQUE
  2953. >0 ulelong 107 YUY2
  2954. >0 ulelong 108 Y210
  2955. >0 ulelong 109 Y216
  2956. >0 ulelong 110 NV11
  2957. >0 ulelong 111 AI44
  2958. >0 ulelong 112 IA44
  2959. >0 ulelong 113 P8
  2960. >0 ulelong 114 A8P8
  2961. >0 ulelong 115 B4G4R4A4_UNORM
  2962. >0 ulelong 116 XBOX_R10G10B10_7E3_A2_FLOAT
  2963. >0 ulelong 117 XBOX_R10G10B10_6E4_A2_FLOAT
  2964. >0 ulelong 118 XBOX_D16_UNORM_S8_UINT
  2965. >0 ulelong 119 XBOX_R16_UNORM_X8_TYPELESS
  2966. >0 ulelong 120 XBOX_X16_TYPELESS_G8_UINT
  2967. >0 ulelong 130 DXGI_FORMAT_P208
  2968. >0 ulelong 131 DXGI_FORMAT_V208
  2969. >0 ulelong 132 DXGI_FORMAT_V408
  2970. >0 ulelong 133 ASTC_4X4_TYPELESS
  2971. >0 ulelong 134 ASTC_4X4_UNORM
  2972. >0 ulelong 135 ASTC_4X4_UNORM_SRGB
  2973. >0 ulelong 137 ASTC_5X4_TYPELESS
  2974. >0 ulelong 138 ASTC_5X4_UNORM
  2975. >0 ulelong 139 ASTC_5X4_UNORM_SRGB
  2976. >0 ulelong 141 ASTC_5X5_TYPELESS
  2977. >0 ulelong 142 ASTC_5X5_UNORM
  2978. >0 ulelong 143 ASTC_5X5_UNORM_SRGB
  2979. >0 ulelong 145 ASTC_6X5_TYPELESS
  2980. >0 ulelong 146 ASTC_6X5_UNORM
  2981. >0 ulelong 147 ASTC_6X5_UNORM_SRGB
  2982. >0 ulelong 149 ASTC_6X6_TYPELESS
  2983. >0 ulelong 150 ASTC_6X6_UNORM
  2984. >0 ulelong 151 ASTC_6X6_UNORM_SRGB
  2985. >0 ulelong 153 ASTC_8X5_TYPELESS
  2986. >0 ulelong 154 ASTC_8X5_UNORM
  2987. >0 ulelong 155 ASTC_8X5_UNORM_SRGB
  2988. >0 ulelong 157 ASTC_8X6_TYPELESS
  2989. >0 ulelong 158 ASTC_8X6_UNORM
  2990. >0 ulelong 159 ASTC_8X6_UNORM_SRGB
  2991. >0 ulelong 161 ASTC_8X8_TYPELESS
  2992. >0 ulelong 162 ASTC_8X8_UNORM
  2993. >0 ulelong 163 ASTC_8X8_UNORM_SRGB
  2994. >0 ulelong 165 ASTC_10X5_TYPELESS
  2995. >0 ulelong 166 ASTC_10X5_UNORM
  2996. >0 ulelong 167 ASTC_10X5_UNORM_SRGB
  2997. >0 ulelong 169 ASTC_10X6_TYPELESS
  2998. >0 ulelong 170 ASTC_10X6_UNORM
  2999. >0 ulelong 171 ASTC_10X6_UNORM_SRGB
  3000. >0 ulelong 173 ASTC_10X8_TYPELESS
  3001. >0 ulelong 174 ASTC_10X8_UNORM
  3002. >0 ulelong 175 ASTC_10X8_UNORM_SRGB
  3003. >0 ulelong 177 ASTC_10X10_TYPELESS
  3004. >0 ulelong 178 ASTC_10X10_UNORM
  3005. >0 ulelong 179 ASTC_10X10_UNORM_SRGB
  3006. >0 ulelong 181 ASTC_12X10_TYPELESS
  3007. >0 ulelong 182 ASTC_12X10_UNORM
  3008. >0 ulelong 183 ASTC_12X10_UNORM_SRGB
  3009. >0 ulelong 185 ASTC_12X12_TYPELESS
  3010. >0 ulelong 186 ASTC_12X12_UNORM
  3011. >0 ulelong 187 ASTC_12X12_UNORM_SRGB
  3012. >0 ulelong 190 XBOX_R10G10B10_SNORM_A2_UNORM
  3013. >0 ulelong 189 XBOX_R4G4_UNORM
  3014. >0 ulelong 0xFFFFFFFF DXGI_FORMAT_FORCE_UINT
  3015. # Type: Microsoft DirectDraw Surface (common data)
  3016. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  3017. # From: Morten Hustveit <morten@debian.org>
  3018. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  3019. 0 name ms-directdraw-surface
  3020. >0x10 ulelong x %u x
  3021. >0x0C ulelong x %u
  3022. # Color depth.
  3023. >0x58 ulelong >0 \b, %u-bit color
  3024. # Determine the pixel format.
  3025. >0x50 ulelong&0x4 4
  3026. # FIXME: Handle DX10 and XBOX formats.
  3027. >>0x54 string DX10
  3028. >>>0x80 use ms-directdraw-dx10
  3029. >>0x54 string !DX10
  3030. >>>0x54 string x \b, compressed using %.4s
  3031. >0x50 ulelong&0x2 0x2 \b, alpha only
  3032. >0x50 ulelong&0x200 0x200 \b, YUV
  3033. >0x50 ulelong&0x20000 0x20000 \b, luminance
  3034. # RGB pixel format
  3035. >0x50 ulelong&0x40 0x40
  3036. # Determine the RGB format using the color masks.
  3037. # ulequad order: 0xGGGGGGGGRRRRRRRR, 0xAAAAAAAABBBBBBBB
  3038. >>0x58 ulelong 16
  3039. # NOTE: 15-bit color formats usually have 16-bit listed as the color depth.
  3040. >>>0x5C ulequad 0x000003E000007C00
  3041. >>>>0x64 ulequad 0x000000000000001F \b, RGB555
  3042. >>>0x5C ulequad 0x000003E000001F00
  3043. >>>>0x64 ulequad 0x000000000000007C \b, BGR555
  3044. >>>0x5C ulequad 0x000007E00000F800
  3045. >>>>0x64 ulequad 0x000000000000001F \b, RGB565
  3046. >>>0x5C ulequad 0x000007E000001F00
  3047. >>>>0x64 ulequad 0x00000000000000F8 \b, BGR565
  3048. >>>0x5C ulequad 0x000000F000000F00
  3049. >>>>0x64 ulequad 0x0000F0000000000F \b, ARGB4444
  3050. >>>0x5C ulequad 0x000000F00000000F
  3051. >>>>0x64 ulequad 0x0000F00000000F00 \b, ABGR4444
  3052. >>>0x5C ulequad 0x00000F000000F000
  3053. >>>>0x64 ulequad 0x0000000F000000F0 \b, RGBA4444
  3054. >>>0x5C ulequad 0x00000F00000000F0
  3055. >>>>0x64 ulequad 0x0000000F0000F000 \b, BGRA4444
  3056. >>>0x5C ulequad 0x000000F000000F00
  3057. >>>>0x64 ulequad 0x000000000000000F \b, xRGB4444
  3058. >>>0x5C ulequad 0x000000F00000000F
  3059. >>>>0x64 ulequad 0x0000000000000F00 \b, xBGR4444
  3060. >>>0x5C ulequad 0x00000F000000F000
  3061. >>>>0x64 ulequad 0x00000000000000F0 \b, RGBx4444
  3062. >>>0x5C ulequad 0x00000F00000000F0
  3063. >>>>0x64 ulequad 0x000000000000F000 \b, BGRx4444
  3064. >>>0x5C ulequad 0x000003E000007C00
  3065. >>>>0x64 ulequad 0x000080000000001F \b, ARGB1555
  3066. >>>0x5C ulequad 0x000003E000001F00
  3067. >>>>0x64 ulequad 0x000080000000007C \b, ABGR1555
  3068. >>>0x5C ulequad 0x000007C00000F800
  3069. >>>>0x64 ulequad 0x000000010000003E \b, RGBA5551
  3070. >>>0x5C ulequad 0x000007C00000003E
  3071. >>>>0x64 ulequad 0x000000010000F800 \b, BGRA5551
  3072. >>88 ulelong 24
  3073. >>>0x5C ulequad 0x0000FF0000FF0000
  3074. >>>>0x64 ulequad 0x00000000000000FF \b, RGB888
  3075. >>>0x5C ulequad 0x0000FF00000000FF
  3076. >>>>0x64 ulequad 0x0000000000FF0000 \b, BGR888
  3077. >>88 ulelong 32
  3078. >>>0x5C ulequad 0x0000FF0000FF0000
  3079. >>>>0x64 ulequad 0xFF000000000000FF \b, ARGB8888
  3080. >>>0x5C ulequad 0x0000FF00000000FF
  3081. >>>>0x64 ulequad 0xFF00000000FF0000 \b, ABGR8888
  3082. >>>0x5C ulequad 0x00FF0000FF000000
  3083. >>>>0x64 ulequad 0x000000FF0000FF00 \b, RGBA8888
  3084. >>>0x5C ulequad 0x00FF00000000FF00
  3085. >>>>0x64 ulequad 0x000000FFFF000000 \b, BGBA8888
  3086. >>>0x5C ulequad 0x0000FF0000FF0000
  3087. >>>>0x64 ulequad 0x00000000000000FF \b, xRGB8888
  3088. >>>0x5C ulequad 0x0000FF00000000FF
  3089. >>>>0x64 ulequad 0x0000000000FF0000 \b, xBGR8888
  3090. >>>0x5C ulequad 0x00FF0000FF000000
  3091. >>>>0x64 ulequad 0x000000000000FF00 \b, RGBx8888
  3092. >>>0x5C ulequad 0x00FF00000000FF00
  3093. >>>>0x64 ulequad 0x00000000FF000000 \b, BGBx8888
  3094. # Less common 32-bit color formats.
  3095. >>>0x5C ulequad 0xFFFF00000000FFFF
  3096. >>>>0x64 ulequad 0x0000000000000000 \b, G16R16
  3097. >>>0x5C ulequad 0x0000FFFFFFFF0000
  3098. >>>>0x64 ulequad 0x0000000000000000 \b, R16G16
  3099. >>>0x5C ulequad 0x000FFC003FF00000
  3100. >>>>0x64 ulequad 0xC0000000000003FF \b, A2R10G10B10
  3101. >>>0x5C ulequad 0x000FFC00000003FF
  3102. >>>>0x64 ulequad 0xC00000003FF00000 \b, A2B10G10R10
  3103. # Type: Microsoft DirectDraw Surface
  3104. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  3105. # From: Morten Hustveit <morten@debian.org>
  3106. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  3107. 0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS):
  3108. >0 use ms-directdraw-surface
  3109. # Type: Sega PVR image.
  3110. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3111. # References:
  3112. # - https://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
  3113. # - https://github.com/yazgoo/pvrx2png
  3114. # - https://github.com/nickworonekin/puyotools
  3115. # Sega PVR header.
  3116. 0 name sega-pvr-image-header
  3117. >0x0C uleshort x %u x
  3118. >0x0E uleshort x %u
  3119. # Image format.
  3120. >0x08 ubyte 0 \b, ARGB1555
  3121. >0x08 ubyte 1 \b, RGB565
  3122. >0x08 ubyte 2 \b, ARGB4444
  3123. >0x08 ubyte 3 \b, YUV442
  3124. >0x08 ubyte 4 \b, Bump
  3125. >0x08 ubyte 5 \b, 4bpp
  3126. >0x08 ubyte 6 \b, 8bpp
  3127. # Image data type.
  3128. >0x09 ubyte 0x01 \b, square twiddled
  3129. >0x09 ubyte 0x02 \b, square twiddled & mipmap
  3130. >0x09 ubyte 0x03 \b, VQ
  3131. >0x09 ubyte 0x04 \b, VQ & mipmap
  3132. >0x09 ubyte 0x05 \b, 8-bit CLUT twiddled
  3133. >0x09 ubyte 0x06 \b, 4-bit CLUT twiddled
  3134. >0x09 ubyte 0x07 \b, 8-bit direct twiddled
  3135. >0x09 ubyte 0x08 \b, 4-bit direct twiddled
  3136. >0x09 ubyte 0x09 \b, rectangle
  3137. >0x09 ubyte 0x0B \b, rectangular stride
  3138. >0x09 ubyte 0x0D \b, rectangular twiddled
  3139. >0x09 ubyte 0x10 \b, small VQ
  3140. >0x09 ubyte 0x11 \b, small VQ & mipmap
  3141. >0x09 ubyte 0x12 \b, square twiddled & mipmap
  3142. # Sega PVR image.
  3143. 0 string PVRT
  3144. >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  3145. >>0x20 use ms-directdraw-surface
  3146. >0x10 ubelong !0x44445320 Sega PVR image:
  3147. >>0 use sega-pvr-image-header
  3148. # Sega PVR image with GBIX.
  3149. 0 string GBIX
  3150. >0x10 string PVRT
  3151. >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  3152. >>>0x20 use ms-directdraw-surface
  3153. >>0x10 ubelong !0x44445320 Sega PVR image:
  3154. >>>0x10 use sega-pvr-image-header
  3155. >>0x08 ulelong x \b, global index = %u
  3156. # Sega GVR image with GBIX.
  3157. >0x10 string GVRT Sega GVR image:
  3158. >>0x10 use sega-gvr-image-header
  3159. >>0x08 ubelong x \b, global index = %u
  3160. # Sega GVR header.
  3161. 0 name sega-gvr-image-header
  3162. >0x0C ubeshort x %u x
  3163. >0x0E ubeshort x %u
  3164. # Image data format.
  3165. >0x0B ubyte 0 \b, I4
  3166. >0x0B ubyte 1 \b, I8
  3167. >0x0B ubyte 2 \b, IA4
  3168. >0x0B ubyte 3 \b, IA8
  3169. >0x0B ubyte 4 \b, RGB565
  3170. >0x0B ubyte 5 \b, RGB5A3
  3171. >0x0B ubyte 6 \b, ARGB8888
  3172. >0x0B ubyte 8 \b, CI4
  3173. >0x0B ubyte 9 \b, CI8
  3174. >0x0B ubyte 14 \b, DXT1
  3175. # Sega GVR image.
  3176. 0 string GVRT Sega GVR image:
  3177. >0x10 use sega-gvr-image-header
  3178. # Sega GVR image with GCIX. (Wii)
  3179. 0 string GCIX
  3180. >0x10 string GVRT Sega GVR image:
  3181. >>0x10 use sega-gvr-image-header
  3182. >>0x08 ubelong x \b, global index = %u
  3183. # Light Field Picture
  3184. # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
  3185. # Typical file extensions: .lfp .lfr .lfx
  3186. 0 ubelong 0x894C4650
  3187. >4 ubelong 0x0D0A1A0A Lytro Light Field Picture
  3188. >>8 ubelong x \b, version %u
  3189. # Type: ARRI Raw Image
  3190. # Info: SMPTE RDD30:2014
  3191. # From: Harry Mallon <hjmallon at gmail.com>
  3192. 0 string ARRI ARRI ARI image data,
  3193. >4 ulelong 0x78563412 little-endian,
  3194. >4 ulelong 0x12345678 big-endian,
  3195. >12 ulelong x version %d,
  3196. >20 ulelong x %dx
  3197. >24 ulelong x \b%d
  3198. # Type: Khronos KTX texture.
  3199. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3200. # Reference: https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
  3201. # https://www.iana.org/assignments/media-types/image/ktx
  3202. # glEnum decoding.
  3203. # NOTE: Only the most common formats are listed here.
  3204. 0 name khronos-ktx-glEnum
  3205. >0 ulelong 0x1907 \b, RGB
  3206. >0 ulelong 0x1908 \b, RGBA
  3207. >0 ulelong 0x1909 \b, LUMINANCE
  3208. >0 ulelong 0x190A \b, LUMINANCE_ALPHA
  3209. >0 ulelong 0x80E1 \b, BGR
  3210. >0 ulelong 0x80E2 \b, BGRA
  3211. >0 ulelong 0x83A0 \b, RGB_S3TC
  3212. >0 ulelong 0x83A1 \b, RGB4_S3TC
  3213. >0 ulelong 0x83A2 \b, RGBA_S3TC
  3214. >0 ulelong 0x83A3 \b, RGBA4_S3TC
  3215. >0 ulelong 0x83A4 \b, RGBA_DXT5_S3TC
  3216. >0 ulelong 0x83A5 \b, RGBA4_DXT5_S3TC
  3217. >0 ulelong 0x83F0 \b, COMPRESSED_RGB_S3TC_DXT1_EXT
  3218. >0 ulelong 0x83F1 \b, COMPRESSED_RGBA_S3TC_DXT1_EXT
  3219. >0 ulelong 0x83F2 \b, COMPRESSED_RGBA_S3TC_DXT3_EXT
  3220. >0 ulelong 0x83F3 \b, COMPRESSED_RGBA_S3TC_DXT5_EXT
  3221. >0 ulelong 0x8D64 \b, ETC1_RGB8_OES
  3222. >0 ulelong 0x9270 \b, COMPRESSED_R11_EAC
  3223. >0 ulelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
  3224. >0 ulelong 0x9272 \b, COMPRESSED_RG11_EAC
  3225. >0 ulelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
  3226. >0 ulelong 0x9274 \b, COMPRESSED_RGB8_ETC2
  3227. >0 ulelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
  3228. >0 ulelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
  3229. >0 ulelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
  3230. >0 ulelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
  3231. >0 ulelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
  3232. >0 ulelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
  3233. >0 ulelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
  3234. >0 ulelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
  3235. >0 ulelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
  3236. >0 ulelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
  3237. >0 ulelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
  3238. >0 ulelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
  3239. >0 ulelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
  3240. >0 ulelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
  3241. >0 ulelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
  3242. >0 ulelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
  3243. >0 ulelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
  3244. >0 ulelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
  3245. >0 ulelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
  3246. >0 ulelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
  3247. >0 ulelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
  3248. >0 ulelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
  3249. >0 ulelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
  3250. >0 ulelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
  3251. >0 ulelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
  3252. >0 ulelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
  3253. >0 ulelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
  3254. >0 ulelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
  3255. >0 ulelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
  3256. >0 ulelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
  3257. >0 ulelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
  3258. >0 ulelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
  3259. >0 ulelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
  3260. # Endian-specific KTX header.
  3261. # TODO: glType (all textures I've seen so far are GL_UNSIGNED_BYTE)
  3262. 0 name khronos-ktx-endian-header
  3263. >20 ulelong x \b, %u
  3264. >24 ulelong >1 x %u
  3265. >28 ulelong >1 x %u
  3266. >8 ulelong >0
  3267. >>8 use khronos-ktx-glEnum
  3268. >8 ulelong 0
  3269. >>12 use khronos-ktx-glEnum
  3270. # Main KTX header.
  3271. # Determine endianness, then check the rest of the header.
  3272. 0 string \xABKTX\ 11\xBB\r\n\x1A\n Khronos KTX texture
  3273. !:mime image/ktx
  3274. !:ext ktx
  3275. >12 ulelong 0x04030201 (little-endian)
  3276. >>16 use khronos-ktx-endian-header
  3277. >12 ubelong 0x04030201 (big-endian)
  3278. >>16 use \^khronos-ktx-endian-header
  3279. # Type: Khronos KTX2 texture.
  3280. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3281. # Based on draft19.
  3282. # Reference: http://github.khronos.org/KTX-Specification/
  3283. # https://www.iana.org/assignments/media-types/image/ktx2
  3284. # Supercompression enum.
  3285. 0 name khronos-ktx2-supercompression
  3286. >0 ulelong 1 BasisLZ
  3287. >0 ulelong 2 Zstandard
  3288. >0 ulelong 3 ZLIB
  3289. # Vulkan format identifier.
  3290. # NOTE: Formats prohibited from KTX2 are commented out.
  3291. 0 name khronos-ktx2-vkFormat
  3292. >0 ulelong 0 UNDEFINED
  3293. >0 ulelong 1 R4G4_UNORM_PACK8
  3294. >0 ulelong 2 R4G4B4A4_UNORM_PACK16
  3295. >0 ulelong 3 B4G4R4A4_UNORM_PACK16
  3296. >0 ulelong 4 R5G6B5_UNORM_PACK16
  3297. >0 ulelong 5 B5G6R5_UNORM_PACK16
  3298. >0 ulelong 6 R5G5B5A1_UNORM_PACK16
  3299. >0 ulelong 7 B5G5R5A1_UNORM_PACK16
  3300. >0 ulelong 8 A1R5G5B5_UNORM_PACK16
  3301. >0 ulelong 9 R8_UNORM
  3302. >0 ulelong 10 R8_SNORM
  3303. #>0 ulelong 11 R8_USCALED
  3304. #>0 ulelong 12 R8_SSCALED
  3305. >0 ulelong 13 R8_UINT
  3306. >0 ulelong 14 R8_SINT
  3307. >0 ulelong 15 R8_SRGB
  3308. >0 ulelong 16 R8G8_UNORM
  3309. >0 ulelong 17 R8G8_SNORM
  3310. #>0 ulelong 18 R8G8_USCALED
  3311. #>0 ulelong 19 R8G8_SSCALED
  3312. >0 ulelong 20 R8G8_UINT
  3313. >0 ulelong 21 R8G8_SINT
  3314. >0 ulelong 22 R8G8_SRGB
  3315. >0 ulelong 23 R8G8B8_UNORM
  3316. >0 ulelong 24 R8G8B8_SNORM
  3317. #>0 ulelong 25 R8G8B8_USCALED
  3318. #>0 ulelong 26 R8G8B8_SSCALED
  3319. >0 ulelong 27 R8G8B8_UINT
  3320. >0 ulelong 28 R8G8B8_SINT
  3321. >0 ulelong 29 R8G8B8_SRGB
  3322. >0 ulelong 30 B8G8R8_UNORM
  3323. >0 ulelong 31 B8G8R8_SNORM
  3324. #>0 ulelong 32 B8G8R8_USCALED
  3325. #>0 ulelong 33 B8G8R8_SSCALED
  3326. >0 ulelong 34 B8G8R8_UINT
  3327. >0 ulelong 35 B8G8R8_SINT
  3328. >0 ulelong 36 B8G8R8_SRGB
  3329. >0 ulelong 37 R8G8B8A8_UNORM
  3330. >0 ulelong 38 R8G8B8A8_SNORM
  3331. #>0 ulelong 39 R8G8B8A8_USCALED
  3332. #>0 ulelong 40 R8G8B8A8_SSCALED
  3333. >0 ulelong 41 R8G8B8A8_UINT
  3334. >0 ulelong 42 R8G8B8A8_SINT
  3335. >0 ulelong 43 R8G8B8A8_SRGB
  3336. >0 ulelong 44 B8G8R8A8_UNORM
  3337. >0 ulelong 45 B8G8R8A8_SNORM
  3338. #>0 ulelong 46 B8G8R8A8_USCALED
  3339. #>0 ulelong 47 B8G8R8A8_SSCALED
  3340. >0 ulelong 48 B8G8R8A8_UINT
  3341. >0 ulelong 49 B8G8R8A8_SINT
  3342. >0 ulelong 50 B8G8R8A8_SRGB
  3343. #>0 ulelong 51 A8B8G8R8_UNORM_PACK32
  3344. #>0 ulelong 52 A8B8G8R8_SNORM_PACK32
  3345. #>0 ulelong 53 A8B8G8R8_USCALED_PACK32
  3346. #>0 ulelong 54 A8B8G8R8_SSCALED_PACK32
  3347. #>0 ulelong 55 A8B8G8R8_UINT_PACK32
  3348. #>0 ulelong 56 A8B8G8R8_SINT_PACK32
  3349. #>0 ulelong 57 A8B8G8R8_SRGB_PACK32
  3350. >0 ulelong 58 A2R10G10B10_UNORM_PACK32
  3351. >0 ulelong 59 A2R10G10B10_SNORM_PACK32
  3352. #>0 ulelong 60 A2R10G10B10_USCALED_PACK32
  3353. #>0 ulelong 61 A2R10G10B10_SSCALED_PACK32
  3354. >0 ulelong 62 A2R10G10B10_UINT_PACK32
  3355. >0 ulelong 63 A2R10G10B10_SINT_PACK32
  3356. >0 ulelong 64 A2B10G10R10_UNORM_PACK32
  3357. >0 ulelong 65 A2B10G10R10_SNORM_PACK32
  3358. #>0 ulelong 66 A2B10G10R10_USCALED_PACK32
  3359. #>0 ulelong 67 A2B10G10R10_SSCALED_PACK32
  3360. >0 ulelong 68 A2B10G10R10_UINT_PACK32
  3361. >0 ulelong 69 A2B10G10R10_SINT_PACK32
  3362. >0 ulelong 70 R16_UNORM
  3363. >0 ulelong 71 R16_SNORM
  3364. #>0 ulelong 72 R16_USCALED
  3365. #>0 ulelong 73 R16_SSCALED
  3366. >0 ulelong 74 R16_UINT
  3367. >0 ulelong 75 R16_SINT
  3368. >0 ulelong 76 R16_SFLOAT
  3369. >0 ulelong 77 R16G16_UNORM
  3370. >0 ulelong 78 R16G16_SNORM
  3371. #>0 ulelong 79 R16G16_USCALED
  3372. #>0 ulelong 80 R16G16_SSCALED
  3373. >0 ulelong 81 R16G16_UINT
  3374. >0 ulelong 82 R16G16_SINT
  3375. >0 ulelong 83 R16G16_SFLOAT
  3376. >0 ulelong 84 R16G16B16_UNORM
  3377. >0 ulelong 85 R16G16B16_SNORM
  3378. #>0 ulelong 86 R16G16B16_USCALED
  3379. #>0 ulelong 87 R16G16B16_SSCALED
  3380. >0 ulelong 88 R16G16B16_UINT
  3381. >0 ulelong 89 R16G16B16_SINT
  3382. >0 ulelong 90 R16G16B16_SFLOAT
  3383. >0 ulelong 91 R16G16B16A16_UNORM
  3384. >0 ulelong 92 R16G16B16A16_SNORM
  3385. #>0 ulelong 93 R16G16B16A16_USCALED
  3386. #>0 ulelong 94 R16G16B16A16_SSCALED
  3387. >0 ulelong 95 R16G16B16A16_UINT
  3388. >0 ulelong 96 R16G16B16A16_SINT
  3389. >0 ulelong 97 R16G16B16A16_SFLOAT
  3390. >0 ulelong 98 R32_UINT
  3391. >0 ulelong 99 R32_SINT
  3392. >0 ulelong 100 R32_SFLOAT
  3393. >0 ulelong 101 R32G32_UINT
  3394. >0 ulelong 102 R32G32_SINT
  3395. >0 ulelong 103 R32G32_SFLOAT
  3396. >0 ulelong 104 R32G32B32_UINT
  3397. >0 ulelong 105 R32G32B32_SINT
  3398. >0 ulelong 106 R32G32B32_SFLOAT
  3399. >0 ulelong 107 R32G32B32A32_UINT
  3400. >0 ulelong 108 R32G32B32A32_SINT
  3401. >0 ulelong 109 R32G32B32A32_SFLOAT
  3402. >0 ulelong 110 R64_UINT
  3403. >0 ulelong 111 R64_SINT
  3404. >0 ulelong 112 R64_SFLOAT
  3405. >0 ulelong 113 R64G64_UINT
  3406. >0 ulelong 114 R64G64_SINT
  3407. >0 ulelong 115 R64G64_SFLOAT
  3408. >0 ulelong 116 R64G64B64_UINT
  3409. >0 ulelong 117 R64G64B64_SINT
  3410. >0 ulelong 118 R64G64B64_SFLOAT
  3411. >0 ulelong 119 R64G64B64A64_UINT
  3412. >0 ulelong 120 R64G64B64A64_SINT
  3413. >0 ulelong 121 R64G64B64A64_SFLOAT
  3414. >0 ulelong 122 B10G11R11_UFLOAT_PACK32
  3415. >0 ulelong 123 E5B9G9R9_UFLOAT_PACK32
  3416. >0 ulelong 124 D16_UNORM
  3417. >0 ulelong 125 X8_D24_UNORM_PACK32
  3418. >0 ulelong 126 D32_SFLOAT
  3419. >0 ulelong 127 S8_UINT
  3420. >0 ulelong 128 D16_UNORM_S8_UINT
  3421. >0 ulelong 129 D24_UNORM_S8_UINT
  3422. >0 ulelong 130 D32_SFLOAT_S8_UINT
  3423. >0 ulelong 131 BC1_RGB_UNORM_BLOCK
  3424. >0 ulelong 132 BC1_RGB_SRGB_BLOCK
  3425. >0 ulelong 133 BC1_RGBA_UNORM_BLOCK
  3426. >0 ulelong 134 BC1_RGBA_SRGB_BLOCK
  3427. >0 ulelong 135 BC2_UNORM_BLOCK
  3428. >0 ulelong 136 BC2_SRGB_BLOCK
  3429. >0 ulelong 137 BC3_UNORM_BLOCK
  3430. >0 ulelong 138 BC3_SRGB_BLOCK
  3431. >0 ulelong 139 BC4_UNORM_BLOCK
  3432. >0 ulelong 140 BC4_SNORM_BLOCK
  3433. >0 ulelong 141 BC5_UNORM_BLOCK
  3434. >0 ulelong 142 BC5_SNORM_BLOCK
  3435. >0 ulelong 143 BC6H_UFLOAT_BLOCK
  3436. >0 ulelong 144 BC6H_SFLOAT_BLOCK
  3437. >0 ulelong 145 BC7_UNORM_BLOCK
  3438. >0 ulelong 146 BC7_SRGB_BLOCK
  3439. >0 ulelong 147 ETC2_R8G8B8_UNORM_BLOCK
  3440. >0 ulelong 148 ETC2_R8G8B8_SRGB_BLOCK
  3441. >0 ulelong 149 ETC2_R8G8B8A1_UNORM_BLOCK
  3442. >0 ulelong 150 ETC2_R8G8B8A1_SRGB_BLOCK
  3443. >0 ulelong 151 ETC2_R8G8B8A8_UNORM_BLOCK
  3444. >0 ulelong 152 ETC2_R8G8B8A8_SRGB_BLOCK
  3445. >0 ulelong 153 EAC_R11_UNORM_BLOCK
  3446. >0 ulelong 154 EAC_R11_SNORM_BLOCK
  3447. >0 ulelong 155 EAC_R11G11_UNORM_BLOCK
  3448. >0 ulelong 156 EAC_R11G11_SNORM_BLOCK
  3449. >0 ulelong 157 ASTC_4x4_UNORM_BLOCK
  3450. >0 ulelong 158 ASTC_4x4_SRGB_BLOCK
  3451. >0 ulelong 159 ASTC_5x4_UNORM_BLOCK
  3452. >0 ulelong 160 ASTC_5x4_SRGB_BLOCK
  3453. >0 ulelong 161 ASTC_5x5_UNORM_BLOCK
  3454. >0 ulelong 162 ASTC_5x5_SRGB_BLOCK
  3455. >0 ulelong 163 ASTC_6x5_UNORM_BLOCK
  3456. >0 ulelong 164 ASTC_6x5_SRGB_BLOCK
  3457. >0 ulelong 165 ASTC_6x6_UNORM_BLOCK
  3458. >0 ulelong 166 ASTC_6x6_SRGB_BLOCK
  3459. >0 ulelong 167 ASTC_8x5_UNORM_BLOCK
  3460. >0 ulelong 168 ASTC_8x5_SRGB_BLOCK
  3461. >0 ulelong 169 ASTC_8x6_UNORM_BLOCK
  3462. >0 ulelong 170 ASTC_8x6_SRGB_BLOCK
  3463. >0 ulelong 171 ASTC_8x8_UNORM_BLOCK
  3464. >0 ulelong 172 ASTC_8x8_SRGB_BLOCK
  3465. >0 ulelong 173 ASTC_10x5_UNORM_BLOCK
  3466. >0 ulelong 174 ASTC_10x5_SRGB_BLOCK
  3467. >0 ulelong 175 ASTC_10x6_UNORM_BLOCK
  3468. >0 ulelong 176 ASTC_10x6_SRGB_BLOCK
  3469. >0 ulelong 177 ASTC_10x8_UNORM_BLOCK
  3470. >0 ulelong 178 ASTC_10x8_SRGB_BLOCK
  3471. >0 ulelong 179 ASTC_10x10_UNORM_BLOCK
  3472. >0 ulelong 180 ASTC_10x10_SRGB_BLOCK
  3473. >0 ulelong 181 ASTC_12x10_UNORM_BLOCK
  3474. >0 ulelong 182 ASTC_12x10_SRGB_BLOCK
  3475. >0 ulelong 183 ASTC_12x12_UNORM_BLOCK
  3476. >0 ulelong 184 ASTC_12x12_SRGB_BLOCK
  3477. >0 ulelong 1000156000 G8B8G8R8_422_UNORM
  3478. >0 ulelong 1000156001 B8G8R8G8_422_UNORM
  3479. >0 ulelong 1000156002 G8_B8_R8_3PLANE_420_UNORM
  3480. >0 ulelong 1000156003 G8_B8R8_2PLANE_420_UNORM
  3481. >0 ulelong 1000156004 G8_B8_R8_3PLANE_422_UNORM
  3482. >0 ulelong 1000156005 G8_B8R8_2PLANE_422_UNORM
  3483. >0 ulelong 1000156006 G8_B8_R8_3PLANE_444_UNORM
  3484. >0 ulelong 1000156007 R10X6_UNORM_PACK16
  3485. >0 ulelong 1000156008 R10X6G10X6_UNORM_2PACK16
  3486. >0 ulelong 1000156009 R10X6G10X6B10X6A10X6_UNORM_4PACK16
  3487. >0 ulelong 1000156010 G10X6B10X6G10X6R10X6_422_UNORM_4PACK16
  3488. >0 ulelong 1000156011 B10X6G10X6R10X6G10X6_422_UNORM_4PACK16
  3489. >0 ulelong 1000156012 G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16
  3490. >0 ulelong 1000156013 G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
  3491. >0 ulelong 1000156014 G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16
  3492. >0 ulelong 1000156015 G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16
  3493. >0 ulelong 1000156016 G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16
  3494. >0 ulelong 1000156017 R12X4_UNORM_PACK16
  3495. >0 ulelong 1000156018 R12X4G12X4_UNORM_2PACK16
  3496. >0 ulelong 1000156019 R12X4G12X4B12X4A12X4_UNORM_4PACK16
  3497. >0 ulelong 1000156020 G12X4B12X4G12X4R12X4_422_UNORM_4PACK16
  3498. >0 ulelong 1000156021 B12X4G12X4R12X4G12X4_422_UNORM_4PACK16
  3499. >0 ulelong 1000156022 G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16
  3500. >0 ulelong 1000156023 G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16
  3501. >0 ulelong 1000156024 G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16
  3502. >0 ulelong 1000156025 G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16
  3503. >0 ulelong 1000156026 G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16
  3504. >0 ulelong 1000156027 G16B16G16R16_422_UNORM
  3505. >0 ulelong 1000156028 B16G16R16G16_422_UNORM
  3506. >0 ulelong 1000156029 G16_B16_R16_3PLANE_420_UNORM
  3507. >0 ulelong 1000156030 G16_B16R16_2PLANE_420_UNORM
  3508. >0 ulelong 1000156031 G16_B16_R16_3PLANE_422_UNORM
  3509. >0 ulelong 1000156032 G16_B16R16_2PLANE_422_UNORM
  3510. >0 ulelong 1000156033 G16_B16_R16_3PLANE_444_UNORM
  3511. >0 ulelong 1000054000 PVRTC1_2BPP_UNORM_BLOCK_IMG
  3512. >0 ulelong 1000054001 PVRTC1_4BPP_UNORM_BLOCK_IMG
  3513. >0 ulelong 1000054002 PVRTC2_2BPP_UNORM_BLOCK_IMG
  3514. >0 ulelong 1000054003 PVRTC2_4BPP_UNORM_BLOCK_IMG
  3515. >0 ulelong 1000054004 PVRTC1_2BPP_SRGB_BLOCK_IMG
  3516. >0 ulelong 1000054005 PVRTC1_4BPP_SRGB_BLOCK_IMG
  3517. >0 ulelong 1000054006 PVRTC2_2BPP_SRGB_BLOCK_IMG
  3518. >0 ulelong 1000054007 PVRTC2_4BPP_SRGB_BLOCK_IMG
  3519. >0 ulelong 1000066000 ASTC_4x4_SFLOAT_BLOCK_EXT
  3520. >0 ulelong 1000066001 ASTC_5x4_SFLOAT_BLOCK_EXT
  3521. >0 ulelong 1000066002 ASTC_5x5_SFLOAT_BLOCK_EXT
  3522. >0 ulelong 1000066003 ASTC_6x5_SFLOAT_BLOCK_EXT
  3523. >0 ulelong 1000066004 ASTC_6x6_SFLOAT_BLOCK_EXT
  3524. >0 ulelong 1000066005 ASTC_8x5_SFLOAT_BLOCK_EXT
  3525. >0 ulelong 1000066006 ASTC_8x6_SFLOAT_BLOCK_EXT
  3526. >0 ulelong 1000066007 ASTC_8x8_SFLOAT_BLOCK_EXT
  3527. >0 ulelong 1000066008 ASTC_10x5_SFLOAT_BLOCK_EXT
  3528. >0 ulelong 1000066009 ASTC_10x6_SFLOAT_BLOCK_EXT
  3529. >0 ulelong 1000066010 ASTC_10x8_SFLOAT_BLOCK_EXT
  3530. >0 ulelong 1000066011 ASTC_10x10_SFLOAT_BLOCK_EXT
  3531. >0 ulelong 1000066012 ASTC_12x10_SFLOAT_BLOCK_EXT
  3532. >0 ulelong 1000066013 ASTC_12x12_SFLOAT_BLOCK_EXT
  3533. # Main KTX2 header.
  3534. 0 string \xABKTX\ 20\xBB\r\n\x1A\n Khronos KTX2 texture
  3535. !:mime image/ktx2
  3536. !:ext ktx2
  3537. >20 ulelong x \b, %u
  3538. >24 ulelong >1 x %u
  3539. >28 ulelong >1 x %u
  3540. >32 ulelong >1 \b, %u layers
  3541. >36 ulelong >1 \b, %u faces
  3542. >40 ulelong >1 \b, %u mipmaps
  3543. >44 ulelong >0 \b,
  3544. >>44 use khronos-ktx2-supercompression
  3545. >12 ulelong >0 \b,
  3546. >>12 use khronos-ktx2-vkFormat
  3547. # Type: Valve VTF texture.
  3548. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3549. # References:
  3550. # - https://developer.valvesoftware.com/wiki/Valve_Texture_Format
  3551. # VTF image formats.
  3552. 0 name vtf-image-format
  3553. >0 ulelong 0 RGBA8888
  3554. >0 ulelong 1 ABGR8888
  3555. >0 ulelong 2 RGB888
  3556. >0 ulelong 3 BGR888
  3557. >0 ulelong 4 RGB565
  3558. >0 ulelong 5 I8
  3559. >0 ulelong 6 IA88
  3560. >0 ulelong 7 P8
  3561. >0 ulelong 8 A8
  3562. >0 ulelong 9 RGB888 (bluescreen)
  3563. >0 ulelong 10 BGR888 (bluescreen)
  3564. >0 ulelong 11 ARGB8888
  3565. >0 ulelong 12 BGRA8888
  3566. >0 ulelong 13 DXT1
  3567. >0 ulelong 14 DXT3
  3568. >0 ulelong 15 DXT5
  3569. >0 ulelong 16 BGRx8888
  3570. >0 ulelong 17 BGR565
  3571. >0 ulelong 18 BGRx5551
  3572. >0 ulelong 19 BGRA4444
  3573. >0 ulelong 20 DXT1+A1
  3574. >0 ulelong 21 BGRA5551
  3575. >0 ulelong 22 UV88
  3576. >0 ulelong 23 UVWQ8888
  3577. >0 ulelong 24 RGBA16161616F
  3578. >0 ulelong 25 RGBA16161616
  3579. >0 ulelong 26 UVLX8888
  3580. # Main VTF header.
  3581. 0 string VTF\0 Valve Texture Format
  3582. >4 ulelong x v%u
  3583. >8 ulelong x \b.%u
  3584. >0x10 uleshort x \b, %u
  3585. >0x12 uleshort >1 x %u
  3586. >4 lequad 0x0000000700000002
  3587. >>0x3F uleshort >1 x %u
  3588. >0x18 uleshort >1 \b, %u frames
  3589. >0x38 ubyte x \b, mipmaps: %u
  3590. >0x34 ulelong >-1 \b,
  3591. >>0x34 use vtf-image-format
  3592. # Type: Valve VTF3 (PS3) texture.
  3593. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3594. 0 string VTF3 Valve Texture Format (PS3)
  3595. >0x14 ubeshort x \b, %u
  3596. >0x16 ubeshort x \b x %u
  3597. >0x10 ubelong&0x2000 0 \b, DXT1
  3598. >0x10 ubelong&0x2000 0x2000 \b, DXT5
  3599. # Type: ASTC texture.
  3600. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3601. # References:
  3602. # - https://stackoverflow.com/questions/22600678/determine-internal-format-of-given-astc-compressed-image-through-its-header
  3603. # - https://stackoverflow.com/a/22682244
  3604. 0 ulelong 0x5ca1ab13 ASTC
  3605. >4 ubyte x %u
  3606. >5 ubyte x \bx%u
  3607. >6 ubyte >1 \bx%u
  3608. # X, Y, and Z dimensions are stored as 24-bit LE.
  3609. # Pretend it's 32-bit and mask off the high byte.
  3610. >7 ulelong&0x00FFFFFF x texture, %u
  3611. >10 ulelong&0x00FFFFFF x x %u
  3612. >13 ulelong&0x00FFFFFF >1 x %u
  3613. # Zebra Metafile graphic
  3614. # http://www.fileformat.info/format/zbr/egff.htm
  3615. 0 ubeshort 0x9a02 Zebra Metafile graphic
  3616. >2 uleshort 1 (version 1.x)
  3617. >2 uleshort 2 (version 1.1x or 1.2x)
  3618. >2 uleshort 3 (version 1.49)
  3619. >2 uleshort 4 (version 1.50)
  3620. >4 string x (comment = %s)
  3621. # Microsoft Paint graphic
  3622. # http://www.fileformat.info/format/mspaint/egff.htm
  3623. 0 string DanM Microsoft Paint image data (version 1.x)
  3624. >4 uleshort x (%d
  3625. >>6 uleshort x x %d)
  3626. 0 string LinS Microsoft Paint image data (version 2.0)
  3627. >4 uleshort x (%d
  3628. >>6 uleshort x x %d)
  3629. # reMarkable tablet internal file format (https://www.remarkable.com/)
  3630. # https://github.com/ax3l/lines-are-beautiful
  3631. # https://plasma.ninja/blog/devices/remarkable/binary/format/2017/12/26/\
  3632. # reMarkable-lines-file-format.html#what-to-do-next
  3633. # from Axel Huebl
  3634. 0 string reMarkable
  3635. >11 string lines
  3636. >>17 string with
  3637. >>>22 string selections
  3638. >>>>33 string and
  3639. >>>>>37 string layers
  3640. >>>>>>43 ulelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
  3641. # newer per-page files for the reMarkable
  3642. >11 string .lines
  3643. >>18 string file,
  3644. >>>24 string version=
  3645. >>>>32 ubyte x reMarkable tablet page (v%c), 1404 x 1872,
  3646. >>>>>43 ulelong x %d layer(s)
  3647. # Type: PVR3 texture.
  3648. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3649. # References:
  3650. # - http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
  3651. # PVR3 pixel formats.
  3652. 0 name pvr3-pixel-format
  3653. >0 ulelong 0 PVRTC 2bpp RGB
  3654. >0 ulelong 1 PVRTC 2bpp RGBA
  3655. >0 ulelong 2 PVRTC 4bpp RGB
  3656. >0 ulelong 3 PVRTC 4bpp RGBA
  3657. >0 ulelong 4 PVRTC-II 2bpp
  3658. >0 ulelong 5 PVRTC-II 4bpp
  3659. >0 ulelong 6 ETC1
  3660. >0 ulelong 7 DXT1
  3661. >0 ulelong 8 DXT2
  3662. >0 ulelong 9 DXT3
  3663. >0 ulelong 10 DXT4
  3664. >0 ulelong 11 DXT5
  3665. >0 ulelong 12 BC4
  3666. >0 ulelong 13 BC5
  3667. >0 ulelong 14 BC6
  3668. >0 ulelong 15 BC7
  3669. >0 ulelong 16 UYVY
  3670. >0 ulelong 17 YUY2
  3671. >0 ulelong 18 BW1bpp
  3672. >0 ulelong 19 R9G9B9E5 Shared Exponent
  3673. >0 ulelong 20 RGBG8888
  3674. >0 ulelong 21 GRGB8888
  3675. >0 ulelong 22 ETC2 RGB
  3676. >0 ulelong 23 ETC2 RGBA
  3677. >0 ulelong 24 ETC2 RGB A1
  3678. >0 ulelong 25 EAC R11
  3679. >0 ulelong 26 EAC RG11
  3680. >0 ulelong 27 ASTC_4x4
  3681. >0 ulelong 28 ASTC_5x4
  3682. >0 ulelong 29 ASTC_5x5
  3683. >0 ulelong 30 ASTC_6x5
  3684. >0 ulelong 31 ASTC_6x6
  3685. >0 ulelong 32 ASTC_8x5
  3686. >0 ulelong 33 ASTC_8x6
  3687. >0 ulelong 34 ASTC_8x8
  3688. >0 ulelong 35 ASTC_10x5
  3689. >0 ulelong 36 ASTC_10x6
  3690. >0 ulelong 37 ASTC_10x8
  3691. >0 ulelong 38 ASTC_10x10
  3692. >0 ulelong 39 ASTC_12x10
  3693. >0 ulelong 40 ASTC_12x12
  3694. >0 ulelong 41 ASTC_3x3x3
  3695. >0 ulelong 42 ASTC_4x3x3
  3696. >0 ulelong 43 ASTC_4x4x3
  3697. >0 ulelong 44 ASTC_4x4x4
  3698. >0 ulelong 45 ASTC_5x4x4
  3699. >0 ulelong 46 ASTC_5x5x4
  3700. >0 ulelong 47 ASTC_5x5x5
  3701. >0 ulelong 48 ASTC_6x5x5
  3702. >0 ulelong 49 ASTC_6x6x5
  3703. >0 ulelong 50 ASTC_6x6x6
  3704. 0 string PVR\x03 PowerVR 3.0 texture:
  3705. >0x18 ulelong x %u x
  3706. >0x1C ulelong x %u
  3707. >0x20 ulelong >1 x %u
  3708. >0x08 ubyte x \b,
  3709. >0x0C ulelong 0
  3710. >>0x08 use pvr3-pixel-format
  3711. >0x0C ulelong !0
  3712. >>0x08 ubyte !0 %c
  3713. >>>0x0C ubyte !0 \b%u
  3714. >>0x09 ubyte !0 \b%c
  3715. >>>0x0D ubyte !0 \b%u
  3716. >>0x0A ubyte !0 \b%c
  3717. >>>0x0E ubyte !0 \b%u
  3718. >>0x0B ubyte !0 \b%c
  3719. >>>0x0F ubyte !0 \b%u
  3720. >0x10 ulelong 1 \b, sRGB
  3721. >0x04 ulelong&0x02 0x02 \b, premultiplied alpha
  3722. 0 string \x03RVP PowerVR 3.0 texture: BE,
  3723. >0x18 ubelong x %u x
  3724. >0x1C ubelong x %u
  3725. >0x20 ubelong >1 x %u
  3726. >0x08 ubyte x \b,
  3727. >0x0C ubelong 0
  3728. >>0x08 use pvr3-pixel-format
  3729. >0x0C ubelong !0
  3730. >>0x0B ubyte !0 %c
  3731. >>>0x0F ubyte !0 \b%u
  3732. >>0x0A ubyte !0 \b%c
  3733. >>>0x0E ubyte !0 \b%u
  3734. >>0x09 ubyte !0 \b%c
  3735. >>>0x0D ubyte !0 \b%u
  3736. >>0x08 ubyte !0 \b%c
  3737. >>>0x0C ubyte !0 \b%u
  3738. >0x10 ubelong 1 \b, sRGB
  3739. >0x04 ubelong&0x02 0x02 \b, premultiplied alpha
  3740. # Type: Microsoft Xbox XPR0 texture.
  3741. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3742. # References:
  3743. # - https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/XbD3D8Types.h
  3744. # XPR pixel formats.
  3745. 0 name xbox-xpr-pixel-format
  3746. >0 ubyte 0x00 L8
  3747. >0 ubyte 0x01 AL8
  3748. >0 ubyte 0x02 ARGB1555
  3749. >0 ubyte 0x03 RGB555
  3750. >0 ubyte 0x04 ARGB4444
  3751. >0 ubyte 0x05 RGB565
  3752. >0 ubyte 0x06 ARGB8888
  3753. >0 ubyte 0x07 xRGB8888
  3754. >0 ubyte 0x0B P8
  3755. >0 ubyte 0x0C DXT1
  3756. >0 ubyte 0x0E DXT2
  3757. >0 ubyte 0x0F DXT4
  3758. >0 ubyte 0x10 Linear ARGB1555
  3759. >0 ubyte 0x11 Linear RGB565
  3760. >0 ubyte 0x12 Linear ARGB8888
  3761. >0 ubyte 0x13 Linear L8
  3762. >0 ubyte 0x16 Linear R8B8
  3763. >0 ubyte 0x17 Linear G8B8
  3764. >0 ubyte 0x19 A8
  3765. >0 ubyte 0x1A A8L8
  3766. >0 ubyte 0x1B Linear AL8
  3767. >0 ubyte 0x1C Linear RGB555
  3768. >0 ubyte 0x1D Linear ARGB4444
  3769. >0 ubyte 0x1E Linear xRGB8888
  3770. >0 ubyte 0x1F Linear A8
  3771. >0 ubyte 0x20 Linear A8L8
  3772. >0 ubyte 0x24 YUY2
  3773. >0 ubyte 0x25 UYVY
  3774. >0 ubyte 0x27 L6V5U5
  3775. >0 ubyte 0x28 V8U8
  3776. >0 ubyte 0x29 R8B8
  3777. >0 ubyte 0x2A D24S8
  3778. >0 ubyte 0x2B F24S8
  3779. >0 ubyte 0x2C D16
  3780. >0 ubyte 0x2D F16
  3781. >0 ubyte 0x2E Linear D24S8
  3782. >0 ubyte 0x2F Linear F24S8
  3783. >0 ubyte 0x30 Linear D16
  3784. >0 ubyte 0x31 Linear F16
  3785. >0 ubyte 0x32 L16
  3786. >0 ubyte 0x33 V16U16
  3787. >0 ubyte 0x35 Linear L16
  3788. >0 ubyte 0x36 Linear V16U16
  3789. >0 ubyte 0x37 Linear L6V5U5
  3790. >0 ubyte 0x38 RGBA5551
  3791. >0 ubyte 0x39 RGBA4444
  3792. >0 ubyte 0x3A QWVU8888
  3793. >0 ubyte 0x3B BGRA8888
  3794. >0 ubyte 0x3C RGBA8888
  3795. >0 ubyte 0x3D Linear RGBA5551
  3796. >0 ubyte 0x3E Linear RGBA4444
  3797. >0 ubyte 0x3F Linear ABGR8888
  3798. >0 ubyte 0x40 Linear BGRA8888
  3799. >0 ubyte 0x41 Linear RGBA8888
  3800. >0 ubyte 0x64 Vertex Data
  3801. 0 string XPR0 Microsoft Xbox XPR0 texture
  3802. >0x19 ubyte x \b, format:
  3803. >>0x19 use xbox-xpr-pixel-format
  3804. # ILDA Image Data Transfer Format
  3805. # https://www.ilda.com/resources/StandardsDocs/ILDA_IDTF14_rev011.pdf
  3806. #
  3807. # Updated by Chuck Hein (laser@geekdude.com)
  3808. #
  3809. 0 string ILDA ILDA Image Data Transfer Format
  3810. >7 ubyte 0x00 3D Coordinates with Indexed Color
  3811. >7 ubyte 0x01 2D Coordinates with Indexed Color
  3812. >7 ubyte 0x02 Color Palette
  3813. >7 ubyte 0x04 3D Coordinates with True Color
  3814. >7 ubyte 0x05 2D Coordinates with True Color
  3815. >8 string >0 \b, palette %s
  3816. >16 string >0 \b, company %s
  3817. >24 ubeshort >0 \b, number of records %d
  3818. >>26 ubeshort x \b, palette number %d
  3819. >>28 ubeshort >0 \b, number of frames %d
  3820. >>30 ubyte >0 \b, projector number %d
  3821. # Dropbox "lepton" compressed jpeg format
  3822. # https://github.com/dropbox/lepton
  3823. 0 ubelong&0xfffff0ff 0xcf84005a Lepton image file
  3824. >2 ubyte x (version %d)
  3825. # Apple QuickTake camera raw images
  3826. # https://en.wikipedia.org/wiki/Apple_QuickTake
  3827. # dcraw can decode them
  3828. 0 name quicktake
  3829. >4 ubelong 8
  3830. >>544 ubeshort x \b, %dx
  3831. >>546 ubeshort x \b%d
  3832. >4 ubelong 4
  3833. >>546 ubeshort x \b, %dx
  3834. >>544 ubeshort x \b%d
  3835. 0 string qktk Apple QuickTake 100 Raw Image
  3836. >0 use quicktake
  3837. 0 string qktn
  3838. >4 ubyte 0 Apple QuickTake 150 Raw Image
  3839. >4 ubyte >0 Apple QuickTake 200 Raw Image
  3840. >0 use quicktake
  3841. # From: Joerg Jenderek
  3842. # URL: http://fileformats.archiveteam.org/wiki/Corel_Photo-Paint_image
  3843. # Reference: http://blog.argasinski.eu/wp-content/uploads/2011/08/cpt-specification-0.01.pdf
  3844. 0 string CPT
  3845. >4 string FILE Corel Photo-Paint image, version
  3846. # version like 7, 9 or 8
  3847. >>3 ubyte x %c,
  3848. !:mime image/x-corel-cpt
  3849. !:ext cpt
  3850. # if blocks_array_offset available jump blockNumber*8 bytes
  3851. >>0x34 ulelong >0
  3852. >>>(0x28.l*8) ubyte x
  3853. # jump additional stored blocks_array_offset bytes forward to object block
  3854. >>>>&(0x34.l-1) ulelong x %u
  3855. # object height in pixels
  3856. >>>>>&0 ulelong x x %u
  3857. # if no blocks_array_offset available jump blockNumber*8 bytes
  3858. >>0x34 ulelong =0
  3859. >>>(0x28.l*8) ubyte x
  3860. # jump additional 0x13C bytes forward to object block
  3861. >>>>&0x13B ulelong x %u
  3862. >>>>>&0 ulelong x x %u
  3863. # image color model used
  3864. >>0x8 ulelong x
  3865. >>>0x8 ulelong 0x1 RGB 24 bits
  3866. >>>0x8 ulelong 0x3 CMYK 24 bits
  3867. >>>0x8 ulelong 0x5 greyscale 8 bits
  3868. >>>0x8 ulelong 0x6 black and white 1 bit
  3869. >>>0x8 ulelong 0xA RGB 8 bits
  3870. # palette_length number of colors * 3 in case of 8-bit RGB paletted image
  3871. # 0 otherwise. Allowed values: 0 or [1..256] * 3
  3872. #>>0xC ulelong >0 \b, palette length %u
  3873. >>>>0xC ulelong/3 <256 \b, %u colors
  3874. >>>0x8 ulelong 0xB LAB
  3875. >>>0x8 ulelong 0xC RGB 48 bits
  3876. >>>0x8 ulelong 0xE greyscale 16 bits
  3877. # this should not happen
  3878. >>>0x8 default x color model
  3879. >>>>0x8 ulelong x %#x
  3880. # bit 1 in CPT file flags: UCS-2 file comment present
  3881. >>0x31 ubyte &0x02
  3882. # look for comment marker
  3883. >>>0x100 search/0xc9d \4\2\0\0
  3884. # UCS-2 file comment
  3885. >>>>&0 lestring16 x "%s"
  3886. # if no UCS-2 is present show ANSI file comment[112] if available
  3887. >>0x31 ubyte&0x02 =0
  3888. >>>0x3C string >\0 "%-.112s"
  3889. # reserved seems to be always 0
  3890. #>>0x10 ulelong >0 \b, reserved1 %u
  3891. # horizontal real dpi = dpi_h * 25.4 / 10**6
  3892. >>0x18 ulelong x \b, %u micro dots/mm
  3893. # image vertical DPI in CPT DPI unit
  3894. #>>0x1C ulelong x \b, %u micro dots/mm
  3895. # reserved seems to be always 0
  3896. #>>0x20 ulelong >0 \b, reserved2 %u
  3897. #>>0x24 ulelong >0 \b, reserved3 %u
  3898. # blocks_count; number of CPT_Block blocks. Allowed values: > 0
  3899. >>0x28 ulelong x \b, %u block
  3900. # plural s
  3901. >>0x28 ulelong !1 \bs
  3902. # CPT file flags
  3903. # lower byte of CPT file flags: 0x94~CPT9FILE 0x01~often CPT7FILE 0x8C~CPT8FILE
  3904. #>>0x30 ubyte x \b, lower flags %#x
  3905. # upper byte of CPT file flags:
  3906. #>>0x31 ubyte >0 \b, upper flags %#x
  3907. # bit 2 in CPT file flags: unknown
  3908. #>>0x31 ubyte &0x04 \b, with UNKNOWN
  3909. # bits 3-7 in CPT file flags: unknown, seem to be often 0
  3910. # show unusual flag combinations
  3911. >>0x31 ubyte&0xFC >0
  3912. >>>0x30 uleshort x \b, flags %#4.4x
  3913. # reserved seems to be always 0
  3914. #>>0x32 uleshort >0 \b, reserved4 %#x
  3915. # blocks_array_offset is always 0 for CPT7 and CPT8 files created by PP7-PP8
  3916. # typical values like: 13Ch 154h 43Ch 4F0h DA8h
  3917. >>0x34 ulelong x \b, array offset %#x
  3918. # reserved seems to be often 0
  3919. >>0x38 ulelong >0 \b, reserved5 %#x
  3920. # possible next master block
  3921. #>>0x100 ubequad !0 \b, next block=%#llx...
  3922. # bit 0: ICC profile block present
  3923. >>0x31 ubyte &0x01 \b, with ICC profile
  3924. # check for characteristic string acsp of color profile for DEBUGGING
  3925. #>>>0x178 string x icc=%.4s
  3926. # display ICC/ICM color profile by ./icc
  3927. #>>>0x154 use color-profile
  3928. # URL: http://fileformats.archiveteam.org/wiki/CorelDRAW
  3929. # https://en.wikipedia.org/wiki/CorelDRAW
  3930. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-gen.trid.xml
  3931. # Note: called "CorelDRAW drawing (generic)" by TrID
  3932. # version til 2 WL-based; from version 3 til 13 handled by ./riff and from 14 zip based handled by ./archive
  3933. 0 ubelong&0xFFffF7ff 0x574C6500 Corel Draw Picture
  3934. #!:mime image/x-coreldraw
  3935. !:mime application/vnd.corel-draw
  3936. !:ext cdr
  3937. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-corel-10.trid.xml
  3938. # Note: called "CorelDRAW drawing (v1.0)" by TrID and
  3939. # "CorelDraw Drawing" with version "1.0" by DROID via PUID fmt/467
  3940. # only DROID fmt-467-signature-id-726.cdr example
  3941. >2 ubyte 0x65 \b, version 1.0
  3942. #>>4 ubelong !0x45000000 \b, at 4 %#8.8x
  3943. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/cdr-corel-20.trid.xml
  3944. # Note: called "CorelDRAW drawing (v2.0)" by TrID and
  3945. # "CorelDraw Drawing" with version "2.0" by DROID via PUID fmt/466
  3946. >2 ubyte 0x6D \b, version 2.0
  3947. # According to DROID 0xed080000 or 0x25050000
  3948. #>>4 ubelong !0xed080000
  3949. #>>>4 ubelong !0x25050000 \b, at 4 %#8.8x
  3950. # Type: Crunch compressed texture.
  3951. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3952. # References:
  3953. # - https://github.com/BinomialLLC/crunch/blob/44c8402e24441c7524ca364941fd224ab3b971e9/inc/crn_decomp.h#L267
  3954. 0 ubelong 0x4878004A Crunch compressed texture:
  3955. >0x0C ubeshort x %u x
  3956. >0x0E ubeshort x %u
  3957. >0x12 ubyte 0 \b, DXT1
  3958. >0x12 ubyte 1 \b, DXT3
  3959. >0x12 ubyte 2 \b, DXT5
  3960. >0x12 ubyte 3 \b, DXT5 CCxY
  3961. >0x12 ubyte 4 \b, DXT5 xGxR
  3962. >0x12 ubyte 5 \b, DXT5 xGBR
  3963. >0x12 ubyte 6 \b, DXT5 AGBR
  3964. >0x12 ubyte 7 \b, DXn XY
  3965. >0x12 ubyte 8 \b, DXn YX
  3966. >0x12 ubyte 9 \b, DXT5 Alpha
  3967. >0x12 ubyte 10 \b, ETC1
  3968. >0x10 ubyte >1 \b, %u images
  3969. >0x11 ubyte >1 \b, %u faces
  3970. # TODO: Flags at 0x13? (ubeshort)
  3971. # Type: BasisLZ compressed texture.
  3972. # From: David Korth <gerbilsoft@gerbilsoft.com>
  3973. # References:
  3974. # - https://github.com/BinomialLLC/basis_universal/blob/master/spec/basis_spec.txt
  3975. 0 uleshort 0x4273
  3976. >0x04 uleshort 0x4D BasisLZ
  3977. >>0x02 uleshort x v%x compressed texture:
  3978. >>0x14 ubyte 0 ETC1S
  3979. >>0x14 ubyte 1 UASTC 4x4
  3980. >>0x0E ulelong&0xFFFFFF >1 \b, %u slices
  3981. >>0x11 ulelong&0xFFFFFF >1 \b, %u images
  3982. >>0x15 uleshort&0x02 2 \b, Y-flipped
  3983. # MIME registration: https://www.iana.org/assignments/media-types/model/e57
  3984. # Sample files: http://www.libe57.org/data.html
  3985. # Reference implementation: http://www.libe57.org/
  3986. # https://www.ri.cmu.edu/pub_files/2011/1/2011-huber-e57-v3.pdf
  3987. 0 string ASTM-E57 ASTM E57 three-dimensional model
  3988. !:mime model/e57
  3989. !:ext e57
  3990. # QOI [Quite OK Image Format] images
  3991. # (Horia Mihai David, mihaidavid@posteo.net)
  3992. #
  3993. # QOI format by Dominic Szablewski <http://phoboslab.org/>
  3994. # <https://qoiformat.org/>
  3995. #
  3996. # Based on spec v1.0 (2022.01.05) <https://qoiformat.org/qoi-specification.pdf>
  3997. 0 string qoif QOI image data
  3998. !:ext qoi
  3999. !:mime image/x-qoi
  4000. # See <https://github.com/phoboslab/qoi/issues/167>
  4001. >4 ubelong x %ux
  4002. >8 ubelong x \b%u,
  4003. >>13 ubyte 0 s
  4004. >>>12 ubyte 3 \bRGB
  4005. >>>12 ubyte 4 \bRGBA
  4006. >>>12 default x
  4007. >>>>12 ubyte x \b*bad channels %u*
  4008. >>>13 ubyte 0 (linear alpha)
  4009. >>13 ubyte 1
  4010. >>>12 ubyte 3 RGB
  4011. >>>12 ubyte 4 RGBA
  4012. >>>13 ubyte 1 (all channels linear)
  4013. >>13 default x
  4014. >>>13 ubyte x *bad colorspace %u*
  4015. # Type: Godot 3 texture (pixel format)
  4016. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4017. 0 name godot-pixel-format-v3
  4018. >0 ulelong&0xFFFFF 0 L8
  4019. >0 ulelong&0xFFFFF 1 LA8
  4020. >0 ulelong&0xFFFFF 2 R8
  4021. >0 ulelong&0xFFFFF 3 RG8
  4022. >0 ulelong&0xFFFFF 4 RGB8
  4023. >0 ulelong&0xFFFFF 5 RGBA8
  4024. >0 ulelong&0xFFFFF 6 RGBA4444
  4025. >0 ulelong&0xFFFFF 7 RGB565
  4026. >0 ulelong&0xFFFFF 8 RF
  4027. >0 ulelong&0xFFFFF 9 RGF
  4028. >0 ulelong&0xFFFFF 10 RGBF
  4029. >0 ulelong&0xFFFFF 11 RGBAF
  4030. >0 ulelong&0xFFFFF 12 RH
  4031. >0 ulelong&0xFFFFF 13 RGH
  4032. >0 ulelong&0xFFFFF 14 RGBH
  4033. >0 ulelong&0xFFFFF 15 RGBAH
  4034. >0 ulelong&0xFFFFF 16 RGBE9995
  4035. >0 ulelong&0xFFFFF 17 DXT1
  4036. >0 ulelong&0xFFFFF 18 DXT3
  4037. >0 ulelong&0xFFFFF 19 DXT5
  4038. >0 ulelong&0xFFFFF 20 RGTC_R
  4039. >0 ulelong&0xFFFFF 21 RGTC_RG
  4040. >0 ulelong&0xFFFFF 22 BPTC_RGBA
  4041. >0 ulelong&0xFFFFF 23 BPTC_RGBF
  4042. >0 ulelong&0xFFFFF 24 BPTC_RGBFU
  4043. >0 ulelong&0xFFFFF 25 PVRTC1_2
  4044. >0 ulelong&0xFFFFF 26 PVRTC1_2A
  4045. >0 ulelong&0xFFFFF 27 PVRTC1_4
  4046. >0 ulelong&0xFFFFF 28 PVRTC1_4A
  4047. >0 ulelong&0xFFFFF 29 ETC
  4048. >0 ulelong&0xFFFFF 30 ETC2_R11
  4049. >0 ulelong&0xFFFFF 31 ETC2_R11S
  4050. >0 ulelong&0xFFFFF 32 ETC2_RG11
  4051. >0 ulelong&0xFFFFF 33 ETC2_RG11S
  4052. >0 ulelong&0xFFFFF 34 ETC2_RGB8
  4053. >0 ulelong&0xFFFFF 35 ETC2_RGBA8
  4054. >0 ulelong&0xFFFFF 36 ETC2_RGB8A1
  4055. # NOTE: This is a custom pixel format used by Sonic Colors Ultimate.
  4056. # Godot 4 later added its own ASTC format values.
  4057. >0 ulelong&0xFFFFF 37 ASTC_8x8
  4058. # Type: Godot 4 texture (pixel format)
  4059. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4060. # NOTE: This is a custom pixel format used by Sonic Colors Ultimate.
  4061. # Godot 4 later added its own ASTC format values.
  4062. 0 name godot-pixel-format-v4
  4063. >0 ulelong&0xFFFFF 0 L8
  4064. >0 ulelong&0xFFFFF 1 LA8
  4065. >0 ulelong&0xFFFFF 2 R8
  4066. >0 ulelong&0xFFFFF 3 RG8
  4067. >0 ulelong&0xFFFFF 4 RGB8
  4068. >0 ulelong&0xFFFFF 5 RGBA8
  4069. >0 ulelong&0xFFFFF 6 RGBA4444
  4070. >0 ulelong&0xFFFFF 7 RGB565
  4071. >0 ulelong&0xFFFFF 8 RF
  4072. >0 ulelong&0xFFFFF 9 RGF
  4073. >0 ulelong&0xFFFFF 10 RGBF
  4074. >0 ulelong&0xFFFFF 11 RGBAF
  4075. >0 ulelong&0xFFFFF 12 RH
  4076. >0 ulelong&0xFFFFF 13 RGH
  4077. >0 ulelong&0xFFFFF 14 RGBH
  4078. >0 ulelong&0xFFFFF 15 RGBAH
  4079. >0 ulelong&0xFFFFF 16 RGBE9995
  4080. >0 ulelong&0xFFFFF 17 DXT1
  4081. >0 ulelong&0xFFFFF 18 DXT3
  4082. >0 ulelong&0xFFFFF 19 DXT5
  4083. >0 ulelong&0xFFFFF 20 RGTC_R
  4084. >0 ulelong&0xFFFFF 21 RGTC_RG
  4085. >0 ulelong&0xFFFFF 22 BPTC_RGBA
  4086. >0 ulelong&0xFFFFF 23 BPTC_RGBF
  4087. >0 ulelong&0xFFFFF 24 BPTC_RGBFU
  4088. >0 ulelong&0xFFFFF 25 ETC
  4089. >0 ulelong&0xFFFFF 36 ETC2_R11
  4090. >0 ulelong&0xFFFFF 27 ETC2_R11S
  4091. >0 ulelong&0xFFFFF 28 ETC2_RG11
  4092. >0 ulelong&0xFFFFF 29 ETC2_RG11S
  4093. >0 ulelong&0xFFFFF 30 ETC2_RGB8
  4094. >0 ulelong&0xFFFFF 31 ETC2_RGBA8
  4095. >0 ulelong&0xFFFFF 32 ETC2_RGB8A1
  4096. >0 ulelong&0xFFFFF 33 ETC2_RA_AS_RG
  4097. >0 ulelong&0xFFFFF 34 DXT5_RA_AS_RG
  4098. >0 ulelong&0xFFFFF 35 ASTC_4x4
  4099. >0 ulelong&0xFFFFF 36 ASTC_4x4_HDR
  4100. >0 ulelong&0xFFFFF 37 ASTC_8x8
  4101. >0 ulelong&0xFFFFF 38 ASTC_8x8_HDR
  4102. # Type: Godot 3, 4 texture (rescale display, width)
  4103. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4104. # Shows rescale value if it's not a power of 2.
  4105. 0 name godot-rescale-display-w
  4106. >0 uleshort 0
  4107. >0 uleshort 1
  4108. >0 uleshort 2
  4109. >0 uleshort 4
  4110. >0 uleshort 8
  4111. >0 uleshort 16
  4112. >0 uleshort 32
  4113. >0 uleshort 64
  4114. >0 uleshort 128
  4115. >0 uleshort 256
  4116. >0 uleshort 512
  4117. >0 uleshort 1024
  4118. >0 uleshort 2048
  4119. >0 uleshort 4096
  4120. >0 uleshort 8192
  4121. >0 uleshort 16384
  4122. >0 uleshort 32768
  4123. >0 default x
  4124. >>0 uleshort x (rescale to %u x
  4125. # Type: Godot 3, 4 texture (rescale display, height)
  4126. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4127. # Shows rescale value if it's not a power of 2.
  4128. 0 name godot-rescale-display-h
  4129. >0 clear x
  4130. >0 uleshort 0
  4131. >0 uleshort 1
  4132. >0 uleshort 2
  4133. >0 uleshort 4
  4134. >0 uleshort 8
  4135. >0 uleshort 16
  4136. >0 uleshort 32
  4137. >0 uleshort 64
  4138. >0 uleshort 128
  4139. >0 uleshort 256
  4140. >0 uleshort 512
  4141. >0 uleshort 1024
  4142. >0 uleshort 2048
  4143. >0 uleshort 4096
  4144. >0 uleshort 8192
  4145. >0 uleshort 16384
  4146. >0 uleshort 32768
  4147. >0 default x
  4148. >>0 uleshort x %u)
  4149. # Type: Godot 3 texture
  4150. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4151. # References:
  4152. # - https://github.com/godotengine/godot/blob/3.3/core/image.h
  4153. # - https://github.com/godotengine/godot/blob/3.3/scene/resources/texture.cpp
  4154. # - https://github.com/godotengine/godot/blob/3.3/scene/resources/texture.h
  4155. # TODO: Don't show "rescale to" if it matches the image size.
  4156. 0 string GDST Godot 3 texture:
  4157. !:ext stex
  4158. !:mime image/x-godot-stex
  4159. >4 uleshort x %u x
  4160. >8 uleshort x %u
  4161. >6 uleshort 0 \b,
  4162. >6 uleshort !0
  4163. >>6 use godot-rescale-display-w
  4164. >>10 use godot-rescale-display-h
  4165. >>10 uleshort x \b,
  4166. >16 ulelong&0x800000 !0 has mipmaps,
  4167. >16 ulelong&0x100000 0x100000 lossless encoding
  4168. >16 ulelong&0x200000 0x200000 lossy encoding
  4169. >16 ulelong&0x300000 0
  4170. >>16 use godot-pixel-format-v3
  4171. # Type: Godot 4 texture
  4172. # From: David Korth <gerbilsoft@gerbilsoft.com>
  4173. # References:
  4174. # - https://github.com/godotengine/godot/blob/master/core/io/image.h
  4175. # - https://github.com/godotengine/godot/blob/master/scene/resources/texture.cpp
  4176. # - https://github.com/godotengine/godot/blob/master/scene/resources/texture.h
  4177. # TODO: Don't show "rescale to" if it matches the image size.
  4178. 0 string GST2 Godot 4 texture
  4179. !:ext stex
  4180. !:mime image/x-godot-stex
  4181. >4 ulelong x v%u:
  4182. >0x28 uleshort x %u x
  4183. >0x2A uleshort x %u
  4184. >8 use godot-rescale-display-w
  4185. >12 use godot-rescale-display-h
  4186. >12 uleshort x \b,
  4187. >0x2C ulelong >1 %u mipmaps,
  4188. >0x30 use godot-pixel-format-v4
  4189. >0x24 ulelong 1 \b, embedded PNG image
  4190. >0x24 ulelong 2 \b, embedded WebP image
  4191. >0x24 ulelong 3 \b, Basis Universal
  4192. # Summary: iCEDraw graphic *.IDF
  4193. # URL: http://fileformats.archiveteam.org/wiki/ICEDraw
  4194. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/i/idf-icedraw.trid.xml
  4195. # From: Joerg Jenderek
  4196. # Note: called "iCEDraw graphic" by TrID, "iCEDraw text" by FFmpeg and "iCE Draw" by Ansilove
  4197. # verified by FFmpeg command `ffprobe ICE-9605.IDF` and `ansilove -s SQ-FORCE.IDF`
  4198. 0 string \0041.4\0\0\0\0O\0 iCEDraw graphic
  4199. #!:mime application/octet-stream
  4200. !:mime image/x-idf
  4201. !:ext idf
  4202. # Type: ColoRIX VGA Paint Image File (.rix/.sci/.scX)
  4203. # From: Eddy Jansson <github.com/eloj>
  4204. # Reference: https://www.fileformat.info/format/rix/spec/
  4205. #
  4206. 0 name rix-header
  4207. >0 uleshort x \b, %u x
  4208. >2 uleshort x %u
  4209. # palette type:
  4210. # .. if direct color, low bits encode bpp
  4211. >4 ubyte&128 0
  4212. >>4 ubyte&127 x \b %u bpp (direct color)
  4213. # .. else palette
  4214. >4 ubyte&128 128
  4215. >>4 ubyte&7 0 \b x 2
  4216. >>4 ubyte&7 1 \b x 4
  4217. >>4 ubyte&7 2 \b x 8
  4218. >>4 ubyte&7 3 \b x 16
  4219. >>4 ubyte&7 4 \b x 32
  4220. >>4 ubyte&7 5 \b x 64
  4221. >>4 ubyte&7 6 \b x 128
  4222. >>4 ubyte&7 7 \b x 256
  4223. # storage type
  4224. #>5 ubyte&15 0 \b, Linear
  4225. >5 ubyte&15 1 \b, Planar (0213)
  4226. >5 ubyte&15 2 \b, Planar
  4227. >5 ubyte&15 3 \b, Text
  4228. >5 ubyte&15 4 \b, Planar lines
  4229. >5 ubyte&128 128 \b (compressed)
  4230. >5 ubyte&64 64 \b (extension)
  4231. >5 ubyte&32 32 \b (encrypted)
  4232. 0 string RIX3 ColoRIX Image
  4233. >4 use rix-header
  4234. 0 string RIX7 ColoRIX Slideshow
  4235. # http://fileformats.archiveteam.org/wiki/PaperPort_(MAX)
  4236. 0 string ViG Visioneer PaperPort
  4237. >3 string Ae 2
  4238. >3 string Be 2
  4239. >3 string Cj 3-4
  4240. >3 string Em 5-7
  4241. >3 string Fk 8-12
  4242. >3 default x MAX
  4243. # https://teem.sourceforge.net/nrrd/index.html
  4244. # From: Quasar Jarosz <quasar@uams.edu>, 2023
  4245. 0 string NRRD000 NRRD imaging data
  4246. !:mime image/x.nrrd
  4247. !:ext nrrd
  4248. >7 string x \b, version %s
  4249. >0 search type:
  4250. >>&1 string x \b, type: %s
  4251. >0 search dimension:
  4252. >>&1 string x \b, dimensions: %s
  4253. >0 search sizes:
  4254. >>&1 string x \b, sizes: %s
  4255. >0 search encoding:
  4256. >>&1 string x \b, encoding: %s
  4257. # From: Joerg Jenderek
  4258. # URL: http://justsolve.archiveteam.org/wiki/PICT
  4259. # https://en.wikipedia.org/wiki/PICT
  4260. # Reference: https://www.fileformat.info/format/macpict/egff.htm
  4261. # http://mark0.net/download/triddefs_xml.7z/defs/p/pict-v2.trid.xml
  4262. # Note: called "Macintosh Quickdraw/PICT drawing" by shared MIME-info database from freedesktop.org,
  4263. # "QuickDraw/PICT bitmap (v2)" by TrID and "Macintosh PICT Image" version 2.0 by DROID via PUID via fmt/341
  4264. # verified by command like `deark -m pict -l -d2 flag_b24.pct` as PICT v2,
  4265. # partly by NetPBM `picttoppm venus.pct | file` as "Macintosh PICT",
  4266. # partly by ImageMagick `identify -verbose flag_b24.pct` as (Apple Macintosh QuickDraw/PICT) and
  4267. # partly by XnView `nconvert -fullinfo *.pict *.pic *.pct` as "Macintosh PICT 2"
  4268. # look for version operator (0011h) and version number (02FFh)
  4269. 522 ubelong 0x001102ff
  4270. # few Macintosh QuickDraw with one corner at -1/-1 coordinates like PICT_129.pict PICT_2012.pict (strength=81=70+11) before Claris clip art (strength=80 ./claris)
  4271. !:strength +11
  4272. # look for Version operator (0C00h)
  4273. >526 ubeshort 0x0c00
  4274. # skip DROID fmt-341-signature-id-468.pct with invalid dimension x=0
  4275. >>520 ubeshort !0
  4276. # skip DROID variant fmt-341-signature-id-468.pct using 0xAB instead 0x0
  4277. >>>0 long !0xABABABAB Macintosh QuickDraw PICT, version 2
  4278. #!:mime application/octet-stream
  4279. !:mime image/x-pict
  4280. !:apple ????PICT
  4281. !:ext pict/pic/pct
  4282. # maybe also suffix pict2 https://www.xnview.com/de/image_formats/
  4283. #!:ext pict2/pict/pic/pct
  4284. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pict.trid.xml
  4285. # Note: called "Macintosh Quickdraw/PICT Drawing" by TrID
  4286. # "real" content stored by opcode 0x8200 (CompressedQuickTime *.qtif) with none, cvid or JPEG compression
  4287. # look for LongText QuickTime followed by trademark character
  4288. >>>>554 search/691976/b QuickTime\252 \b, QuickTime
  4289. # look for LongText afterwards like "and a/None|Cinepak|Photo - JPEG decompressor/are needed to see this picture"
  4290. >>>>>&0 search/28/bs \040decompressor with decompressor
  4291. >>>>>>&-4 string None None
  4292. # Cinepak and "Compact Video decompressor" seems to be cvid
  4293. >>>>>>&-7 string Cinepak Cinepak
  4294. >>>>>>&-12 string Photo\040-\040JPEG JPEG
  4295. >>>>>>&-13 string Compact\040Video cvid
  4296. # case where decompression is not like: Cinepak None "Photo - JPEG" "Compact Video decompressor"
  4297. >>>>>>&-6 default x
  4298. >>>>>>>&0 string x "%0.6s"
  4299. # file size in bytes; not reliable sometimes 0 or little smaller than real size
  4300. #>>>>512 ubeshort x \b, size %u
  4301. # 8 bytes picFrame (rectangle); for most examples one corner is located at coordinates 0/0; except deark other tools fail when negative values
  4302. # GRR: samples with coordinates -1/-1 and Y=0x01??|0x00?? are interpreted as "Claris clip art" (strength=80 ./claris)
  4303. #>>>>518 ubeshort x Y=%#4.4x
  4304. >>>>520 ubeshort x \b, %u
  4305. >>>>>516 beshort !0 \b-%d
  4306. >>>>518 ubeshort x x %u
  4307. >>>>>514 beshort !0 \b-%d
  4308. # Note: at the beginning all zeros or information about the particular software like: PICT
  4309. >>>>0 long !0 \b, at 0
  4310. >>>>>0 string x %.4s
  4311. # version 2.0 files also have a 26-byte header following the version information
  4312. # like: 0 FFFEh (freedesktop egff~Encyclopedia of Graphics File Formats) FFFFh (egff)
  4313. >>>>528 ubeshort x \b, at 528 %#4.4x
  4314. # 2nd opcode like: 0x0000~NOP 0x0001~Clip 0x00a0~ShortComment 0x00a1~LongComment 0x001e~DefHilite 0x001f~OpColor
  4315. >>>>552 ubeshort x \b, at 552 second opcode %#4.4x
  4316. # last opcode if not opEndPic (00FFh)
  4317. >>>>-2 ubeshort !0x00FF \b, at the end %#4.4x opcode
  4318. # Reference: http://web.archive.org/web/20010703041301/http://developer.apple.com/technotes/qd/qd_14.html
  4319. # http://mark0.net/download/triddefs_xml.7z/defs/p/pict-v1.trid.xml
  4320. # Note: called "QuickDraw/PICT bitmap (v1)" by TrID and "Macintosh PICT Image" version 1.0 by DROID via PUID via x-fmt/80
  4321. # verified by command like `deark -m pict -l -d2 FC9.PCT` as PICT v1,
  4322. # by ImageMagick `identify -verbose *.pict` as PICT (Apple Macintosh QuickDraw/PICT) and
  4323. # by XnView `nconvert -fullinfo *.pict *.pct` as "Macintosh PICT"
  4324. # 1 byte opcode for picversion (11h); next byte version number (1)
  4325. 522 ubeshort 0x1101
  4326. # skip DROID x-fmt-80-signature-id-859.pct x-fmt-80-signature-id-860.pct without next opcode usually clipRgn (1h)
  4327. >524 ubyte =0x01
  4328. >>0 use mac-pict1
  4329. # display Macintosh PICT drawing version 1 information
  4330. 0 name mac-pict1
  4331. >520 ubeshort x Macintosh QuickDraw PICT, version 1
  4332. #!:mime application/octet-stream
  4333. !:mime image/x-pict
  4334. !:apple ????PICT
  4335. !:ext pict/pct
  4336. # maybe also suffix pict1 and pic
  4337. #!:ext pict1/pict/pic/pct
  4338. # file size in bytes; not reliable sometimes 0 or smaller than real size
  4339. #>512 ubeshort x \b, size %u
  4340. # 8 bytes picFrame (rectangle)
  4341. >520 ubeshort x \b, %u
  4342. >516 ubeshort !0 \b-%u
  4343. >518 ubeshort x x %u
  4344. >514 ubeshort !0 \b-%u
  4345. # Note: According to DROID at the beginning all zeros or information about the particular software like DRWG(MD|D2)
  4346. >0 long !0 \b, at 0
  4347. >>0 string x %.6s
  4348. >>0 ubelong x %#8.8x
  4349. >>4 ubeshort x \b%4.4x
  4350. # 2nd opcode if not clipRgn (1h)
  4351. >524 ubyte !0x01 \b, at 524 %#2.2x opcode
  4352. # last opcode if not opEndPic (FFh)
  4353. >-1 ubyte !0xFF \b, at the end %#2.2x opcode
  4354. # https://github.com/aseprite/aseprite/blob/main/docs/ase-file-specs.md
  4355. 20 ulelong 0
  4356. >24 ulelong 0
  4357. >>4 uleshort 0xA5E0 Aseprite asset file
  4358. !:ext aseprite
  4359. >>>0 ulelong x \b, size %u
  4360. >>>6 uleshort x \b, frames %u
  4361. >>>8 uleshort x \b, size %ux
  4362. >>>10 uleshort x \b%u
  4363. >>>12 uleshort 32 \b, RGBA
  4364. >>>12 uleshort 16 \b, Grayscale
  4365. >>>12 uleshort 8 \b, Indexed
  4366. >>>14 ulelong x \b, flags %#x
  4367. #>>>18 uleshort x \b, speed %u
  4368. >>>28 ubyte x \b, transparency index %u
  4369. >>>32 uleshort x \b, number of colors %u
  4370. >>>34 ubyte >0 \b, pixel ratio %u:
  4371. >>>>35 ubyte x \b%u
  4372. >>>36 leshort x \b, grid position (%d,
  4373. >>>38 leshort x \b%d)
  4374. >>>40 uleshort x \b, grid size %dx
  4375. >>>42 uleshort x \b%d