images 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962
  1. #------------------------------------------------------------------------------
  2. # $File: images,v 1.160 2019/04/19 00:42:27 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. # Prevent conflicts with CRI ADX.
  29. >(2.S-2) belong !0x28632943
  30. # skip more garbage like *.iso by looking for positive image type
  31. >>2 ubyte >0
  32. # skip some compiled terminfo like xterm+tmux by looking for image type less equal 33
  33. >>>2 ubyte <34
  34. # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel depth 1 8 15 16 24 32
  35. >>>>16 ubyte 1
  36. >>>>>0 use tga-image
  37. >>>>16 ubyte 8
  38. >>>>>0 use tga-image
  39. >>>>16 ubyte 15
  40. >>>>>0 use tga-image
  41. >>>>16 ubyte 16
  42. >>>>>0 use tga-image
  43. >>>>16 ubyte 24
  44. >>>>>0 use tga-image
  45. >>>>16 ubyte 32
  46. >>>>>0 use tga-image
  47. # display tga bitmap image information
  48. 0 name tga-image
  49. >2 ubyte <34 Targa image data
  50. !:mime image/x-tga
  51. !:apple ????TPIC
  52. # normal extension .tga but some Truevision products used others:
  53. # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
  54. !:ext tga/tpic/icb/vda/vst
  55. # image type 1 2 3 9 10 11 32 33
  56. >2 ubyte&0xF7 1 - Map
  57. >2 ubyte&0xF7 2 - RGB
  58. # alpha channel
  59. >>17 ubyte&0x0F >0 \bA
  60. >2 ubyte&0xF7 3 - Mono
  61. # type not found, but by http://www.fileformat.info/format/tga/corion.htm
  62. # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
  63. >2 ubyte 32 - Color
  64. # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
  65. >2 ubyte 33 - Color
  66. # Color Map Type 0~no 1~color map
  67. >1 ubyte 1 (
  68. # first color map entry, 0 normal
  69. >>3 uleshort >0 \b%d-
  70. # color map length 0 2 1dh 3bh d9h 100h
  71. >>5 uleshort x \b%d)
  72. # 8~run length encoding bit
  73. >2 ubyte&0x08 8 - RLE
  74. # gimp can create big pictures!
  75. >12 uleshort >0 %d x
  76. >12 uleshort =0 65536 x
  77. # image height. 0 interpreted as 65536
  78. >14 uleshort >0 %d
  79. >14 uleshort =0 65536
  80. # Image Pixel depth 1 8 15 16 24 32
  81. >16 ubyte x x %d
  82. # X origin of image. 0 normal
  83. >8 uleshort >0 +%d
  84. # Y origin of image. 0 normal; positive for top
  85. >10 uleshort >0 +%d
  86. # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
  87. >17 ubyte&0x0F >0 - %d-bit alpha
  88. # bits 5-4 give direction. normal bottom left
  89. >17 ubyte &0x20 - top
  90. #>17 ubyte ^0x20 - bottom
  91. >17 ubyte &0x10 - right
  92. #>17 ubyte ^0x10 - left
  93. # some info say other bits 6-7 should be zero
  94. # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
  95. # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
  96. #>17 ubyte&0xC0 0x00 - no interleave
  97. >17 ubyte&0xC0 0x40 - interleave
  98. >17 ubyte&0xC0 0x80 - four way interleave
  99. >17 ubyte&0xC0 0xC0 - reserved
  100. # positive length implies identification field
  101. >0 ubyte >0
  102. >>18 string x "%s"
  103. # last 18 bytes of newer tga file footer signature
  104. >18 search/4261301/s TRUEVISION-XFILE.\0
  105. # extension area offset if not 0
  106. >>&-8 ulelong >0
  107. # length of the extension area. normal 495 for version 2.0
  108. >>>(&-4.l) uleshort 0x01EF
  109. # AuthorName[41]
  110. >>>>&0 string >\0 - author "%-.40s"
  111. # Comment[324]=4 * 80 null terminated
  112. >>>>&41 string >\0 - comment "%-.80s"
  113. # date
  114. >>>>&365 ubequad&0xffffFFFFffff0000 !0
  115. # Day
  116. >>>>>&-6 uleshort x %d
  117. # Month
  118. >>>>>&-8 uleshort x \b-%d
  119. # Year
  120. >>>>>&-4 uleshort x \b-%d
  121. # time
  122. >>>>&371 ubequad&0xffffFFFFffff0000 !0
  123. # hour
  124. >>>>>&-8 uleshort x %d
  125. # minutes
  126. >>>>>&-6 uleshort x \b:%.2d
  127. # second
  128. >>>>>&-4 uleshort x \b:%.2d
  129. # JobName[41]
  130. >>>>&377 string >\0 - job "%-.40s"
  131. # JobHour Jobminute Jobsecond
  132. >>>>&418 ubequad&0xffffFFFFffff0000 !0
  133. >>>>>&-8 uleshort x %d
  134. >>>>>&-6 uleshort x \b:%.2d
  135. >>>>>&-4 uleshort x \b:%.2d
  136. # SoftwareId[41]
  137. >>>>&424 string >\0 - %-.40s
  138. # SoftwareVersionNumber
  139. >>>>&424 ubyte >0
  140. >>>>>&40 uleshort/100 x %d
  141. >>>>>&40 uleshort%100 x \b.%d
  142. # VersionLetter
  143. >>>>>&42 ubyte >0x20 \b%c
  144. # KeyColor
  145. >>>>&468 ulelong >0 - keycolor 0x%8.8x
  146. # Denominator of Pixel ratio. 0~no pixel aspect
  147. >>>>&474 uleshort >0
  148. # Numerator
  149. >>>>>&-4 uleshort >0 - aspect %d
  150. >>>>>&-2 uleshort x \b/%d
  151. # Denominator of Gamma ratio. 0~no Gamma value
  152. >>>>&478 uleshort >0
  153. # Numerator
  154. >>>>>&-4 uleshort >0 - gamma %d
  155. >>>>>&-2 uleshort x \b/%d
  156. # ColorOffset
  157. #>>>>&480 ulelong x - col offset 0x%8.8x
  158. # StampOffset
  159. #>>>>&484 ulelong x - stamp offset 0x%8.8x
  160. # ScanOffset
  161. #>>>>&488 ulelong x - scan offset 0x%8.8x
  162. # AttributesType
  163. #>>>>&492 ubyte x - Attributes 0x%x
  164. ## EndOfTGA
  165. # PBMPLUS images
  166. # The next byte following the magic is always whitespace.
  167. # strength is changed to try these patterns before "x86 boot sector"
  168. 0 name netpbm
  169. >3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
  170. >>&0 regex =[0-9]{1,50} \b, size = %s x
  171. >>>&0 regex =[0-9]{1,50} \b %s
  172. 0 search/1 P1
  173. >0 regex/4 P1[\040\t\f\r\n]
  174. >>0 use netpbm
  175. >>0 string x \b, bitmap
  176. !:strength + 65
  177. !:mime image/x-portable-bitmap
  178. 0 search/1 P2
  179. >0 regex/4 P2[\040\t\f\r\n]
  180. >>0 use netpbm
  181. >>0 string x \b, greymap
  182. !:strength + 65
  183. !:mime image/x-portable-greymap
  184. 0 search/1 P3
  185. >0 regex/4 P3[\040\t\f\r\n]
  186. >>0 use netpbm
  187. >>0 string x \b, pixmap
  188. !:strength + 65
  189. !:mime image/x-portable-pixmap
  190. 0 string P4
  191. >0 regex/4 P4[\040\t\f\r\n]
  192. >>0 use netpbm
  193. >>0 string x \b, rawbits, bitmap
  194. !:strength + 65
  195. !:mime image/x-portable-bitmap
  196. 0 string P5
  197. >0 regex/4 P5[\040\t\f\r\n]
  198. >>0 use netpbm
  199. >>0 string x \b, rawbits, greymap
  200. !:strength + 65
  201. !:mime image/x-portable-greymap
  202. 0 string P6
  203. >0 regex/4 P6[\040\t\f\r\n]
  204. >>0 use netpbm
  205. >>0 string x \b, rawbits, pixmap
  206. !:strength + 65
  207. !:mime image/x-portable-pixmap
  208. 0 string P7 Netpbm PAM image file
  209. !:mime image/x-portable-pixmap
  210. # From: bryanh@giraffe-data.com (Bryan Henderson)
  211. 0 string \117\072 Solitaire Image Recorder format
  212. >4 string \013 MGI Type 11
  213. >4 string \021 MGI Type 17
  214. 0 string .MDA MicroDesign data
  215. >21 byte 48 version 2
  216. >21 byte 51 version 3
  217. 0 string .MDP MicroDesign page data
  218. >21 byte 48 version 2
  219. >21 byte 51 version 3
  220. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  221. # [GRR: this *must* go before TIFF]
  222. 0 string IIN1 NIFF image data
  223. !:mime image/x-niff
  224. # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
  225. # (CIFF) file. These are apparently all little-endian.
  226. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  227. # URL: https://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
  228. 0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
  229. !:mime image/x-canon-crw
  230. >16 leshort x \b, version %d.
  231. >14 leshort x \b%d
  232. # Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
  233. # number. Put this above the TIFF test to make sure we detect them.
  234. # These are apparently all little-endian.
  235. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  236. # URL: https://libopenraw.freedesktop.org/wiki/Canon_CR2
  237. 0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
  238. !:mime image/x-canon-cr2
  239. !:strength +80
  240. >10 byte x \b, version %d.
  241. >11 byte x \b%d
  242. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  243. # The second word of TIFF files is the TIFF version number, 42, which has
  244. # never changed. The TIFF specification recommends testing for it.
  245. 0 string MM\x00\x2a TIFF image data, big-endian
  246. !:strength +70
  247. !:mime image/tiff
  248. >(4.L) use \^tiff_ifd
  249. 0 string II\x2a\x00 TIFF image data, little-endian
  250. !:mime image/tiff
  251. !:strength +70
  252. >(4.l) use tiff_ifd
  253. 0 name tiff_ifd
  254. >0 leshort x \b, direntries=%d
  255. >2 use tiff_entry
  256. 0 name tiff_entry
  257. # NewSubFileType
  258. >0 leshort 0xfe
  259. >>12 use tiff_entry
  260. >0 leshort 0x100
  261. >>4 lelong 1
  262. >>>12 use tiff_entry
  263. >>>8 leshort x \b, width=%d
  264. >0 leshort 0x101
  265. >>4 lelong 1
  266. >>>8 leshort x \b, height=%d
  267. >>>12 use tiff_entry
  268. >0 leshort 0x102
  269. >>8 leshort x \b, bps=%d
  270. >>12 use tiff_entry
  271. >0 leshort 0x103
  272. >>4 lelong 1 \b, compression=
  273. >>>8 leshort 1 \bnone
  274. >>>8 leshort 2 \bhuffman
  275. >>>8 leshort 3 \bbi-level group 3
  276. >>>8 leshort 4 \bbi-level group 4
  277. >>>8 leshort 5 \bLZW
  278. >>>8 leshort 6 \bJPEG (old)
  279. >>>8 leshort 7 \bJPEG
  280. >>>8 leshort 8 \bdeflate
  281. >>>8 leshort 9 \bJBIG, ITU-T T.85
  282. >>>8 leshort 0xa \bJBIG, ITU-T T.43
  283. >>>8 leshort 0x7ffe \bNeXT RLE 2-bit
  284. >>>8 leshort 0x8005 \bPackBits (Macintosh RLE)
  285. >>>8 leshort 0x8029 \bThunderscan RLE
  286. >>>8 leshort 0x807f \bRasterPadding (CT or MP)
  287. >>>8 leshort 0x8080 \bRLE (Line Work)
  288. >>>8 leshort 0x8081 \bRLE (High-Res Cont-Tone)
  289. >>>8 leshort 0x8082 \bRLE (Binary Line Work)
  290. >>>8 leshort 0x80b2 \bDeflate (PKZIP)
  291. >>>8 leshort 0x80b3 \bKodak DCS
  292. >>>8 leshort 0x8765 \bJBIG
  293. >>>8 leshort 0x8798 \bJPEG2000
  294. >>>8 leshort 0x8799 \bNikon NEF Compressed
  295. >>>8 default x
  296. >>>>8 leshort x \b(unknown 0x%x)
  297. >>>12 use tiff_entry
  298. >0 leshort 0x106 \b, PhotometricIntepretation=
  299. >>8 clear x
  300. >>8 leshort 0 \bWhiteIsZero
  301. >>8 leshort 1 \bBlackIsZero
  302. >>8 leshort 2 \bRGB
  303. >>8 leshort 3 \bRGB Palette
  304. >>8 leshort 4 \bTransparency Mask
  305. >>8 leshort 5 \bCMYK
  306. >>8 leshort 6 \bYCbCr
  307. >>8 leshort 8 \bCIELab
  308. >>8 default x
  309. >>>8 leshort x \b(unknown=0x%x)
  310. >>12 use tiff_entry
  311. # FillOrder
  312. >0 leshort 0x10a
  313. >>4 lelong 1
  314. >>>12 use tiff_entry
  315. # DocumentName
  316. >0 leshort 0x10d
  317. >>(8.l) string x \b, name=%s
  318. >>>12 use tiff_entry
  319. # ImageDescription
  320. >0 leshort 0x10e
  321. >>(8.l) string x \b, description=%s
  322. >>>12 use tiff_entry
  323. # Make
  324. >0 leshort 0x10f
  325. >>(8.l) string x \b, manufacturer=%s
  326. >>>12 use tiff_entry
  327. # Model
  328. >0 leshort 0x110
  329. >>(8.l) string x \b, model=%s
  330. >>>12 use tiff_entry
  331. # StripOffsets
  332. >0 leshort 0x111
  333. >>12 use tiff_entry
  334. # Orientation
  335. >0 leshort 0x112 \b, orientation=
  336. >>8 leshort 1 \bupper-left
  337. >>8 leshort 3 \blower-right
  338. >>8 leshort 6 \bupper-right
  339. >>8 leshort 8 \blower-left
  340. >>8 leshort 9 \bundefined
  341. >>8 default x
  342. >>>8 leshort x \b[*%d*]
  343. >>12 use tiff_entry
  344. # XResolution
  345. >0 leshort 0x11a
  346. >>8 lelong x \b, xresolution=%d
  347. >>12 use tiff_entry
  348. # YResolution
  349. >0 leshort 0x11b
  350. >>8 lelong x \b, yresolution=%d
  351. >>12 use tiff_entry
  352. # ResolutionUnit
  353. >0 leshort 0x128
  354. >>8 leshort x \b, resolutionunit=%d
  355. >>12 use tiff_entry
  356. # Software
  357. >0 leshort 0x131
  358. >>(8.l) string x \b, software=%s
  359. >>12 use tiff_entry
  360. # Datetime
  361. >0 leshort 0x132
  362. >>(8.l) string x \b, datetime=%s
  363. >>12 use tiff_entry
  364. # HostComputer
  365. >0 leshort 0x13c
  366. >>(8.l) string x \b, hostcomputer=%s
  367. >>12 use tiff_entry
  368. # WhitePoint
  369. >0 leshort 0x13e
  370. >>12 use tiff_entry
  371. # PrimaryChromaticities
  372. >0 leshort 0x13f
  373. >>12 use tiff_entry
  374. # YCbCrCoefficients
  375. >0 leshort 0x211
  376. >>12 use tiff_entry
  377. # YCbCrPositioning
  378. >0 leshort 0x213
  379. >>12 use tiff_entry
  380. # ReferenceBlackWhite
  381. >0 leshort 0x214
  382. >>12 use tiff_entry
  383. # Copyright
  384. >0 leshort 0x8298
  385. >>(8.l) string x \b, copyright=%s
  386. >>12 use tiff_entry
  387. # ExifOffset
  388. >0 leshort 0x8769
  389. >>12 use tiff_entry
  390. # GPS IFD
  391. >0 leshort 0x8825 \b, GPS-Data
  392. >>12 use tiff_entry
  393. #>0 leshort x \b, unknown=0x%x
  394. #>>12 use tiff_entry
  395. 0 string MM\x00\x2b Big TIFF image data, big-endian
  396. !:mime image/tiff
  397. 0 string II\x2b\x00 Big TIFF image data, little-endian
  398. !:mime image/tiff
  399. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  400. # (Greg Roelofs, newt@uchicago.edu)
  401. # (Albert Cahalan, acahalan@cs.uml.edu)
  402. #
  403. # 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
  404. #
  405. # IHDR parser
  406. 0 name png-ihdr
  407. >0 belong x \b, %d x
  408. >4 belong x %d,
  409. >8 byte x %d-bit
  410. >9 byte 0 grayscale,
  411. >9 byte 2 \b/color RGB,
  412. >9 byte 3 colormap,
  413. >9 byte 4 gray+alpha,
  414. >9 byte 6 \b/color RGBA,
  415. #>10 byte 0 deflate/32K,
  416. >12 byte 0 non-interlaced
  417. >12 byte 1 interlaced
  418. # Standard PNG image.
  419. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
  420. !:mime image/png
  421. !:ext png
  422. !:strength +10
  423. >16 use png-ihdr
  424. # Apple CgBI PNG image.
  425. 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
  426. >24 string \x00\x00\x00\x0DIHDR PNG image data (CgBI)
  427. !:mime image/png
  428. !:ext png
  429. !:strength +10
  430. >>32 use png-ihdr
  431. # possible GIF replacements; none yet released!
  432. # (Greg Roelofs, newt@uchicago.edu)
  433. #
  434. # GRR 950115: this was mine ("Zip GIF"):
  435. 0 string GIF94z ZIF image (GIF+deflate alpha)
  436. !:mime image/x-unknown
  437. #
  438. # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
  439. #
  440. 0 string FGF95a FGF image (GIF+deflate beta)
  441. !:mime image/x-unknown
  442. #
  443. # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
  444. # (best; not yet implemented):
  445. #
  446. 0 string PBF PBF image (deflate compression)
  447. !:mime image/x-unknown
  448. # GIF
  449. # Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
  450. 0 string GIF8 GIF image data
  451. !:strength +80
  452. !:mime image/gif
  453. !:apple 8BIMGIFf
  454. >4 string 7a \b, version 8%s,
  455. >4 string 9a \b, version 8%s,
  456. >6 leshort >0 %d x
  457. >8 leshort >0 %d
  458. #>10 byte &0x80 color mapped,
  459. #>10 byte&0x07 =0x00 2 colors
  460. #>10 byte&0x07 =0x01 4 colors
  461. #>10 byte&0x07 =0x02 8 colors
  462. #>10 byte&0x07 =0x03 16 colors
  463. #>10 byte&0x07 =0x04 32 colors
  464. #>10 byte&0x07 =0x05 64 colors
  465. #>10 byte&0x07 =0x06 128 colors
  466. #>10 byte&0x07 =0x07 256 colors
  467. # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
  468. # 1 plane, no encoding.
  469. 0 string \361\0\100\273 CMU window manager raster image data
  470. >4 lelong >0 %d x
  471. >8 lelong >0 %d,
  472. >12 lelong >0 %d-bit
  473. # Magick Image File Format
  474. 0 string id=ImageMagick MIFF image data
  475. # Artisan
  476. 0 long 1123028772 Artisan image data
  477. >4 long 1 \b, rectangular 24-bit
  478. >4 long 2 \b, rectangular 8-bit with colormap
  479. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  480. # FIG (Facility for Interactive Generation of figures), an object-based format
  481. 0 search/1 #FIG FIG image text
  482. >5 string x \b, version %.3s
  483. # PHIGS
  484. 0 string ARF_BEGARF PHIGS clear text archive
  485. 0 string @(#)SunPHIGS SunPHIGS
  486. # version number follows, in the form m.n
  487. >40 string SunBin binary
  488. >32 string archive archive
  489. # GKS (Graphics Kernel System)
  490. 0 string GKSM GKS Metafile
  491. >24 string SunGKS \b, SunGKS
  492. # CGM image files
  493. 0 string BEGMF clear text Computer Graphics Metafile
  494. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  495. 0 string yz MGR bitmap, modern format, 8-bit aligned
  496. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  497. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  498. 0 string yx MGR bitmap, modern format, squeezed
  499. # Fuzzy Bitmap (FBM) images
  500. 0 string %bitmap\0 FBM image data
  501. >30 long 0x31 \b, mono
  502. >30 long 0x33 \b, color
  503. # facsimile data
  504. 1 string PC\ Research,\ Inc group 3 fax data
  505. >29 byte 0 \b, normal resolution (204x98 DPI)
  506. >29 byte 1 \b, fine resolution (204x196 DPI)
  507. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  508. 0 string Sfff structured fax file
  509. # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
  510. # most files with the extension .EPA and some with .BMP
  511. 0 string \x11\x06 Award BIOS Logo, 136 x 84
  512. !:mime image/x-award-bioslogo
  513. 0 string \x11\x09 Award BIOS Logo, 136 x 126
  514. !:mime image/x-award-bioslogo
  515. #0 string \x07\x1f BIOS Logo corrupted?
  516. # http://www.blackfiveservices.co.uk/awbmtools.shtml
  517. # http://biosgfx.narod.ru/v3/
  518. # http://biosgfx.narod.ru/abr-2/
  519. 0 string AWBM
  520. >4 leshort <1981 Award BIOS bitmap
  521. !:mime image/x-award-bmp
  522. # image width is a multiple of 4
  523. >>4 leshort&0x0003 0
  524. >>>4 leshort x \b, %d
  525. >>>6 leshort x x %d
  526. >>4 leshort&0x0003 >0 \b,
  527. >>>4 leshort&0x0003 =1
  528. >>>>4 leshort x %d+3
  529. >>>4 leshort&0x0003 =2
  530. >>>>4 leshort x %d+2
  531. >>>4 leshort&0x0003 =3
  532. >>>>4 leshort x %d+1
  533. >>>6 leshort x x %d
  534. # at offset 8 starts imagedata followed by "RGB " marker
  535. # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
  536. # https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
  537. # 28bitmap_information_header.29
  538. 0 string BM
  539. >14 leshort 12 PC bitmap, OS/2 1.x format
  540. !:mime image/x-ms-bmp
  541. >>18 leshort x \b, %d x
  542. >>20 leshort x %d
  543. >14 leshort 64 PC bitmap, OS/2 2.x format
  544. !:mime image/x-ms-bmp
  545. >>18 leshort x \b, %d x
  546. >>20 leshort x %d
  547. >14 leshort 40 PC bitmap, Windows 3.x format
  548. !:mime image/x-ms-bmp
  549. >>18 lelong x \b, %d x
  550. >>22 lelong x %d x
  551. >>28 leshort x %d
  552. >14 leshort 124 PC bitmap, Windows 98/2000 and newer format
  553. !:mime image/x-ms-bmp
  554. >>18 lelong x \b, %d x
  555. >>22 lelong x %d x
  556. >>28 leshort x %d
  557. >14 leshort 108 PC bitmap, Windows 95/NT4 and newer format
  558. !:mime image/x-ms-bmp
  559. >>18 lelong x \b, %d x
  560. >>22 lelong x %d x
  561. >>28 leshort x %d
  562. >14 leshort 128 PC bitmap, Windows NT/2000 format
  563. !:mime image/x-ms-bmp
  564. >>18 lelong x \b, %d x
  565. >>22 lelong x %d x
  566. >>28 leshort x %d
  567. # Too simple - MPi
  568. #0 string IC PC icon data
  569. #0 string PI PC pointer image data
  570. #0 string CI PC color icon data
  571. #0 string CP PC color pointer image data
  572. # Conflicts with other entries [BABYL]
  573. #0 string BA PC bitmap array data
  574. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  575. 0 search/1 /*\ XPM\ */ X pixmap image text
  576. !:mime image/x-xpmi
  577. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  578. 0 leshort 0xcc52 RLE image data,
  579. >6 leshort x %d x
  580. >8 leshort x %d
  581. >2 leshort >0 \b, lower left corner: %d
  582. >4 leshort >0 \b, lower right corner: %d
  583. >10 byte&0x1 =0x1 \b, clear first
  584. >10 byte&0x2 =0x2 \b, no background
  585. >10 byte&0x4 =0x4 \b, alpha channel
  586. >10 byte&0x8 =0x8 \b, comment
  587. >11 byte >0 \b, %d color channels
  588. >12 byte >0 \b, %d bits per pixel
  589. >13 byte >0 \b, %d color map channels
  590. # image file format (Robert Potter, potter@cs.rochester.edu)
  591. 0 string Imagefile\ version- iff image data
  592. # this adds the whole header (inc. version number), informative but longish
  593. >10 string >\0 %s
  594. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  595. 0 belong 0x59a66a95 Sun raster image data
  596. >4 belong >0 \b, %d x
  597. >8 belong >0 %d,
  598. >12 belong >0 %d-bit,
  599. #>16 belong >0 %d bytes long,
  600. >20 belong 0 old format,
  601. #>20 belong 1 standard,
  602. >20 belong 2 compressed,
  603. >20 belong 3 RGB,
  604. >20 belong 4 TIFF,
  605. >20 belong 5 IFF,
  606. >20 belong 0xffff reserved for testing,
  607. >24 belong 0 no colormap
  608. >24 belong 1 RGB colormap
  609. >24 belong 2 raw colormap
  610. #>28 belong >0 colormap is %d bytes long
  611. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  612. #
  613. # See
  614. # http://reality.sgi.com/grafica/sgiimage.html
  615. #
  616. 0 beshort 474 SGI image data
  617. #>2 byte 0 \b, verbatim
  618. >2 byte 1 \b, RLE
  619. #>3 byte 1 \b, normal precision
  620. >3 byte 2 \b, high precision
  621. >4 beshort x \b, %d-D
  622. >6 beshort x \b, %d x
  623. >8 beshort x %d
  624. >10 beshort x \b, %d channel
  625. >10 beshort !1 \bs
  626. >80 string >0 \b, "%s"
  627. 0 string IT01 FIT image data
  628. >4 belong x \b, %d x
  629. >8 belong x %d x
  630. >12 belong x %d
  631. #
  632. 0 string IT02 FIT image data
  633. >4 belong x \b, %d x
  634. >8 belong x %d x
  635. >12 belong x %d
  636. #
  637. 2048 string PCD_IPI Kodak Photo CD image pack file
  638. >0xe02 byte&0x03 0x00 , landscape mode
  639. >0xe02 byte&0x03 0x01 , portrait mode
  640. >0xe02 byte&0x03 0x02 , landscape mode
  641. >0xe02 byte&0x03 0x03 , portrait mode
  642. 0 string PCD_OPA Kodak Photo CD overview pack file
  643. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  644. # FITS is the Flexible Image Transport System, the de facto standard for
  645. # data and image transfer, storage, etc., for the astronomical community.
  646. # (FITS floating point formats are big-endian.)
  647. 0 string SIMPLE\ \ = FITS image data
  648. !:mime image/fits
  649. !:ext fits/fts
  650. >109 string 8 \b, 8-bit, character or unsigned binary integer
  651. >108 string 16 \b, 16-bit, two's complement binary integer
  652. >107 string \ 32 \b, 32-bit, two's complement binary integer
  653. >107 string -32 \b, 32-bit, floating point, single precision
  654. >107 string -64 \b, 64-bit, floating point, double precision
  655. # other images
  656. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  657. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  658. # stuff.
  659. #
  660. 0 beshort 0x1010 PEX Binary Archive
  661. # DICOM medical imaging data
  662. # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
  663. # Note: "dcm" is the official file name extension
  664. # XnView mention also "dc3" and "acr" as file name extension
  665. 128 string DICM DICOM medical imaging data
  666. !:mime application/dicom
  667. !:ext dcm/dicom/dic
  668. # XWD - X Window Dump file.
  669. # As described in /usr/X11R6/include/X11/XWDFile.h
  670. # used by the xwd program.
  671. # Bradford Castalia, idaeim, 1/01
  672. # updated by Adam Buchbinder, 2/09
  673. # The following assumes version 7 of the format; the first long is the length
  674. # of the header, which is at least 25 4-byte longs, and the one at offset 8
  675. # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  676. # which is a maximum of 32.
  677. 0 belong >100
  678. >8 belong <3
  679. >>12 belong <33
  680. >>>4 belong 7 XWD X Window Dump image data
  681. !:mime image/x-xwindowdump
  682. >>>>100 string >\0 \b, "%s"
  683. >>>>16 belong x \b, %dx
  684. >>>>20 belong x \b%dx
  685. >>>>12 belong x \b%d
  686. # PDS - Planetary Data System
  687. # These files use Parameter Value Language in the header section.
  688. # Unfortunately, there is no certain magic, but the following
  689. # strings have been found to be most likely.
  690. 0 string NJPL1I00 PDS (JPL) image data
  691. 2 string NJPL1I PDS (JPL) image data
  692. 0 string CCSD3ZF PDS (CCSD) image data
  693. 2 string CCSD3Z PDS (CCSD) image data
  694. 0 string PDS_ PDS image data
  695. 0 string LBLSIZE= PDS (VICAR) image data
  696. # pM8x: ATARI STAD compressed bitmap format
  697. #
  698. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  699. # p M 8 5/6 xx yy zz data...
  700. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  701. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  702. # most frequent byte, xx and zz are runlength escape codes, where xx is
  703. # used for runs of yy.
  704. #
  705. 0 string pM85 Atari ST STAD bitmap image data (hor)
  706. >5 byte 0x00 (white background)
  707. >5 byte 0xFF (black background)
  708. 0 string pM86 Atari ST STAD bitmap image data (vert)
  709. >5 byte 0x00 (white background)
  710. >5 byte 0xFF (black background)
  711. # From: Alex Myczko <alex@aiei.ch>
  712. # https://www.atarimax.com/jindroush.atari.org/afmtatr.html
  713. 0 leshort 0x0296 Atari ATR image
  714. # XXX:
  715. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  716. # magic.
  717. # SGI RICE image file <mpruett@sgi.com>
  718. #0 beshort 0x5249 RICE image
  719. #>2 beshort x v%d
  720. #>4 beshort x (%d x
  721. #>6 beshort x %d)
  722. #>8 beshort 0 8 bit
  723. #>8 beshort 1 10 bit
  724. #>8 beshort 2 12 bit
  725. #>8 beshort 3 13 bit
  726. #>10 beshort 0 4:2:2
  727. #>10 beshort 1 4:2:2:4
  728. #>10 beshort 2 4:4:4
  729. #>10 beshort 3 4:4:4:4
  730. #>12 beshort 1 RGB
  731. #>12 beshort 2 CCIR601
  732. #>12 beshort 3 RP175
  733. #>12 beshort 4 YUV
  734. # PCX image files
  735. # From: Dan Fandrich <dan@coneharvesters.com>
  736. # updated by Joerg Jenderek at Feb 2013 by https://de.wikipedia.org/wiki/PCX
  737. # https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
  738. # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
  739. # 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
  740. 0 ubelong&0xffF8fe00 0x0a000000
  741. # for PCX bit depth > 0
  742. >3 ubyte >0
  743. # test for valid versions
  744. >>1 ubyte <6
  745. >>>1 ubyte !1 PCX
  746. !:mime image/x-pcx
  747. #!:mime image/pcx
  748. >>>>1 ubyte 0 ver. 2.5 image data
  749. >>>>1 ubyte 2 ver. 2.8 image data, with palette
  750. >>>>1 ubyte 3 ver. 2.8 image data, without palette
  751. >>>>1 ubyte 4 for Windows image data
  752. >>>>1 ubyte 5 ver. 3.0 image data
  753. >>>>4 uleshort x bounding box [%d,
  754. >>>>6 uleshort x %d] -
  755. >>>>8 uleshort x [%d,
  756. >>>>10 uleshort x %d],
  757. >>>>65 ubyte >1 %d planes each of
  758. >>>>3 ubyte x %d-bit
  759. >>>>68 byte 1 colour,
  760. >>>>68 byte 2 grayscale,
  761. # this should not happen
  762. >>>>68 default x image,
  763. >>>>12 leshort >0 %d x
  764. >>>>>14 uleshort x %d dpi,
  765. >>>>2 byte 0 uncompressed
  766. >>>>2 byte 1 RLE compressed
  767. # Adobe Photoshop
  768. # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
  769. 0 string 8BPS Adobe Photoshop Image
  770. !:mime image/vnd.adobe.photoshop
  771. >4 beshort 2 (PSB)
  772. >18 belong x \b, %d x
  773. >14 belong x %d,
  774. >24 beshort 0 bitmap
  775. >24 beshort 1 grayscale
  776. >>12 beshort 2 with alpha
  777. >24 beshort 2 indexed
  778. >24 beshort 3 RGB
  779. >>12 beshort 4 \bA
  780. >24 beshort 4 CMYK
  781. >>12 beshort 5 \bA
  782. >24 beshort 7 multichannel
  783. >24 beshort 8 duotone
  784. >24 beshort 9 lab
  785. >12 beshort > 1
  786. >>12 beshort x \b, %dx
  787. >12 beshort 1 \b,
  788. >22 beshort x %d-bit channel
  789. >12 beshort > 1 \bs
  790. # XV thumbnail indicator (ThMO)
  791. 0 string P7\ 332 XV thumbnail image data
  792. # NITF is defined by United States MIL-STD-2500A
  793. 0 string NITF National Imagery Transmission Format
  794. >25 string >\0 dated %.14s
  795. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  796. # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
  797. # Update: Joerg Jenderek
  798. # See http://fileformats.archiveteam.org/wiki/GEM_Raster
  799. # For variations, also see:
  800. # https://www.seasip.info/Gem/ff_img.html (Ventura)
  801. # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
  802. # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
  803. # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
  804. 0 beshort 0x0001
  805. # header_size
  806. >2 beshort 0x0008
  807. >>0 use gem_info
  808. >2 beshort 0x0009
  809. >>0 use gem_info
  810. # no example for NOSIG
  811. >2 beshort 24
  812. >>0 use gem_info
  813. # no example for HYPERPAINT
  814. >2 beshort 25
  815. >>0 use gem_info
  816. 16 string XIMG\0
  817. >0 use gem_info
  818. # no example
  819. 16 string STTT\0\x10
  820. >0 use gem_info
  821. # no example or description
  822. 16 string TIMG\0
  823. >0 use gem_info
  824. 0 name gem_info
  825. # version is 2 for some XIMG and 1 for all others
  826. >0 beshort <0x0003 GEM
  827. # https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
  828. !:mime image/x-gem
  829. # header_size 24 25 27 59 779 words for colored bitmaps
  830. >>2 beshort >9
  831. >>>16 string STTT\0\x10 STTT
  832. >>>16 string TIMG\0 TIMG
  833. # HYPERPAINT or NOSIG variant
  834. >>>16 string \0\x80
  835. >>>>2 beshort =24 NOSIG
  836. >>>>2 beshort !24 HYPERPAINT
  837. # NOSIG or XIMG variant
  838. >>>16 default x
  839. >>>>16 string !XIMG\0 NOSIG
  840. >>16 string =XIMG\0 XIMG Image data
  841. !:ext img/ximg
  842. # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
  843. >>16 string !XIMG\0 Image data
  844. !:ext img
  845. # header_size is 9 for Ventura files and 8 for other GEM Paint files
  846. >>2 beshort 9 (Ventura)
  847. #>>2 beshort 8 (Paint)
  848. >>12 beshort x %d x
  849. >>14 beshort x %d,
  850. # 1 4 8
  851. >>4 beshort x %d planes,
  852. # in tenths of a millimetre
  853. >>8 beshort x %d x
  854. >>10 beshort x %d pixelsize
  855. # pattern_size 1-8. 2 for GEM Paint
  856. >>6 beshort !2 \b, pattern size %d
  857. # GEM Metafile (Wolfram Kleff)
  858. 0 lelong 0x0018FFFF GEM Metafile data
  859. >4 leshort x version %d
  860. #
  861. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  862. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  863. #
  864. 0 string \0\nSMJPEG SMJPEG
  865. >8 belong x %d.x data
  866. # According to the specification you could find any number of _TXT
  867. # headers here, but I can't think of any way of handling that. None of
  868. # the SMJPEG files I tried it on used this feature. Even if such a
  869. # file is encountered the output should still be reasonable.
  870. >16 string _SND \b,
  871. >>24 beshort >0 %d Hz
  872. >>26 byte 8 8-bit
  873. >>26 byte 16 16-bit
  874. >>28 string NONE uncompressed
  875. # >>28 string APCM ADPCM compressed
  876. >>27 byte 1 mono
  877. >>28 byte 2 stereo
  878. # Help! Isn't there any way to avoid writing this part twice?
  879. >>32 string _VID \b,
  880. # >>>48 string JFIF JPEG
  881. >>>40 belong >0 %d frames
  882. >>>44 beshort >0 (%d x
  883. >>>46 beshort >0 %d)
  884. >16 string _VID \b,
  885. # >>32 string JFIF JPEG
  886. >>24 belong >0 %d frames
  887. >>28 beshort >0 (%d x
  888. >>30 beshort >0 %d)
  889. 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
  890. # "thumbnail file" (icon)
  891. # descended from "xv", but in use by other applications as well (Wolfram Kleff)
  892. 0 string P7\ 332 XV "thumbnail file" (icon) data
  893. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  894. 0 string KiSS KISS/GS
  895. >4 byte 16 color
  896. >>5 byte x %d bit
  897. >>8 leshort x %d colors
  898. >>10 leshort x %d groups
  899. >4 byte 32 cell
  900. >>5 byte x %d bit
  901. >>8 leshort x %d x
  902. >>10 leshort x %d
  903. >>12 leshort x +%d
  904. >>14 leshort x +%d
  905. # Webshots (www.webshots.com), by John Harrison
  906. 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  907. # Hercules DASD image files
  908. # From Jan Jaeger <jj@septa.nl>
  909. 0 string CKD_P370 Hercules CKD DASD image file
  910. >8 long x \b, %d heads per cylinder
  911. >12 long x \b, track size %d bytes
  912. >16 byte x \b, device type 33%2.2X
  913. 0 string CKD_C370 Hercules compressed CKD DASD image file
  914. >8 long x \b, %d heads per cylinder
  915. >12 long x \b, track size %d bytes
  916. >16 byte x \b, device type 33%2.2X
  917. 0 string CKD_S370 Hercules CKD DASD shadow file
  918. >8 long x \b, %d heads per cylinder
  919. >12 long x \b, track size %d bytes
  920. >16 byte x \b, device type 33%2.2X
  921. # Squeak images and programs - etoffi@softhome.net
  922. 0 string \146\031\0\0 Squeak image data
  923. 0 search/1 'From\040Squeak Squeak program text
  924. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  925. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  926. 0 string PaRtImAgE-VoLuMe PartImage
  927. >0x0020 string 0.6.1 file version %s
  928. >>0x0060 lelong >-1 volume %d
  929. #>>0x0064 8 byte identifier
  930. #>>0x007c reserved
  931. >>0x0200 string >\0 type %s
  932. >>0x1400 string >\0 device %s,
  933. >>0x1600 string >\0 original filename %s,
  934. # Some fields omitted
  935. >>0x2744 lelong 0 not compressed
  936. >>0x2744 lelong 1 gzip compressed
  937. >>0x2744 lelong 2 bzip2 compressed
  938. >>0x2744 lelong >2 compressed with unknown algorithm
  939. >0x0020 string >0.6.1 file version %s
  940. >0x0020 string <0.6.1 file version %s
  941. # DCX is multi-page PCX, using a simple header of up to 1024
  942. # offsets for the respective PCX components.
  943. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  944. 0 lelong 987654321 DCX multi-page PCX image data
  945. # Simon Walton <simonw@matteworld.com>
  946. # Kodak Cineon format for scanned negatives
  947. # http://www.kodak.com/US/en/motion/support/dlad/
  948. 0 lelong 0xd75f2a80 Cineon image data
  949. >200 belong >0 \b, %d x
  950. >204 belong >0 %d
  951. # Bio-Rad .PIC is an image format used by microscope control systems
  952. # and related image processing software used by biologists.
  953. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  954. # BOOL values are two-byte integers; use them to rule out false positives.
  955. # https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
  956. # Samples: https://www.loci.wisc.edu/software/sample-data
  957. 14 leshort <2
  958. >62 leshort <2
  959. >>54 leshort 12345 Bio-Rad .PIC Image File
  960. >>>0 leshort >0 %d x
  961. >>>2 leshort >0 %d,
  962. >>>4 leshort =1 1 image in file
  963. >>>4 leshort >1 %d images in file
  964. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  965. # The description of *.mrw format can be found at
  966. # http://www.dalibor.cz/minolta/raw_file_format.htm
  967. 0 string \000MRM Minolta Dimage camera raw image data
  968. # Summary: DjVu image / document
  969. # Extension: .djvu
  970. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  971. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  972. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  973. 0 string AT&TFORM
  974. >12 string DJVM DjVu multiple page document
  975. !:mime image/vnd.djvu
  976. >12 string DJVU DjVu image or single page document
  977. !:mime image/vnd.djvu
  978. >12 string DJVI DjVu shared document
  979. !:mime image/vnd.djvu
  980. >12 string THUM DjVu page thumbnails
  981. !:mime image/vnd.djvu
  982. # Originally by Marc Espie
  983. # Modified by Robert Minsk <robertminsk at yahoo.com>
  984. # https://www.openexr.com/openexrfilelayout.pdf
  985. 0 lelong 20000630 OpenEXR image data,
  986. !:mime image/x-exr
  987. >4 lelong&0x000000ff x version %d,
  988. >4 lelong ^0x00000200 storage: scanline
  989. >4 lelong &0x00000200 storage: tiled
  990. >8 search/0x1000 compression\0 \b, compression:
  991. >>&16 byte 0 none
  992. >>&16 byte 1 rle
  993. >>&16 byte 2 zips
  994. >>&16 byte 3 zip
  995. >>&16 byte 4 piz
  996. >>&16 byte 5 pxr24
  997. >>&16 byte 6 b44
  998. >>&16 byte 7 b44a
  999. >>&16 byte 8 dwaa
  1000. >>&16 byte 9 dwab
  1001. >>&16 byte >9 unknown
  1002. >8 search/0x1000 dataWindow\0 \b, dataWindow:
  1003. >>&10 lelong x (%d
  1004. >>&14 lelong x %d)-
  1005. >>&18 lelong x \b(%d
  1006. >>&22 lelong x %d)
  1007. >8 search/0x1000 displayWindow\0 \b, displayWindow:
  1008. >>&10 lelong x (%d
  1009. >>&14 lelong x %d)-
  1010. >>&18 lelong x \b(%d
  1011. >>&22 lelong x %d)
  1012. >8 search/0x1000 lineOrder\0 \b, lineOrder:
  1013. >>&14 byte 0 increasing y
  1014. >>&14 byte 1 decreasing y
  1015. >>&14 byte 2 random y
  1016. >>&14 byte >2 unknown
  1017. # SMPTE Digital Picture Exchange Format, SMPTE DPX
  1018. #
  1019. # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
  1020. # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
  1021. # Robert Minsk <robertminsk at yahoo.com>
  1022. # Modified by Harry Mallon <hjmallon at gmail.com>
  1023. 0 string SDPX DPX image data, big-endian,
  1024. !:mime image/x-dpx
  1025. >0 use dpx_info
  1026. 0 string XPDS DPX image data, little-endian,
  1027. !:mime image/x-dpx
  1028. >0 use \^dpx_info
  1029. 0 name dpx_info
  1030. >768 beshort <4
  1031. >>772 belong x %dx
  1032. >>776 belong x \b%d,
  1033. >768 beshort >3
  1034. >>776 belong x %dx
  1035. >>772 belong x \b%d,
  1036. >768 beshort 0 left to right/top to bottom
  1037. >768 beshort 1 right to left/top to bottom
  1038. >768 beshort 2 left to right/bottom to top
  1039. >768 beshort 3 right to left/bottom to top
  1040. >768 beshort 4 top to bottom/left to right
  1041. >768 beshort 5 top to bottom/right to left
  1042. >768 beshort 6 bottom to top/left to right
  1043. >768 beshort 7 bottom to top/right to left
  1044. # From: Tom Hilinski <tom.hilinski@comcast.net>
  1045. # https://www.unidata.ucar.edu/packages/netcdf/
  1046. 0 string CDF\001 NetCDF Data Format data
  1047. #-----------------------------------------------------------------------
  1048. # Hierarchical Data Format, used to facilitate scientific data exchange
  1049. # specifications at http://hdf.ncsa.uiuc.edu/
  1050. 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
  1051. !:mime application/x-hdf
  1052. 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
  1053. !:mime application/x-hdf
  1054. 512 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 512 bytes user block
  1055. !:mime application/x-hdf
  1056. 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
  1057. !:mime application/x-hdf
  1058. 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
  1059. !:mime application/x-hdf
  1060. 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
  1061. !:mime application/x-hdf
  1062. # From: Tobias Burnus <burnus@net-b.de>
  1063. # Xara (for a while: Corel Xara) is a graphic package, see
  1064. # http://www.xara.com/ for Windows and as GPL application for Linux
  1065. 0 string XARA\243\243 Xara graphics file
  1066. # https://www.cartesianinc.com/Tech/
  1067. 0 string CPC\262 Cartesian Perceptual Compression image
  1068. !:mime image/x-cpi
  1069. # From Albert Cahalan <acahalan@gmail.com>
  1070. # puredigital used it for the CVS disposable camcorder
  1071. #8 lelong 4 ZBM bitmap image data
  1072. #>4 leshort x %u x
  1073. #>6 leshort x %u
  1074. # From Albert Cahalan <acahalan@gmail.com>
  1075. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  1076. 0 string C565 OLPC firmware icon image data
  1077. >4 leshort x %u x
  1078. >6 leshort x %u
  1079. # Applied Images - Image files from Cytovision
  1080. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  1081. 0 string \xce\xda\xde\xfa Cytovision Metaphases file
  1082. 0 string \xed\xad\xef\xac Cytovision Karyotype file
  1083. 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
  1084. 0 string \xed\xfe\xda\xbe Cytovision FLEX file
  1085. 0 string \xed\xab\xed\xfe Cytovision FLEX file
  1086. 0 string \xad\xfd\xea\xad Cytovision RATS file
  1087. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  1088. # From Tano M Fotang <mfotang@quanteq.com>
  1089. 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
  1090. # Type: PCO B16 image files
  1091. # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
  1092. # From: Florian Philipp <florian.philipp@binarywings.net>
  1093. # Extension: .b16
  1094. # Description: Pixel image format produced by PCO Camware, typically used
  1095. # together with PCO cameras.
  1096. # Note: Different versions exist for e.g. 8 bit and 16 bit images.
  1097. # Documentation is incomplete.
  1098. 0 string/b PCO- PCO B16 image data
  1099. >12 lelong x \b, %dx
  1100. >16 lelong x \b%d
  1101. >20 lelong 0 \b, short header
  1102. >20 lelong -1 \b, extended header
  1103. >>24 lelong 0 \b, grayscale
  1104. >>>36 lelong 0 linear LUT
  1105. >>>36 lelong 1 logarithmic LUT
  1106. >>>28 lelong x [%d
  1107. >>>32 lelong x \b,%d]
  1108. >>24 lelong 1 \b, color
  1109. >>>64 lelong 0 linear LUT
  1110. >>>64 lelong 1 logarithmic LUT
  1111. >>>40 lelong x r[%d
  1112. >>>44 lelong x \b,%d]
  1113. >>>48 lelong x g[%d
  1114. >>>52 lelong x \b,%d]
  1115. >>>56 lelong x b[%d
  1116. >>>60 lelong x \b,%d]
  1117. # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
  1118. # From: Markus Heidelberg <markus.heidelberg at web.de>
  1119. 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
  1120. !:mime image/x-polar-monitor-bitmap
  1121. # From: Rick Richardson <rickrich@gmail.com>
  1122. # updated by: Joerg Jenderek
  1123. # URL: http://techmods.net/nuvi/
  1124. 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
  1125. # extension is also used for
  1126. # Sony SRF raw image (image/x-sony-srf)
  1127. # SRF map
  1128. # Terragen Surface Map (https://www.planetside.co.uk/terragen)
  1129. # FileLocator Pro search criteria file (https://www.mythicsoft.com/filelocatorpro)
  1130. !:ext srf
  1131. #!:mime image/x-garmin-srf
  1132. # version 1.00,2.00,2.10,2.40,2.50
  1133. >0x2f string >0 \b, version %4.4s
  1134. # width (2880,2881,3240)
  1135. >0x55 uleshort >0 \b, %dx
  1136. # height (80,90)
  1137. >>0x53 uleshort x \b%d
  1138. # Type: Ulead Photo Explorer5 (.pe5)
  1139. # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
  1140. # From: Simon Horman <horms@debian.org>
  1141. 0 string IIO2H Ulead Photo Explorer5
  1142. # Type: X11 cursor
  1143. # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  1144. # From: Mathias Brodala <info@noctus.net>
  1145. 0 string Xcur X11 cursor
  1146. # Type: Olympus ORF raw images.
  1147. # URL: https://libopenraw.freedesktop.org/wiki/Olympus_ORF
  1148. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1149. 0 string MMOR Olympus ORF raw image data, big-endian
  1150. !:mime image/x-olympus-orf
  1151. 0 string IIRO Olympus ORF raw image data, little-endian
  1152. !:mime image/x-olympus-orf
  1153. 0 string IIRS Olympus ORF raw image data, little-endian
  1154. !:mime image/x-olympus-orf
  1155. # Type: files used in modern AVCHD camcoders to store clip information
  1156. # Extension: .cpi
  1157. # From: Alexander Danilov <alexander.a.danilov@gmail.com>
  1158. 0 string HDMV0100 AVCHD Clip Information
  1159. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1160. # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
  1161. # Radiance HDR; usually has .pic or .hdr extension.
  1162. 0 string #?RADIANCE\n Radiance HDR image data
  1163. #!mime image/vnd.radiance
  1164. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1165. # URL: https://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
  1166. # Used by the pfstools packages. The regex matches for the image size could
  1167. # probably use some work. The MIME type is made up; if there's one in
  1168. # actual common use, it should replace the one below.
  1169. 0 string PFS1\x0a PFS HDR image data
  1170. #!mime image/x-pfs
  1171. >1 regex [0-9]*\ \b, %s
  1172. >>1 regex \ [0-9]{4} \bx%s
  1173. # Type: Foveon X3F
  1174. # URL: https://www.photofo.com/downloads/x3f-raw-format.pdf
  1175. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1176. # Note that the MIME type isn't defined anywhere that I can find; if
  1177. # there's a canonical type for this format, it should replace this one.
  1178. 0 string FOVb Foveon X3F raw image data
  1179. !:mime image/x-x3f
  1180. >6 leshort x \b, version %d.
  1181. >4 leshort x \b%d
  1182. >28 lelong x \b, %dx
  1183. >32 lelong x \b%d
  1184. # Paint.NET file
  1185. # From Adam Buchbinder <adam.buchbinder@gmail.com>
  1186. 0 string PDN3 Paint.NET image data
  1187. !:mime image/x-paintnet
  1188. # Not really an image.
  1189. # From: "Tano M. Fotang" <mfotang@quanteq.com>
  1190. 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
  1191. # doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
  1192. # example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
  1193. 90 bequad 0x574D50484F544F00 JPEG-XR Image
  1194. >98 byte&0x08 =0x08 \b, hard tiling
  1195. >99 byte&0x80 =0x80 \b, tiling present
  1196. >99 byte&0x40 =0x40 \b, codestream present
  1197. >99 byte&0x38 x \b, spatial xform=
  1198. >99 byte&0x38 0x00 \bTL
  1199. >99 byte&0x38 0x08 \bBL
  1200. >99 byte&0x38 0x10 \bTR
  1201. >99 byte&0x38 0x18 \bBR
  1202. >99 byte&0x38 0x20 \bBT
  1203. >99 byte&0x38 0x28 \bRB
  1204. >99 byte&0x38 0x30 \bLT
  1205. >99 byte&0x38 0x38 \bLB
  1206. >100 byte&0x80 =0x80 \b, short header
  1207. >>102 beshort+1 x \b, %d
  1208. >>104 beshort+1 x \bx%d
  1209. >100 byte&0x80 =0x00 \b, long header
  1210. >>102 belong+1 x \b, %x
  1211. >>106 belong+1 x \bx%x
  1212. >101 beshort&0xf x \b, bitdepth=
  1213. >>101 beshort&0xf 0x0 \b1-WHITE=1
  1214. >>101 beshort&0xf 0x1 \b8
  1215. >>101 beshort&0xf 0x2 \b16
  1216. >>101 beshort&0xf 0x3 \b16-SIGNED
  1217. >>101 beshort&0xf 0x4 \b16-FLOAT
  1218. >>101 beshort&0xf 0x5 \b(reserved 5)
  1219. >>101 beshort&0xf 0x6 \b32-SIGNED
  1220. >>101 beshort&0xf 0x7 \b32-FLOAT
  1221. >>101 beshort&0xf 0x8 \b5
  1222. >>101 beshort&0xf 0x9 \b10
  1223. >>101 beshort&0xf 0xa \b5-6-5
  1224. >>101 beshort&0xf 0xb \b(reserved %d)
  1225. >>101 beshort&0xf 0xc \b(reserved %d)
  1226. >>101 beshort&0xf 0xd \b(reserved %d)
  1227. >>101 beshort&0xf 0xe \b(reserved %d)
  1228. >>101 beshort&0xf 0xf \b1-BLACK=1
  1229. >101 beshort&0xf0 x \b, colorfmt=
  1230. >>101 beshort&0xf0 0x00 \bYONLY
  1231. >>101 beshort&0xf0 0x10 \bYUV240
  1232. >>101 beshort&0xf0 0x20 \bYWV422
  1233. >>101 beshort&0xf0 0x30 \bYWV444
  1234. >>101 beshort&0xf0 0x40 \bCMYK
  1235. >>101 beshort&0xf0 0x50 \bCMYKDIRECT
  1236. >>101 beshort&0xf0 0x60 \bNCOMPONENT
  1237. >>101 beshort&0xf0 0x70 \bRGB
  1238. >>101 beshort&0xf0 0x80 \bRGBE
  1239. >>101 beshort&0xf0 >0x80 \b(reserved 0x%x)
  1240. # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
  1241. #
  1242. # BPG (Better Portable Graphics) format
  1243. # https://bellard.org/bpg/
  1244. # http://fileformats.archiveteam.org/wiki/BPG
  1245. #
  1246. 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
  1247. !:mime image/bpg
  1248. # From: Joerg Jenderek
  1249. # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
  1250. 0 string icns Mac OS X icon
  1251. !:mime image/x-icns
  1252. !:apple ????icns
  1253. !:ext icns
  1254. >4 ubelong >0
  1255. # file size
  1256. >>4 ubelong x \b, %d bytes
  1257. # icon type
  1258. >>8 string x \b, "%4.4s" type
  1259. # TIM images
  1260. 0 lelong 0x00000010 TIM image,
  1261. >4 lelong 0x8 4-Bit,
  1262. >4 lelong 0x9 8-Bit,
  1263. >4 lelong 0x2 15-Bit,
  1264. >4 lelong 0x3 24-Bit,
  1265. >4 lelong &8
  1266. >>(8.l+12) leshort x Pixel at (%d,
  1267. >>(8.l+14) leshort x \b%d)
  1268. >>(8.l+16) leshort x Size=%dx
  1269. >>(8.l+18) leshort x \b%d,
  1270. >>4 lelong 0x8 16 CLUT Entries at
  1271. >>4 lelong 0x9 256 CLUT Entries at
  1272. >>12 leshort x (%d,
  1273. >>14 leshort x \b%d)
  1274. >4 lelong ^8
  1275. >>12 leshort x Pixel at (%d,
  1276. >>14 leshort x \b%d)
  1277. >>16 leshort x Size=%dx
  1278. >>18 leshort x \b%d
  1279. # MDEC streams
  1280. 0 lelong 0x80010160 MDEC video stream,
  1281. >16 leshort x %dx
  1282. >18 leshort x \b%d
  1283. #>8 lelong x %d frames
  1284. #>4 leshort x secCount=%d;
  1285. #>6 leshort x nSectors=%d;
  1286. #>12 lelong x frameSize=%d;
  1287. # BS encoded bitstreams
  1288. 2 leshort 0x3800 BS image,
  1289. >6 leshort x Version %d,
  1290. >4 leshort x Quantization %d,
  1291. >0 leshort x (Decompresses to %d words)
  1292. # Type: farbfeld image.
  1293. # Url: http://tools.suckless.org/farbfeld/
  1294. # From: Ian D. Scott <ian@iandouglasscott.com>
  1295. #
  1296. 0 string farbfeld farbfeld image data,
  1297. >8 ubelong x %dx
  1298. >12 ubelong x \b%d
  1299. # Type: Microsoft DirectDraw Surface (common data)
  1300. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  1301. # From: Morten Hustveit <morten@debian.org>
  1302. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  1303. 0 name ms-directdraw-surface
  1304. >0x10 ulelong x %u x
  1305. >0x0C ulelong x %u
  1306. # Color depth.
  1307. >0x58 ulelong >0 \b, %u-bit color
  1308. # Determine the pixel format.
  1309. >0x50 ulelong&0x4 4
  1310. # FIXME: Handle DX10 and XBOX formats.
  1311. >>0x54 string x \b, compressed using %.4s
  1312. >0x50 ulelong&0x2 0x2 \b, alpha only
  1313. >0x50 ulelong&0x200 0x200 \b, YUV
  1314. >0x50 ulelong&0x20000 0x20000 \b, luminance
  1315. # RGB pixel format
  1316. >0x50 ulelong&0x40 0x40
  1317. # Determine the RGB format using the color masks.
  1318. # ulequad order: 0xGGGGGGGGRRRRRRRR, 0xAAAAAAAABBBBBBBB
  1319. >>0x58 ulelong 16
  1320. # NOTE: 15-bit color formats usually have 16-bit listed as the color depth.
  1321. >>>0x5C ulequad 0x000003E000007C00
  1322. >>>>0x64 ulequad 0x000000000000001F \b, RGB555
  1323. >>>0x5C ulequad 0x000003E000001F00
  1324. >>>>0x64 ulequad 0x000000000000007C \b, BGR555
  1325. >>>0x5C ulequad 0x000007E00000F800
  1326. >>>>0x64 ulequad 0x000000000000001F \b, RGB565
  1327. >>>0x5C ulequad 0x000007E000001F00
  1328. >>>>0x64 ulequad 0x00000000000000F8 \b, BGR565
  1329. >>>0x5C ulequad 0x000000F000000F00
  1330. >>>>0x64 ulequad 0x0000F0000000000F \b, ARGB4444
  1331. >>>0x5C ulequad 0x000000F00000000F
  1332. >>>>0x64 ulequad 0x0000F00000000F00 \b, ABGR4444
  1333. >>>0x5C ulequad 0x00000F000000F000
  1334. >>>>0x64 ulequad 0x0000000F000000F0 \b, RGBA4444
  1335. >>>0x5C ulequad 0x00000F00000000F0
  1336. >>>>0x64 ulequad 0x0000000F0000F000 \b, BGRA4444
  1337. >>>0x5C ulequad 0x000000F000000F00
  1338. >>>>0x64 ulequad 0x000000000000000F \b, xRGB4444
  1339. >>>0x5C ulequad 0x000000F00000000F
  1340. >>>>0x64 ulequad 0x0000000000000F00 \b, xBGR4444
  1341. >>>0x5C ulequad 0x00000F000000F000
  1342. >>>>0x64 ulequad 0x00000000000000F0 \b, RGBx4444
  1343. >>>0x5C ulequad 0x00000F00000000F0
  1344. >>>>0x64 ulequad 0x000000000000F000 \b, BGRx4444
  1345. >>>0x5C ulequad 0x000003E000007C00
  1346. >>>>0x64 ulequad 0x000080000000001F \b, ARGB1555
  1347. >>>0x5C ulequad 0x000003E000001F00
  1348. >>>>0x64 ulequad 0x000080000000007C \b, ABGR1555
  1349. >>>0x5C ulequad 0x000007C00000F800
  1350. >>>>0x64 ulequad 0x000000010000003E \b, RGBA5551
  1351. >>>0x5C ulequad 0x000007C00000003E
  1352. >>>>0x64 ulequad 0x000000010000F800 \b, BGRA5551
  1353. >>88 ulelong 24
  1354. >>>0x5C ulequad 0x0000FF0000FF0000
  1355. >>>>0x64 ulequad 0x00000000000000FF \b, RGB888
  1356. >>>0x5C ulequad 0x0000FF00000000FF
  1357. >>>>0x64 ulequad 0x0000000000FF0000 \b, BGR888
  1358. >>88 ulelong 32
  1359. >>>0x5C ulequad 0x0000FF0000FF0000
  1360. >>>>0x64 ulequad 0xFF000000000000FF \b, ARGB8888
  1361. >>>0x5C ulequad 0x0000FF00000000FF
  1362. >>>>0x64 ulequad 0xFF00000000FF0000 \b, ABGR8888
  1363. >>>0x5C ulequad 0x00FF0000FF000000
  1364. >>>>0x64 ulequad 0x000000FF0000FF00 \b, RGBA8888
  1365. >>>0x5C ulequad 0x00FF00000000FF00
  1366. >>>>0x64 ulequad 0x000000FFFF000000 \b, BGBA8888
  1367. >>>0x5C ulequad 0x0000FF0000FF0000
  1368. >>>>0x64 ulequad 0x00000000000000FF \b, xRGB8888
  1369. >>>0x5C ulequad 0x0000FF00000000FF
  1370. >>>>0x64 ulequad 0x0000000000FF0000 \b, xBGR8888
  1371. >>>0x5C ulequad 0x00FF0000FF000000
  1372. >>>>0x64 ulequad 0x000000000000FF00 \b, RGBx8888
  1373. >>>0x5C ulequad 0x00FF00000000FF00
  1374. >>>>0x64 ulequad 0x00000000FF000000 \b, BGBx8888
  1375. # Less common 32-bit color formats.
  1376. >>>0x5C ulequad 0xFFFF00000000FFFF
  1377. >>>>0x64 ulequad 0x0000000000000000 \b, G16R16
  1378. >>>0x5C ulequad 0x0000FFFFFFFF0000
  1379. >>>>0x64 ulequad 0x0000000000000000 \b, R16G16
  1380. >>>0x5C ulequad 0x000FFC003FF00000
  1381. >>>>0x64 ulequad 0xC0000000000003FF \b, A2R10G10B10
  1382. >>>0x5C ulequad 0x000FFC00000003FF
  1383. >>>>0x64 ulequad 0xC00000003FF00000 \b, A2B10G10R10
  1384. # Type: Microsoft DirectDraw Surface
  1385. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  1386. # From: Morten Hustveit <morten@debian.org>
  1387. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  1388. 0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS):
  1389. >0 use ms-directdraw-surface
  1390. # Type: Sega PVR image.
  1391. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1392. # References:
  1393. # - https://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
  1394. # - https://github.com/yazgoo/pvrx2png
  1395. # - https://github.com/nickworonekin/puyotools
  1396. # Sega PVR header.
  1397. 0 name sega-pvr-image-header
  1398. >0x0C leshort x %u x
  1399. >0x0E leshort x %u
  1400. # Image format.
  1401. >0x08 byte 0 \b, ARGB1555
  1402. >0x08 byte 1 \b, RGB565
  1403. >0x08 byte 2 \b, ARGB4444
  1404. >0x08 byte 3 \b, YUV442
  1405. >0x08 byte 4 \b, Bump
  1406. >0x08 byte 5 \b, 4bpp
  1407. >0x08 byte 6 \b, 8bpp
  1408. # Image data type.
  1409. >0x09 byte 0x01 \b, square twiddled
  1410. >0x09 byte 0x02 \b, square twiddled & mipmap
  1411. >0x09 byte 0x03 \b, VQ
  1412. >0x09 byte 0x04 \b, VQ & mipmap
  1413. >0x09 byte 0x05 \b, 8-bit CLUT twiddled
  1414. >0x09 byte 0x06 \b, 4-bit CLUT twiddled
  1415. >0x09 byte 0x07 \b, 8-bit direct twiddled
  1416. >0x09 byte 0x08 \b, 4-bit direct twiddled
  1417. >0x09 byte 0x09 \b, rectangle
  1418. >0x09 byte 0x0B \b, rectangular stride
  1419. >0x09 byte 0x0D \b, rectangular twiddled
  1420. >0x09 byte 0x10 \b, small VQ
  1421. >0x09 byte 0x11 \b, small VQ & mipmap
  1422. >0x09 byte 0x12 \b, square twiddled & mipmap
  1423. # Sega PVR image.
  1424. 0 string PVRT
  1425. >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1426. >>0x20 use ms-directdraw-surface
  1427. >0x10 belong !0x44445320 Sega PVR image:
  1428. >>0 use sega-pvr-image-header
  1429. # Sega PVR image with GBIX.
  1430. 0 string GBIX
  1431. >0x10 string PVRT
  1432. >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1433. >>>0x20 use ms-directdraw-surface
  1434. >>0x10 belong !0x44445320 Sega PVR image:
  1435. >>>0x10 use sega-pvr-image-header
  1436. >>0x08 lelong x \b, global index = %u
  1437. # Sega GVR header.
  1438. 0 name sega-gvr-image-header
  1439. >0x0C beshort x %u x
  1440. >0x0E beshort x %u
  1441. # Image data format.
  1442. >0x0B byte 0 \b, I4
  1443. >0x0B byte 1 \b, I8
  1444. >0x0B byte 2 \b, IA4
  1445. >0x0B byte 3 \b, IA8
  1446. >0x0B byte 4 \b, RGB565
  1447. >0x0B byte 5 \b, RGB5A3
  1448. >0x0B byte 6 \b, ARGB8888
  1449. >0x0B byte 8 \b, CI4
  1450. >0x0B byte 9 \b, CI8
  1451. >0x0B byte 14 \b, DXT1
  1452. # Sega GVR image.
  1453. 0 string GVRT Sega GVR image:
  1454. >0x10 use sega-gvr-image-header
  1455. # Sega GVR image with GBIX.
  1456. 0 string GBIX
  1457. >0x10 string GVRT Sega GVR image:
  1458. >>0x10 use sega-gvr-image-header
  1459. >>0x08 belong x \b, global index = %u
  1460. # Sega GVR image with GCIX. (Wii)
  1461. 0 string GCIX
  1462. >0x10 string GVRT Sega GVR image:
  1463. >>0x10 use sega-gvr-image-header
  1464. >>0x08 belong x \b, global index = %u
  1465. # Light Field Picture
  1466. # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
  1467. # Typical file extensions: .lfp .lfr .lfx
  1468. 0 belong 0x894C4650
  1469. >4 belong 0x0D0A1A0A
  1470. >12 belong 0x00000000 Lytro Light Field Picture
  1471. >8 belong x \b, version %d
  1472. # Type: Vision Research Phantom CINE Format
  1473. # URL: https://www.phantomhighspeed.com/
  1474. # URL2: http://phantomhighspeed.force.com/vriknowledge/servlet/fileField?id=0BEU0000000Cfyk
  1475. # From: Harry Mallon <hjmallon at gmail.com>
  1476. #
  1477. # This has a short "CI" code but the 44 is the size of the struct which is
  1478. # stable
  1479. 0 string CI
  1480. >2 leshort 44 Vision Research CINE Video,
  1481. >>4 leshort 0 Grayscale,
  1482. >>4 leshort 1 JPEG Compressed,
  1483. >>4 leshort 2 RAW,
  1484. >>6 leshort x version %d,
  1485. >>20 lelong x %d frames,
  1486. >>48 lelong x %dx
  1487. >>52 lelong x \b%d
  1488. # Type: ARRI Raw Image
  1489. # Info: SMPTE RDD30:2014
  1490. # From: Harry Mallon <hjmallon at gmail.com>
  1491. 0 string ARRI ARRI ARI image data,
  1492. >4 lelong 0x78563412 little-endian,
  1493. >4 lelong 0x12345678 big-endian,
  1494. >12 lelong x version %d,
  1495. >20 lelong x %dx
  1496. >24 lelong x \b%d
  1497. # Type: Khronos KTX texture.
  1498. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1499. # References:
  1500. # - https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
  1501. # glEnum decoding.
  1502. # NOTE: Only the most common formats are listed here.
  1503. 0 name khronos-ktx-glEnum
  1504. >0 lelong 0x1907 \b, RGB
  1505. >0 lelong 0x1908 \b, RGBA
  1506. >0 lelong 0x1909 \b, LUMINANCE
  1507. >0 lelong 0x190A \b, LUMINANCE_ALPHA
  1508. >0 lelong 0x80E1 \b, BGR
  1509. >0 lelong 0x80E2 \b, BGRA
  1510. >0 lelong 0x83A0 \b, RGB_S3TC
  1511. >0 lelong 0x83A1 \b, RGB4_S3TC
  1512. >0 lelong 0x83A2 \b, RGBA_S3TC
  1513. >0 lelong 0x83A3 \b, RGBA4_S3TC
  1514. >0 lelong 0x83A4 \b, RGBA_DXT5_S3TC
  1515. >0 lelong 0x83A5 \b, RGBA4_DXT5_S3TC
  1516. >0 lelong 0x8D64 \b, ETC1_RGB8_OES
  1517. >0 lelong 0x9270 \b, COMPRESSED_R11_EAC
  1518. >0 lelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
  1519. >0 lelong 0x9272 \b, COMPRESSED_RG11_EAC
  1520. >0 lelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
  1521. >0 lelong 0x9274 \b, COMPRESSED_RGB8_ETC2
  1522. >0 lelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
  1523. >0 lelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
  1524. >0 lelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
  1525. >0 lelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
  1526. >0 lelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
  1527. >0 lelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
  1528. >0 lelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
  1529. >0 lelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
  1530. >0 lelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
  1531. >0 lelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
  1532. >0 lelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
  1533. >0 lelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
  1534. >0 lelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
  1535. >0 lelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
  1536. >0 lelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
  1537. >0 lelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
  1538. >0 lelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
  1539. >0 lelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
  1540. >0 lelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
  1541. >0 lelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
  1542. >0 lelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
  1543. >0 lelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
  1544. >0 lelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
  1545. >0 lelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
  1546. >0 lelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
  1547. >0 lelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
  1548. >0 lelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
  1549. >0 lelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
  1550. >0 lelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
  1551. >0 lelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
  1552. >0 lelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
  1553. >0 lelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
  1554. >0 lelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
  1555. # Endian-specific KTX header.
  1556. # TODO: glType (all textures I've seen so far are GL_UNSIGNED_BYTE)
  1557. 0 name khronos-ktx-endian-header
  1558. >20 lelong x \b, %u
  1559. >24 lelong >1 x %u
  1560. >28 lelong >1 x %u
  1561. >8 lelong >0
  1562. >>8 use khronos-ktx-glEnum
  1563. >8 lelong 0
  1564. >>12 use khronos-ktx-glEnum
  1565. # Main KTX header.
  1566. # Determine endianness, then check the rest of the header.
  1567. 0 string \xABKTX\ 11\xBB\r\n\x1A\n Khronos KTX texture
  1568. >12 lelong 0x04030201 (little-endian)
  1569. >>16 use khronos-ktx-endian-header
  1570. >12 belong 0x04030201 (big-endian)
  1571. >>16 use \^khronos-ktx-endian-header
  1572. # Type: Valve VTF texture.
  1573. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1574. # References:
  1575. # - https://developer.valvesoftware.com/wiki/Valve_Texture_Format
  1576. # VTF image formats.
  1577. 0 name vtf-image-format
  1578. >0 lelong 0 RGBA8888
  1579. >0 lelong 1 ABGR8888
  1580. >0 lelong 2 RGB888
  1581. >0 lelong 3 BGR888
  1582. >0 lelong 4 RGB565
  1583. >0 lelong 5 I8
  1584. >0 lelong 6 IA88
  1585. >0 lelong 7 P8
  1586. >0 lelong 8 A8
  1587. >0 lelong 9 RGB888 (bluescreen)
  1588. >0 lelong 10 BGR888 (bluescreen)
  1589. >0 lelong 11 ARGB8888
  1590. >0 lelong 12 BGRA8888
  1591. >0 lelong 13 DXT1
  1592. >0 lelong 14 DXT3
  1593. >0 lelong 15 DXT5
  1594. >0 lelong 16 BGRx8888
  1595. >0 lelong 17 BGR565
  1596. >0 lelong 18 BGRx5551
  1597. >0 lelong 19 BGRA4444
  1598. >0 lelong 20 DXT1+A1
  1599. >0 lelong 21 BGRA5551
  1600. >0 lelong 22 UV88
  1601. >0 lelong 23 UVWQ8888
  1602. >0 lelong 24 RGBA16161616F
  1603. >0 lelong 25 RGBA16161616
  1604. >0 lelong 26 UVLX8888
  1605. # Main VTF header.
  1606. 0 string VTF\0 Valve Texture Format
  1607. >4 lelong x v%u
  1608. >8 lelong x \b.%u
  1609. >0x10 leshort x \b, %u
  1610. >0x12 leshort >1 x %u
  1611. >4 lequad 0x0000000700000002
  1612. >>0x3F leshort >1 x %u
  1613. >0x18 leshort >1 \b, %u frames
  1614. >0x38 byte x \b, mipmaps: %u
  1615. >0x34 lelong >-1 \b,
  1616. >>0x34 use vtf-image-format
  1617. # Type: Valve VTF3 (PS3) texture.
  1618. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1619. 0 string VTF3 Valve Texture Format (PS3)
  1620. >0x14 beshort x \b, %u
  1621. >0x16 beshort x \b x %u
  1622. >0x10 belong&0x2000 0 \b, DXT1
  1623. >0x10 belong&0x2000 0x2000 \b, DXT5
  1624. # Type: ASTC texture.
  1625. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1626. # References:
  1627. # - https://stackoverflow.com/questions/22600678/determine-internal-format-of-given-astc-compressed-image-through-its-header
  1628. # - https://stackoverflow.com/a/22682244
  1629. 0 lelong 0x5ca1ab13 ASTC
  1630. >4 byte x %u
  1631. >5 byte x \bx%u
  1632. >6 byte >1 \bx%u
  1633. # X, Y, and Z dimensions are stored as 24-bit LE.
  1634. # Pretend it's 32-bit and mask off the high byte.
  1635. >7 lelong&0x00FFFFFF x texture, %u
  1636. >10 lelong&0x00FFFFFF x x %u
  1637. >13 lelong&0x00FFFFFF >1 x %u
  1638. # Zebra Metafile graphic
  1639. # http://www.fileformat.info/format/zbr/egff.htm
  1640. 0 beshort 0x9a02 Zebra Metafile graphic
  1641. >2 leshort 1 (version 1.x)
  1642. >2 leshort 2 (version 1.1x or 1.2x)
  1643. >2 leshort 3 (version 1.49)
  1644. >2 leshort 4 (version 1.50)
  1645. >4 string x (comment = %s)
  1646. # Microsoft Paint graphic
  1647. # http://www.fileformat.info/format/mspaint/egff.htm
  1648. 0 string DanM icrosoft Paint image data (version 1.x)
  1649. >4 leshort x (%d
  1650. >>6 leshort x x %d)
  1651. 0 string LinS Microsoft Paint image data (version 2.0)
  1652. >4 leshort x (%d
  1653. >>6 leshort x x %d)
  1654. # reMarkable tablet internal file format (https://www.remarkable.com/)
  1655. # https://github.com/ax3l/lines-are-beautiful
  1656. # https://plasma.ninja/blog/devices/remarkable/binary/format/2017/12/26/\
  1657. # reMarkable-lines-file-format.html#what-to-do-next
  1658. # from Axel Huebl
  1659. 0 string reMarkable
  1660. >11 string lines
  1661. >>17 string with
  1662. >>>22 string selections
  1663. >>>>33 string and
  1664. >>>>>37 string layers
  1665. >>>>>>43 lelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
  1666. # newer per-page files for the reMarkable
  1667. 0 string reMarkable
  1668. >11 string .lines
  1669. >>18 string file,
  1670. >>>24 string version=
  1671. >>>>32 byte x reMarkable tablet page (v%c), 1404 x 1872,
  1672. >>>>>43 lelong x %d layer(s)
  1673. # Type: PVR3 texture.
  1674. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1675. # References:
  1676. # - http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
  1677. # PVR3 pixel formats.
  1678. 0 name pvr3-pixel-format
  1679. >4 ulelong 0
  1680. >>0 ulelong 0 PVRTC 2bpp RGB
  1681. >>0 ulelong 1 PVRTC 2bpp RGBA
  1682. >>0 ulelong 2 PVRTC 4bpp RGB
  1683. >>0 ulelong 3 PVRTC 4bpp RGBA
  1684. >>0 ulelong 4 PVRTC-II 2bpp
  1685. >>0 ulelong 5 PVRTC-II 4bpp
  1686. >>0 ulelong 6 ETC1
  1687. >>0 ulelong 7 DXT1
  1688. >>0 ulelong 8 DXT2
  1689. >>0 ulelong 9 DXT3
  1690. >>0 ulelong 10 DXT4
  1691. >>0 ulelong 11 DXT5
  1692. >>0 ulelong 12 BC4
  1693. >>0 ulelong 13 BC5
  1694. >>0 ulelong 14 BC6
  1695. >>0 ulelong 15 BC7
  1696. >>0 ulelong 16 UYVY
  1697. >>0 ulelong 17 YUY2
  1698. >>0 ulelong 18 BW1bpp
  1699. >>0 ulelong 19 R9G9B9E5 Shared Exponent
  1700. >>0 ulelong 20 RGBG8888
  1701. >>0 ulelong 21 GRGB8888
  1702. >>0 ulelong 22 ETC2 RGB
  1703. >>0 ulelong 23 ETC2 RGBA
  1704. >>0 ulelong 24 ETC2 RGB A1
  1705. >>0 ulelong 25 EAC R11
  1706. >>0 ulelong 26 EAC RG11
  1707. >>0 ulelong 27 ASTC_4x4
  1708. >>0 ulelong 28 ASTC_5x4
  1709. >>0 ulelong 29 ASTC_5x5
  1710. >>0 ulelong 30 ASTC_6x5
  1711. >>0 ulelong 31 ASTC_6x6
  1712. >>0 ulelong 32 ASTC_8x5
  1713. >>0 ulelong 33 ASTC_8x6
  1714. >>0 ulelong 34 ASTC_8x8
  1715. >>0 ulelong 35 ASTC_10x5
  1716. >>0 ulelong 36 ASTC_10x6
  1717. >>0 ulelong 37 ASTC_10x8
  1718. >>0 ulelong 38 ASTC_10x10
  1719. >>0 ulelong 39 ASTC_12x10
  1720. >>0 ulelong 40 ASTC_12x12
  1721. >>0 ulelong 41 ASTC_3x3x3
  1722. >>0 ulelong 42 ASTC_4x3x3
  1723. >>0 ulelong 43 ASTC_4x4x3
  1724. >>0 ulelong 44 ASTC_4x4x4
  1725. >>0 ulelong 45 ASTC_5x4x4
  1726. >>0 ulelong 46 ASTC_5x5x4
  1727. >>0 ulelong 47 ASTC_5x5x5
  1728. >>0 ulelong 48 ASTC_6x5x5
  1729. >>0 ulelong 49 ASTC_6x6x5
  1730. >>0 ulelong 50 ASTC_6x6x6
  1731. >4 ulelong !0
  1732. >>0 byte !0 %c
  1733. >>1 byte !0 \b%c
  1734. >>2 byte !0 \b%c
  1735. >>3 byte !0 \b%c
  1736. 0 string PVR\x03 PVR 3.0 texture:
  1737. >0x18 ulelong x %u x
  1738. >0x1C ulelong x %u
  1739. >0x20 ulelong >1 x %u
  1740. >0x08 byte x \b,
  1741. >0x08 use pvr3-pixel-format
  1742. >0x10 ulelong 1 \b, sRGB
  1743. >0x04 ulelong&0x02 0x02 \b, premultiplied alpha
  1744. # Type: Microsoft Xbox XPR0 texture.
  1745. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1746. # References:
  1747. # - https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/XbD3D8Types.h
  1748. # XPR pixel formats.
  1749. 0 name xbox-xpr-pixel-format
  1750. >0 byte 0x00 L8
  1751. >0 byte 0x01 AL8
  1752. >0 byte 0x02 ARGB1555
  1753. >0 byte 0x03 RGB555
  1754. >0 byte 0x04 ARGB4444
  1755. >0 byte 0x05 RGB565
  1756. >0 byte 0x06 ARGB8888
  1757. >0 byte 0x07 xRGB8888
  1758. >0 byte 0x0B P8
  1759. >0 byte 0x0C DXT1
  1760. >0 byte 0x0E DXT2
  1761. >0 byte 0x0F DXT4
  1762. >0 byte 0x10 Linear ARGB1555
  1763. >0 byte 0x11 Linear RGB565
  1764. >0 byte 0x12 Linear ARGB8888
  1765. >0 byte 0x13 Linear L8
  1766. >0 byte 0x16 Linear R8B8
  1767. >0 byte 0x17 Linear G8B8
  1768. >0 byte 0x19 A8
  1769. >0 byte 0x1A A8L8
  1770. >0 byte 0x1B Linear AL8
  1771. >0 byte 0x1C Linear RGB555
  1772. >0 byte 0x1D Linear ARGB4444
  1773. >0 byte 0x1E Linear xRGB8888
  1774. >0 byte 0x1F Linear A8
  1775. >0 byte 0x20 Linear A8L8
  1776. >0 byte 0x24 YUY2
  1777. >0 byte 0x25 UYVY
  1778. >0 byte 0x27 L6V5U5
  1779. >0 byte 0x28 V8U8
  1780. >0 byte 0x29 R8B8
  1781. >0 byte 0x2A D24S8
  1782. >0 byte 0x2B F24S8
  1783. >0 byte 0x2C D16
  1784. >0 byte 0x2D F16
  1785. >0 byte 0x2E Linear D24S8
  1786. >0 byte 0x2F Linear F24S8
  1787. >0 byte 0x30 Linear D16
  1788. >0 byte 0x31 Linear F16
  1789. >0 byte 0x32 L16
  1790. >0 byte 0x33 V16U16
  1791. >0 byte 0x35 Linear L16
  1792. >0 byte 0x36 Linear V16U16
  1793. >0 byte 0x37 Linear L6V5U5
  1794. >0 byte 0x38 RGBA5551
  1795. >0 byte 0x39 RGBA4444
  1796. >0 byte 0x3A QWVU8888
  1797. >0 byte 0x3B BGRA8888
  1798. >0 byte 0x3C RGBA8888
  1799. >0 byte 0x3D Linear RGBA5551
  1800. >0 byte 0x3E Linear RGBA4444
  1801. >0 byte 0x3F Linear ABGR8888
  1802. >0 byte 0x40 Linear BGRA8888
  1803. >0 byte 0x41 Linear RGBA8888
  1804. >0 byte 0x64 Vertex Data
  1805. 0 string XPR0 Microsoft Xbox XPR0 texture
  1806. >0x19 byte x \b, format:
  1807. >>0x19 use xbox-xpr-pixel-format