images 145 KB

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