images 132 KB

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