images 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234
  1. #------------------------------------------------------------------------------
  2. # $File: images,v 1.171 2019/11/23 16:19:47 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. # URL: https://imagemagick.org/script/miff.php
  475. # Reference: http://fileformats.archiveteam.org/wiki/MIFF
  476. # Update: Joerg Jenderek
  477. # http://www.nationalarchives.gov.uk/pronom/fmt/930
  478. 0 search/256/bc id=imagemagick
  479. # skip bad ASCII text by following new line~0x0A or space~0x20 character
  480. #>&0 ubyte x \b, next character 0x%x
  481. # called by TriD ImageMagick Machine independent File Format bitmap
  482. >&0 ubyte&0xD5 0 MIFF image data
  483. # https://reposcope.com/mimetype/image/miff
  484. #!:mime image/miff
  485. !:mime image/x-miff
  486. !:ext miff/mif
  487. # examples with standard file(1) magic
  488. #>>0 string =id=ImageMagick with standard magic
  489. # examples with unusual file(1) magic like
  490. >>0 string !id=ImageMagick starting with
  491. # start with comment (brace) like http://samples.fileformat.info/.../AQUARIUM.MIF
  492. >>>0 ubyte =0x7b comment
  493. # skip second character which is often a newline and show comment
  494. >>>>2 string x "%s"
  495. # does not start with comment, probably letters with other case like Id=ImageMagick
  496. # ImageMagick-7.0.9-2/Magick++/demo/smile_anim.miff
  497. >>>0 ubyte !0x7b
  498. >>>>0 string >\0 '%-.14s'
  499. # Artisan
  500. 0 long 1123028772 Artisan image data
  501. >4 long 1 \b, rectangular 24-bit
  502. >4 long 2 \b, rectangular 8-bit with colormap
  503. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  504. # FIG (Facility for Interactive Generation of figures), an object-based format
  505. 0 search/1 #FIG FIG image text
  506. >5 string x \b, version %.3s
  507. # PHIGS
  508. 0 string ARF_BEGARF PHIGS clear text archive
  509. 0 string @(#)SunPHIGS SunPHIGS
  510. # version number follows, in the form m.n
  511. >40 string SunBin binary
  512. >32 string archive archive
  513. # GKS (Graphics Kernel System)
  514. 0 string GKSM GKS Metafile
  515. >24 string SunGKS \b, SunGKS
  516. # CGM image files
  517. 0 string BEGMF clear text Computer Graphics Metafile
  518. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  519. 0 string yz MGR bitmap, modern format, 8-bit aligned
  520. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  521. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  522. 0 string yx MGR bitmap, modern format, squeezed
  523. # Fuzzy Bitmap (FBM) images
  524. 0 string %bitmap\0 FBM image data
  525. >30 long 0x31 \b, mono
  526. >30 long 0x33 \b, color
  527. # facsimile data
  528. 1 string PC\ Research,\ Inc group 3 fax data
  529. >29 byte 0 \b, normal resolution (204x98 DPI)
  530. >29 byte 1 \b, fine resolution (204x196 DPI)
  531. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  532. 0 string Sfff structured fax file
  533. # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
  534. # most files with the extension .EPA and some with .BMP
  535. 0 string \x11\x06 Award BIOS Logo, 136 x 84
  536. !:mime image/x-award-bioslogo
  537. 0 string \x11\x09 Award BIOS Logo, 136 x 126
  538. !:mime image/x-award-bioslogo
  539. #0 string \x07\x1f BIOS Logo corrupted?
  540. # http://www.blackfiveservices.co.uk/awbmtools.shtml
  541. # http://biosgfx.narod.ru/v3/
  542. # http://biosgfx.narod.ru/abr-2/
  543. 0 string AWBM
  544. >4 leshort <1981 Award BIOS bitmap
  545. !:mime image/x-award-bmp
  546. # image width is a multiple of 4
  547. >>4 leshort&0x0003 0
  548. >>>4 leshort x \b, %d
  549. >>>6 leshort x x %d
  550. >>4 leshort&0x0003 >0 \b,
  551. >>>4 leshort&0x0003 =1
  552. >>>>4 leshort x %d+3
  553. >>>4 leshort&0x0003 =2
  554. >>>>4 leshort x %d+2
  555. >>>4 leshort&0x0003 =3
  556. >>>>4 leshort x %d+1
  557. >>>6 leshort x x %d
  558. # at offset 8 starts imagedata followed by "RGB " marker
  559. # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
  560. # https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
  561. # 28bitmap_information_header.29
  562. # Note: variant starting direct with DIB header see
  563. # http://fileformats.archiveteam.org/wiki/BMP
  564. # verified by ImageMagick version 6.8.9-8 command `identify *.dib`
  565. 0 leshort 40
  566. # skip bad samples like GAME by looking for valid number of color planes
  567. >12 uleshort 1 Device independent bitmap graphic
  568. !:mime image/bmp
  569. !:apple ????BMPp
  570. !:ext dib
  571. >>4 lelong x \b, %d x
  572. >>8 lelong x %d x
  573. >>14 leshort x %d
  574. # number of color planes (must be 1)
  575. #>>12 uleshort >1 \b, %u color planes
  576. # compression method: 0~no 1~RLE 8-bit/pixel 3~Huffman 1D
  577. #>>16 ulelong 3 \b, Huffman 1D compression
  578. >>16 ulelong >0 \b, %u compression
  579. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  580. >>20 ulelong x \b, image size %u
  581. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  582. >>24 lelong >0 \b, resolution %d x
  583. >>>28 lelong x %d px/m
  584. # number of colors in palette, or 0 to default to 2**n
  585. #>>32 ulelong >0 \b, %u colors
  586. # number of important colors used, or 0 when every color is important
  587. >>36 ulelong >0 \b, %u important colors
  588. 0 string BM
  589. >14 leshort 12 PC bitmap, OS/2 1.x format
  590. !:mime image/x-ms-bmp
  591. >>18 leshort x \b, %d x
  592. >>20 leshort x %d
  593. >14 leshort 64 PC bitmap, OS/2 2.x format
  594. !:mime image/bmp
  595. !:apple ????BMPp
  596. !:ext bmp
  597. # image width and height fields are unsigned integers for OS/2
  598. >>18 ulelong x \b, %u x
  599. >>22 ulelong x %u
  600. # number of bits per pixel (color depth); found 1 4 8
  601. >>28 uleshort >1 x %u
  602. # x, y coordinates of the hotspot
  603. >>6 uleshort >0 \b, hotspot %ux
  604. >>>8 uleshort x \b%u
  605. >>26 uleshort >1 \b, %u color planes
  606. # cbSize; size of file or headers
  607. >>2 ulelong x \b, cbSize %u
  608. #>>2 ulelong x \b, cbSize 0x%x
  609. # offBits; offset to bitmap data like 56h 5Eh 8Eh 43Eh
  610. >>10 ulelong x \b, bits offset %u
  611. #>>10 ulelong x \b, bits offset 0x%x
  612. #>>(10.l) ubequad !0 \b, bits 0x%16.16llx
  613. # BITMAPV2INFOHEADER adds RGB bit masks
  614. >14 leshort 52 PC bitmap, Adobe Photoshop
  615. !:mime image/bmp
  616. !:apple ????BMPp
  617. !:ext bmp
  618. >>18 lelong x \b, %d x
  619. >>22 lelong x %d x
  620. >>28 leshort x %d
  621. # BITMAPV3INFOHEADER adds alpha channel bit mask
  622. >14 leshort 56 PC bitmap, Adobe Photoshop with alpha channel mask
  623. !:mime image/bmp
  624. !:apple ????BMPp
  625. !:ext bmp
  626. >>18 lelong x \b, %d x
  627. >>22 lelong x %d x
  628. >>28 leshort x %d
  629. >14 leshort 40
  630. # jump 4 bytes before end of file/header to skip fmt-116-signature-id-118.dib
  631. >>(2.l-4) ulong x PC bitmap, Windows 3.x format
  632. !:mime image/bmp
  633. !:apple ????BMPp
  634. >>>18 lelong x \b, %d x
  635. >>>22 lelong x %d
  636. # 320 x 400 https://en.wikipedia.org/wiki/LOGO.SYS
  637. >>>18 ulequad =0x0000019000000140 x
  638. !:ext bmp/sys
  639. >>>18 ulequad !0x0000019000000140
  640. # compression method 2~RLE 4-bit/pixel implies also extension rle
  641. >>>>30 ulelong 2 x
  642. !:ext bmp/rle
  643. >>>>30 default x x
  644. !:ext bmp
  645. # number of bits per pixel (color depth); found 1 2 4 8 16 24 32
  646. >>>28 leshort x %d
  647. # x, y coordinates of the hotspot; there is no hotspot in bitmaps, so values 0
  648. #>>>6 uleshort >0 \b, hotspot %ux
  649. #>>>>8 uleshort x \b%u
  650. # number of color planes (must be 1), except badplanes.bmp for testing
  651. #>>>26 uleshort >1 \b, %u color planes
  652. # compression method: 0~no 1~RLE 8-bit/pixel 2~RLE 4-bit/pixel 3~Huffman 1D 6~RGBA bit field masks
  653. #>>>30 ulelong 3 \b, Huffman 1D compression
  654. >>>30 ulelong >0 \b, %u compression
  655. # image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
  656. >>>34 ulelong >0 \b, image size %u
  657. # horizontal and vertical resolution of the image (pixel per metre, signed integer)
  658. >>>38 lelong >0 \b, resolution %d x
  659. >>>>42 lelong x %d px/m
  660. # number of colors in palette 16 256, or 0 to default to 2**n
  661. #>>>46 ulelong >0 \b, %u colors
  662. # number of important colors used, or 0 when every color is important
  663. >>>50 ulelong >0 \b, %u important colors
  664. # cbSize; often size of file
  665. >>>2 ulelong x \b, cbSize %u
  666. #>>>2 ulelong x \b, cbSize 0x%x
  667. # offBits; offset to bitmap data like 36h 76h BEh 236h 406h 436h 4E6h
  668. >>>10 ulelong x \b, bits offset %u
  669. #>>>10 ulelong x \b, bits offset 0x%x
  670. #>>>(10.l) ubequad !0 \b, bits 0x%16.16llxd
  671. >14 leshort 124 PC bitmap, Windows 98/2000 and newer format
  672. !:mime image/x-ms-bmp
  673. >>18 lelong x \b, %d x
  674. >>22 lelong x %d x
  675. >>28 leshort x %d
  676. >14 leshort 108 PC bitmap, Windows 95/NT4 and newer format
  677. !:mime image/x-ms-bmp
  678. >>18 lelong x \b, %d x
  679. >>22 lelong x %d x
  680. >>28 leshort x %d
  681. >14 leshort 128 PC bitmap, Windows NT/2000 format
  682. !:mime image/x-ms-bmp
  683. >>18 lelong x \b, %d x
  684. >>22 lelong x %d x
  685. >>28 leshort x %d
  686. # Update: Joerg Jenderek
  687. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Icon
  688. # Reference: http://www.fileformat.info
  689. # /format/os2bmp/spec/902d5c253f2a43ada39c2b81034f27fd/view.htm
  690. # Note: verified by command like `deark -l -d3 OS2MEMU.ICO`
  691. 0 string IC
  692. # skip Lotus smart icon *.smi by looking for valid hotspot coordinates
  693. >6 ulelong&0xFF00FF00 =0 OS/2 icon
  694. # jump 4 bytes before end of header/file and test for accessibility
  695. #>>(2.l-4) ubelong x End of header is OK!
  696. !:mime image/x-os2-ico
  697. !:ext ico
  698. # cbSize; size of header or file in bytes like 1ah 120h 420h
  699. >>2 ulelong x \b, cbSize %u
  700. # xHotspot, yHotspot; coordinates of the hotspot for icons like 16 32
  701. >>6 uleshort x \b, hotspot %ux
  702. >>8 uleshort x \b%u
  703. # offBits; offset in bytes to the beginning of the bit-map pel data like 20h
  704. >>10 ulelong x \b, bits offset %u
  705. #>>(10.l) ubequad x \b, bits 0x%16.16llx
  706. #0 string PI PC pointer image data
  707. #0 string CI PC color icon data
  708. 0 string CI
  709. # test also for valid dib header sizes 12 or 64
  710. >14 ulelong <65 OS/2
  711. # test also for valid hotspot coordinates
  712. #>>6 ulelong&0xFE00FE00 =0 OS/2
  713. !:mime image/x-os2-ico
  714. !:ext ico
  715. >>14 ulelong 12 1.x color icon
  716. # image width and height fields are unsigned integers for OS/2
  717. >>>18 uleshort x %u x
  718. # stored height = 2 * real height
  719. >>>20 uleshort/2 x %u
  720. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  721. >>>24 uleshort >1 x %u
  722. # color planes; must be 1
  723. #>>>22 uleshort >1 \b, %u color planes
  724. >>14 ulelong 64 2.x color icon
  725. # image width and height
  726. >>>18 ulelong x %u x
  727. # stored height = 2 * real height
  728. >>>22 ulelong/2 x %u
  729. # number of bits per pixel (color depth). only 1 found
  730. >>>28 uleshort >1 x %u
  731. #>>>26 uleshort >1 \b, %u color planes
  732. # compression method: 0~no 3~Huffman 1D
  733. >>>30 ulelong 3 \b, Huffman 1D compression
  734. #>>>30 ulelong >0 \b, %u compression
  735. # xHotspot, yHotspot; coordinates of the hotspot like 0 1 16 20 32 33 63 64
  736. >>6 uleshort x \b, hotspot %ux
  737. >>8 uleshort x \b%u
  738. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh 84Eh
  739. >>2 ulelong x \b, cbSize %u
  740. #>>2 ulelong x \b, cbSize %x
  741. # offBits; offset to bitmap data (pixel array) like E4h 3Ah 66h 6Ah 33Ah 4A4h
  742. >>10 ulelong x \b, bits offset %u
  743. #>>10 ulelong x \b, bits offset 0x%x
  744. #>>(10.l) ubequad !0 \b, bits 0x%16.16llx
  745. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  746. #>>14 ulelong x \b, dib header size %u
  747. #0 string CP PC color pointer image data
  748. # URL: http://fileformats.archiveteam.org/wiki/OS/2_Pointer
  749. # Reference: http://www.fileformat.info/format/os2bmp/egff.htm
  750. 0 string CP
  751. # skip CPU-Z Report by checking for valid dib header sizes 12 or 64
  752. >14 ulelong <65 OS/2
  753. # http://extension.nirsoft.net/PTR
  754. !:mime image/x-ibm-pointer
  755. !:ext ptr
  756. >>14 ulelong 12 1.x color pointer
  757. # image width and height fields are unsigned integers for OS/2
  758. >>>18 uleshort x %u x
  759. # stored height = 2 * real height
  760. >>>20 uleshort/2 x %u
  761. # number of bits per pixel (color depth). Typical 32 24 16 8 4 but only 1 found
  762. >>>24 uleshort >1 x %u
  763. # color planes; must be 1
  764. #>>>22 uleshort >1 \b, %u color planes
  765. >>14 ulelong 64 2.x color pointer
  766. # image width and height
  767. >>>18 ulelong x %u x
  768. # stored height = 2 * real height
  769. >>>22 ulelong/2 x %u
  770. # number of bits per pixel (color depth). only 1 found
  771. >>>28 uleshort >1 x %u
  772. #>>>26 uleshort >1 \b, %u color planes
  773. # compression method: 0~no 3~Huffman 1D
  774. >>>30 ulelong 3 \b, Huffman 1D compression
  775. #>>>30 ulelong >0 \b, %u compression
  776. # xHotspot, yHotspot; coordinates of the hotspot like 0 3 4 8 15 16 23 27 31
  777. >>6 uleshort x \b, hotspot %ux
  778. >>8 uleshort x \b%u
  779. # cbSize; size of header or maybe file in bytes like 1Ah 4Eh
  780. >>2 ulelong x \b, cbSize %u
  781. #>>2 ulelong x \b, cbSize %x
  782. # offBits; offset to bitmap data (pixel array) like 6Ah A4h E4h 4A4h
  783. >>10 ulelong x \b, bits offset %u
  784. #>>10 ulelong x \b, bits offset 0x%x
  785. #>>(10.l) ubequad !0 \b, bits 0x%16.16llx
  786. # dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
  787. #>>14 ulelong x \b, dib header size %u
  788. # Conflicts with other entries [BABYL]
  789. # URL: http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_Bitmap_Array
  790. # Note: container for OS/2 icon "IC", color icon "CI", color pointer "CP" or bitmap "BM"
  791. #0 string BA PC bitmap array data
  792. 0 string BA
  793. # skip old Emacs RMAIL BABYL ./mail.news by checking for low header size
  794. >2 ulelong <0x004c5942 OS/2 graphic array
  795. !:mime image/x-os2-graphics
  796. #!:apple ????BMPf
  797. # cbSize; size of header like 28h 5Ch
  798. >>2 ulelong x \b, cbSize %u
  799. #>>2 ulelong x \b, cbSize 0x%x
  800. # offNext; offset to data like 0 48h F2h 4Eh 64h C6h D2h D6h DAh E6h EAh 348h
  801. >>6 ulelong >0 \b, data offset %u
  802. #>>6 ulelong >0 \b, data offset 0x%x
  803. #>>(6.l) ubequad !0 \b, data 0x%16.16llx
  804. # dimensions of the intended device like 640 x 480 for VGA or 1024 x 768
  805. >>10 uleshort >0 \b, display %u
  806. >>>12 uleshort >0 x %u
  807. # usType of first array element
  808. #>>14 string x \b, usType %2.2s
  809. # 1 space char after "1st"
  810. # no *.bga examples found https://www.openwith.org/file-extensions/bga/1342
  811. >>14 string BM \b; 1st
  812. !:ext bmp/bga
  813. >>14 string CI \b; 1st
  814. !:ext ico
  815. >>14 string CP \b; 1st
  816. !:ext ico
  817. >>14 string IC \b; 1st
  818. !:ext ico
  819. # no white-black pointer found
  820. #>>14 string PT \b; 1st
  821. #!:ext
  822. >>14 indirect x
  823. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  824. 0 search/1 /*\ XPM\ */ X pixmap image text
  825. !:mime image/x-xpmi
  826. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  827. 0 leshort 0xcc52 RLE image data,
  828. >6 leshort x %d x
  829. >8 leshort x %d
  830. >2 leshort >0 \b, lower left corner: %d
  831. >4 leshort >0 \b, lower right corner: %d
  832. >10 byte&0x1 =0x1 \b, clear first
  833. >10 byte&0x2 =0x2 \b, no background
  834. >10 byte&0x4 =0x4 \b, alpha channel
  835. >10 byte&0x8 =0x8 \b, comment
  836. >11 byte >0 \b, %d color channels
  837. >12 byte >0 \b, %d bits per pixel
  838. >13 byte >0 \b, %d color map channels
  839. # image file format (Robert Potter, potter@cs.rochester.edu)
  840. 0 string Imagefile\ version- iff image data
  841. # this adds the whole header (inc. version number), informative but longish
  842. >10 string >\0 %s
  843. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  844. 0 belong 0x59a66a95 Sun raster image data
  845. >4 belong >0 \b, %d x
  846. >8 belong >0 %d,
  847. >12 belong >0 %d-bit,
  848. #>16 belong >0 %d bytes long,
  849. >20 belong 0 old format,
  850. #>20 belong 1 standard,
  851. >20 belong 2 compressed,
  852. >20 belong 3 RGB,
  853. >20 belong 4 TIFF,
  854. >20 belong 5 IFF,
  855. >20 belong 0xffff reserved for testing,
  856. >24 belong 0 no colormap
  857. >24 belong 1 RGB colormap
  858. >24 belong 2 raw colormap
  859. #>28 belong >0 colormap is %d bytes long
  860. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  861. #
  862. # See
  863. # http://reality.sgi.com/grafica/sgiimage.html
  864. #
  865. 0 beshort 474 SGI image data
  866. #>2 byte 0 \b, verbatim
  867. >2 byte 1 \b, RLE
  868. #>3 byte 1 \b, normal precision
  869. >3 byte 2 \b, high precision
  870. >4 beshort x \b, %d-D
  871. >6 beshort x \b, %d x
  872. >8 beshort x %d
  873. >10 beshort x \b, %d channel
  874. >10 beshort !1 \bs
  875. >80 string >0 \b, "%s"
  876. 0 string IT01 FIT image data
  877. >4 belong x \b, %d x
  878. >8 belong x %d x
  879. >12 belong x %d
  880. #
  881. 0 string IT02 FIT image data
  882. >4 belong x \b, %d x
  883. >8 belong x %d x
  884. >12 belong x %d
  885. #
  886. 2048 string PCD_IPI Kodak Photo CD image pack file
  887. >0xe02 byte&0x03 0x00 , landscape mode
  888. >0xe02 byte&0x03 0x01 , portrait mode
  889. >0xe02 byte&0x03 0x02 , landscape mode
  890. >0xe02 byte&0x03 0x03 , portrait mode
  891. 0 string PCD_OPA Kodak Photo CD overview pack file
  892. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  893. # FITS is the Flexible Image Transport System, the de facto standard for
  894. # data and image transfer, storage, etc., for the astronomical community.
  895. # (FITS floating point formats are big-endian.)
  896. 0 string SIMPLE\ \ = FITS image data
  897. !:mime image/fits
  898. !:ext fits/fts
  899. >109 string 8 \b, 8-bit, character or unsigned binary integer
  900. >108 string 16 \b, 16-bit, two's complement binary integer
  901. >107 string \ 32 \b, 32-bit, two's complement binary integer
  902. >107 string -32 \b, 32-bit, floating point, single precision
  903. >107 string -64 \b, 64-bit, floating point, double precision
  904. # other images
  905. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  906. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  907. # stuff.
  908. #
  909. 0 beshort 0x1010 PEX Binary Archive
  910. # DICOM medical imaging data
  911. # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
  912. # Note: "dcm" is the official file name extension
  913. # XnView mention also "dc3" and "acr" as file name extension
  914. 128 string DICM DICOM medical imaging data
  915. !:mime application/dicom
  916. !:ext dcm/dicom/dic
  917. # XWD - X Window Dump file.
  918. # As described in /usr/X11R6/include/X11/XWDFile.h
  919. # used by the xwd program.
  920. # Bradford Castalia, idaeim, 1/01
  921. # updated by Adam Buchbinder, 2/09
  922. # The following assumes version 7 of the format; the first long is the length
  923. # of the header, which is at least 25 4-byte longs, and the one at offset 8
  924. # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  925. # which is a maximum of 32.
  926. 0 belong >100
  927. >8 belong <3
  928. >>12 belong <33
  929. >>>4 belong 7 XWD X Window Dump image data
  930. !:mime image/x-xwindowdump
  931. >>>>100 string >\0 \b, "%s"
  932. >>>>16 belong x \b, %dx
  933. >>>>20 belong x \b%dx
  934. >>>>12 belong x \b%d
  935. # PDS - Planetary Data System
  936. # These files use Parameter Value Language in the header section.
  937. # Unfortunately, there is no certain magic, but the following
  938. # strings have been found to be most likely.
  939. 0 string NJPL1I00 PDS (JPL) image data
  940. 2 string NJPL1I PDS (JPL) image data
  941. 0 string CCSD3ZF PDS (CCSD) image data
  942. 2 string CCSD3Z PDS (CCSD) image data
  943. 0 string PDS_ PDS image data
  944. 0 string LBLSIZE= PDS (VICAR) image data
  945. # pM8x: ATARI STAD compressed bitmap format
  946. #
  947. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  948. # p M 8 5/6 xx yy zz data...
  949. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  950. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  951. # most frequent byte, xx and zz are runlength escape codes, where xx is
  952. # used for runs of yy.
  953. #
  954. 0 string pM85 Atari ST STAD bitmap image data (hor)
  955. >5 byte 0x00 (white background)
  956. >5 byte 0xFF (black background)
  957. 0 string pM86 Atari ST STAD bitmap image data (vert)
  958. >5 byte 0x00 (white background)
  959. >5 byte 0xFF (black background)
  960. # From: Alex Myczko <alex@aiei.ch>
  961. # https://www.atarimax.com/jindroush.atari.org/afmtatr.html
  962. 0 leshort 0x0296 Atari ATR image
  963. # XXX:
  964. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  965. # magic.
  966. # SGI RICE image file <mpruett@sgi.com>
  967. #0 beshort 0x5249 RICE image
  968. #>2 beshort x v%d
  969. #>4 beshort x (%d x
  970. #>6 beshort x %d)
  971. #>8 beshort 0 8 bit
  972. #>8 beshort 1 10 bit
  973. #>8 beshort 2 12 bit
  974. #>8 beshort 3 13 bit
  975. #>10 beshort 0 4:2:2
  976. #>10 beshort 1 4:2:2:4
  977. #>10 beshort 2 4:4:4
  978. #>10 beshort 3 4:4:4:4
  979. #>12 beshort 1 RGB
  980. #>12 beshort 2 CCIR601
  981. #>12 beshort 3 RP175
  982. #>12 beshort 4 YUV
  983. # PCX image files
  984. # From: Dan Fandrich <dan@coneharvesters.com>
  985. # updated by Joerg Jenderek at Feb 2013 by https://de.wikipedia.org/wiki/PCX
  986. # https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
  987. # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
  988. # 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
  989. 0 ubelong&0xffF8fe00 0x0a000000
  990. # for PCX bit depth > 0
  991. >3 ubyte >0
  992. # test for valid versions
  993. >>1 ubyte <6
  994. >>>1 ubyte !1 PCX
  995. !:mime image/x-pcx
  996. #!:mime image/pcx
  997. >>>>1 ubyte 0 ver. 2.5 image data
  998. >>>>1 ubyte 2 ver. 2.8 image data, with palette
  999. >>>>1 ubyte 3 ver. 2.8 image data, without palette
  1000. >>>>1 ubyte 4 for Windows image data
  1001. >>>>1 ubyte 5 ver. 3.0 image data
  1002. >>>>4 uleshort x bounding box [%d,
  1003. >>>>6 uleshort x %d] -
  1004. >>>>8 uleshort x [%d,
  1005. >>>>10 uleshort x %d],
  1006. >>>>65 ubyte >1 %d planes each of
  1007. >>>>3 ubyte x %d-bit
  1008. >>>>68 byte 1 colour,
  1009. >>>>68 byte 2 grayscale,
  1010. # this should not happen
  1011. >>>>68 default x image,
  1012. >>>>12 leshort >0 %d x
  1013. >>>>>14 uleshort x %d dpi,
  1014. >>>>2 byte 0 uncompressed
  1015. >>>>2 byte 1 RLE compressed
  1016. # Adobe Photoshop
  1017. # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
  1018. 0 string 8BPS Adobe Photoshop Image
  1019. !:mime image/vnd.adobe.photoshop
  1020. >4 beshort 2 (PSB)
  1021. >18 belong x \b, %d x
  1022. >14 belong x %d,
  1023. >24 beshort 0 bitmap
  1024. >24 beshort 1 grayscale
  1025. >>12 beshort 2 with alpha
  1026. >24 beshort 2 indexed
  1027. >24 beshort 3 RGB
  1028. >>12 beshort 4 \bA
  1029. >24 beshort 4 CMYK
  1030. >>12 beshort 5 \bA
  1031. >24 beshort 7 multichannel
  1032. >24 beshort 8 duotone
  1033. >24 beshort 9 lab
  1034. >12 beshort > 1
  1035. >>12 beshort x \b, %dx
  1036. >12 beshort 1 \b,
  1037. >22 beshort x %d-bit channel
  1038. >12 beshort > 1 \bs
  1039. # XV thumbnail indicator (ThMO)
  1040. 0 string P7\ 332 XV thumbnail image data
  1041. # NITF is defined by United States MIL-STD-2500A
  1042. 0 string NITF National Imagery Transmission Format
  1043. >25 string >\0 dated %.14s
  1044. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  1045. # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
  1046. # Update: Joerg Jenderek
  1047. # See http://fileformats.archiveteam.org/wiki/GEM_Raster
  1048. # For variations, also see:
  1049. # https://www.seasip.info/Gem/ff_img.html (Ventura)
  1050. # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
  1051. # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
  1052. # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
  1053. 0 beshort 0x0001
  1054. # header_size
  1055. >2 beshort 0x0008
  1056. >>0 use gem_info
  1057. >2 beshort 0x0009
  1058. >>0 use gem_info
  1059. # no example for NOSIG
  1060. >2 beshort 24
  1061. >>0 use gem_info
  1062. # no example for HYPERPAINT
  1063. >2 beshort 25
  1064. >>0 use gem_info
  1065. 16 string XIMG\0
  1066. >0 use gem_info
  1067. # no example
  1068. 16 string STTT\0\x10
  1069. >0 use gem_info
  1070. # no example or description
  1071. 16 string TIMG\0
  1072. >0 use gem_info
  1073. 0 name gem_info
  1074. # version is 2 for some XIMG and 1 for all others
  1075. >0 beshort <0x0003 GEM
  1076. # https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
  1077. !:mime image/x-gem
  1078. # header_size 24 25 27 59 779 words for colored bitmaps
  1079. >>2 beshort >9
  1080. >>>16 string STTT\0\x10 STTT
  1081. >>>16 string TIMG\0 TIMG
  1082. # HYPERPAINT or NOSIG variant
  1083. >>>16 string \0\x80
  1084. >>>>2 beshort =24 NOSIG
  1085. >>>>2 beshort !24 HYPERPAINT
  1086. # NOSIG or XIMG variant
  1087. >>>16 default x
  1088. >>>>16 string !XIMG\0 NOSIG
  1089. >>16 string =XIMG\0 XIMG Image data
  1090. !:ext img/ximg
  1091. # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
  1092. >>16 string !XIMG\0 Image data
  1093. !:ext img
  1094. # header_size is 9 for Ventura files and 8 for other GEM Paint files
  1095. >>2 beshort 9 (Ventura)
  1096. #>>2 beshort 8 (Paint)
  1097. >>12 beshort x %d x
  1098. >>14 beshort x %d,
  1099. # 1 4 8
  1100. >>4 beshort x %d planes,
  1101. # in tenths of a millimetre
  1102. >>8 beshort x %d x
  1103. >>10 beshort x %d pixelsize
  1104. # pattern_size 1-8. 2 for GEM Paint
  1105. >>6 beshort !2 \b, pattern size %d
  1106. # GEM Metafile (Wolfram Kleff)
  1107. 0 lelong 0x0018FFFF GEM Metafile data
  1108. >4 leshort x version %d
  1109. #
  1110. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  1111. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  1112. #
  1113. 0 string \0\nSMJPEG SMJPEG
  1114. >8 belong x %d.x data
  1115. # According to the specification you could find any number of _TXT
  1116. # headers here, but I can't think of any way of handling that. None of
  1117. # the SMJPEG files I tried it on used this feature. Even if such a
  1118. # file is encountered the output should still be reasonable.
  1119. >16 string _SND \b,
  1120. >>24 beshort >0 %d Hz
  1121. >>26 byte 8 8-bit
  1122. >>26 byte 16 16-bit
  1123. >>28 string NONE uncompressed
  1124. # >>28 string APCM ADPCM compressed
  1125. >>27 byte 1 mono
  1126. >>28 byte 2 stereo
  1127. # Help! Isn't there any way to avoid writing this part twice?
  1128. >>32 string _VID \b,
  1129. # >>>48 string JFIF JPEG
  1130. >>>40 belong >0 %d frames
  1131. >>>44 beshort >0 (%d x
  1132. >>>46 beshort >0 %d)
  1133. >16 string _VID \b,
  1134. # >>32 string JFIF JPEG
  1135. >>24 belong >0 %d frames
  1136. >>28 beshort >0 (%d x
  1137. >>30 beshort >0 %d)
  1138. 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
  1139. # "thumbnail file" (icon)
  1140. # descended from "xv", but in use by other applications as well (Wolfram Kleff)
  1141. 0 string P7\ 332 XV "thumbnail file" (icon) data
  1142. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  1143. 0 string KiSS KISS/GS
  1144. >4 byte 16 color
  1145. >>5 byte x %d bit
  1146. >>8 leshort x %d colors
  1147. >>10 leshort x %d groups
  1148. >4 byte 32 cell
  1149. >>5 byte x %d bit
  1150. >>8 leshort x %d x
  1151. >>10 leshort x %d
  1152. >>12 leshort x +%d
  1153. >>14 leshort x +%d
  1154. # Webshots (www.webshots.com), by John Harrison
  1155. 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  1156. # Hercules DASD image files
  1157. # From Jan Jaeger <jj@septa.nl>
  1158. 0 string CKD_P370 Hercules CKD DASD image file
  1159. >8 long x \b, %d heads per cylinder
  1160. >12 long x \b, track size %d bytes
  1161. >16 byte x \b, device type 33%2.2X
  1162. 0 string CKD_C370 Hercules compressed CKD DASD image file
  1163. >8 long x \b, %d heads per cylinder
  1164. >12 long x \b, track size %d bytes
  1165. >16 byte x \b, device type 33%2.2X
  1166. 0 string CKD_S370 Hercules CKD DASD shadow file
  1167. >8 long x \b, %d heads per cylinder
  1168. >12 long x \b, track size %d bytes
  1169. >16 byte x \b, device type 33%2.2X
  1170. # Squeak images and programs - etoffi@softhome.net
  1171. 0 string \146\031\0\0 Squeak image data
  1172. 0 search/1 'From\040Squeak Squeak program text
  1173. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  1174. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  1175. 0 string PaRtImAgE-VoLuMe PartImage
  1176. >0x0020 string 0.6.1 file version %s
  1177. >>0x0060 lelong >-1 volume %d
  1178. #>>0x0064 8 byte identifier
  1179. #>>0x007c reserved
  1180. >>0x0200 string >\0 type %s
  1181. >>0x1400 string >\0 device %s,
  1182. >>0x1600 string >\0 original filename %s,
  1183. # Some fields omitted
  1184. >>0x2744 lelong 0 not compressed
  1185. >>0x2744 lelong 1 gzip compressed
  1186. >>0x2744 lelong 2 bzip2 compressed
  1187. >>0x2744 lelong >2 compressed with unknown algorithm
  1188. >0x0020 string >0.6.1 file version %s
  1189. >0x0020 string <0.6.1 file version %s
  1190. # DCX is multi-page PCX, using a simple header of up to 1024
  1191. # offsets for the respective PCX components.
  1192. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  1193. 0 lelong 987654321 DCX multi-page PCX image data
  1194. # Simon Walton <simonw@matteworld.com>
  1195. # Kodak Cineon format for scanned negatives
  1196. # http://www.kodak.com/US/en/motion/support/dlad/
  1197. 0 lelong 0xd75f2a80 Cineon image data
  1198. >200 belong >0 \b, %d x
  1199. >204 belong >0 %d
  1200. # Bio-Rad .PIC is an image format used by microscope control systems
  1201. # and related image processing software used by biologists.
  1202. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  1203. # BOOL values are two-byte integers; use them to rule out false positives.
  1204. # https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
  1205. # Samples: https://www.loci.wisc.edu/software/sample-data
  1206. 14 leshort <2
  1207. >62 leshort <2
  1208. >>54 leshort 12345 Bio-Rad .PIC Image File
  1209. >>>0 leshort >0 %d x
  1210. >>>2 leshort >0 %d,
  1211. >>>4 leshort =1 1 image in file
  1212. >>>4 leshort >1 %d images in file
  1213. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  1214. # The description of *.mrw format can be found at
  1215. # http://www.dalibor.cz/minolta/raw_file_format.htm
  1216. 0 string \000MRM Minolta Dimage camera raw image data
  1217. # Summary: DjVu image / document
  1218. # Extension: .djvu
  1219. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  1220. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  1221. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  1222. 0 string AT&TFORM
  1223. >12 string DJVM DjVu multiple page document
  1224. !:mime image/vnd.djvu
  1225. >12 string DJVU DjVu image or single page document
  1226. !:mime image/vnd.djvu
  1227. >12 string DJVI DjVu shared document
  1228. !:mime image/vnd.djvu
  1229. >12 string THUM DjVu page thumbnails
  1230. !:mime image/vnd.djvu
  1231. # Originally by Marc Espie
  1232. # Modified by Robert Minsk <robertminsk at yahoo.com>
  1233. # https://www.openexr.com/openexrfilelayout.pdf
  1234. 0 lelong 20000630 OpenEXR image data,
  1235. !:mime image/x-exr
  1236. >4 lelong&0x000000ff x version %d,
  1237. >4 lelong ^0x00000200 storage: scanline
  1238. >4 lelong &0x00000200 storage: tiled
  1239. >8 search/0x1000 compression\0 \b, compression:
  1240. >>&16 byte 0 none
  1241. >>&16 byte 1 rle
  1242. >>&16 byte 2 zips
  1243. >>&16 byte 3 zip
  1244. >>&16 byte 4 piz
  1245. >>&16 byte 5 pxr24
  1246. >>&16 byte 6 b44
  1247. >>&16 byte 7 b44a
  1248. >>&16 byte 8 dwaa
  1249. >>&16 byte 9 dwab
  1250. >>&16 byte >9 unknown
  1251. >8 search/0x1000 dataWindow\0 \b, dataWindow:
  1252. >>&10 lelong x (%d
  1253. >>&14 lelong x %d)-
  1254. >>&18 lelong x \b(%d
  1255. >>&22 lelong x %d)
  1256. >8 search/0x1000 displayWindow\0 \b, displayWindow:
  1257. >>&10 lelong x (%d
  1258. >>&14 lelong x %d)-
  1259. >>&18 lelong x \b(%d
  1260. >>&22 lelong x %d)
  1261. >8 search/0x1000 lineOrder\0 \b, lineOrder:
  1262. >>&14 byte 0 increasing y
  1263. >>&14 byte 1 decreasing y
  1264. >>&14 byte 2 random y
  1265. >>&14 byte >2 unknown
  1266. # SMPTE Digital Picture Exchange Format, SMPTE DPX
  1267. #
  1268. # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
  1269. # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
  1270. # Robert Minsk <robertminsk at yahoo.com>
  1271. # Modified by Harry Mallon <hjmallon at gmail.com>
  1272. 0 string SDPX DPX image data, big-endian,
  1273. !:mime image/x-dpx
  1274. >0 use dpx_info
  1275. 0 string XPDS DPX image data, little-endian,
  1276. !:mime image/x-dpx
  1277. >0 use \^dpx_info
  1278. 0 name dpx_info
  1279. >768 beshort <4
  1280. >>772 belong x %dx
  1281. >>776 belong x \b%d,
  1282. >768 beshort >3
  1283. >>776 belong x %dx
  1284. >>772 belong x \b%d,
  1285. >768 beshort 0 left to right/top to bottom
  1286. >768 beshort 1 right to left/top to bottom
  1287. >768 beshort 2 left to right/bottom to top
  1288. >768 beshort 3 right to left/bottom to top
  1289. >768 beshort 4 top to bottom/left to right
  1290. >768 beshort 5 top to bottom/right to left
  1291. >768 beshort 6 bottom to top/left to right
  1292. >768 beshort 7 bottom to top/right to left
  1293. # From: Tom Hilinski <tom.hilinski@comcast.net>
  1294. # https://www.unidata.ucar.edu/packages/netcdf/
  1295. 0 string CDF\001 NetCDF Data Format data
  1296. #-----------------------------------------------------------------------
  1297. # Hierarchical Data Format, used to facilitate scientific data exchange
  1298. # specifications at http://hdf.ncsa.uiuc.edu/
  1299. 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
  1300. !:mime application/x-hdf
  1301. 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
  1302. !:mime application/x-hdf
  1303. 512 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 512 bytes user block
  1304. !:mime application/x-hdf
  1305. 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
  1306. !:mime application/x-hdf
  1307. 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
  1308. !:mime application/x-hdf
  1309. 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
  1310. !:mime application/x-hdf
  1311. # From: Tobias Burnus <burnus@net-b.de>
  1312. # Xara (for a while: Corel Xara) is a graphic package, see
  1313. # http://www.xara.com/ for Windows and as GPL application for Linux
  1314. 0 string XARA\243\243 Xara graphics file
  1315. # https://www.cartesianinc.com/Tech/
  1316. 0 string CPC\262 Cartesian Perceptual Compression image
  1317. !:mime image/x-cpi
  1318. # From Albert Cahalan <acahalan@gmail.com>
  1319. # puredigital used it for the CVS disposable camcorder
  1320. #8 lelong 4 ZBM bitmap image data
  1321. #>4 leshort x %u x
  1322. #>6 leshort x %u
  1323. # From Albert Cahalan <acahalan@gmail.com>
  1324. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  1325. 0 string C565 OLPC firmware icon image data
  1326. >4 leshort x %u x
  1327. >6 leshort x %u
  1328. # Applied Images - Image files from Cytovision
  1329. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  1330. 0 string \xce\xda\xde\xfa Cytovision Metaphases file
  1331. 0 string \xed\xad\xef\xac Cytovision Karyotype file
  1332. 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
  1333. 0 string \xed\xfe\xda\xbe Cytovision FLEX file
  1334. 0 string \xed\xab\xed\xfe Cytovision FLEX file
  1335. 0 string \xad\xfd\xea\xad Cytovision RATS file
  1336. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  1337. # From Tano M Fotang <mfotang@quanteq.com>
  1338. 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
  1339. # Type: PCO B16 image files
  1340. # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
  1341. # From: Florian Philipp <florian.philipp@binarywings.net>
  1342. # Extension: .b16
  1343. # Description: Pixel image format produced by PCO Camware, typically used
  1344. # together with PCO cameras.
  1345. # Note: Different versions exist for e.g. 8 bit and 16 bit images.
  1346. # Documentation is incomplete.
  1347. 0 string/b PCO- PCO B16 image data
  1348. >12 lelong x \b, %dx
  1349. >16 lelong x \b%d
  1350. >20 lelong 0 \b, short header
  1351. >20 lelong -1 \b, extended header
  1352. >>24 lelong 0 \b, grayscale
  1353. >>>36 lelong 0 linear LUT
  1354. >>>36 lelong 1 logarithmic LUT
  1355. >>>28 lelong x [%d
  1356. >>>32 lelong x \b,%d]
  1357. >>24 lelong 1 \b, color
  1358. >>>64 lelong 0 linear LUT
  1359. >>>64 lelong 1 logarithmic LUT
  1360. >>>40 lelong x r[%d
  1361. >>>44 lelong x \b,%d]
  1362. >>>48 lelong x g[%d
  1363. >>>52 lelong x \b,%d]
  1364. >>>56 lelong x b[%d
  1365. >>>60 lelong x \b,%d]
  1366. # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
  1367. # From: Markus Heidelberg <markus.heidelberg at web.de>
  1368. 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
  1369. !:mime image/x-polar-monitor-bitmap
  1370. # From: Rick Richardson <rickrich@gmail.com>
  1371. # updated by: Joerg Jenderek
  1372. # URL: http://techmods.net/nuvi/
  1373. 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
  1374. # extension is also used for
  1375. # Sony SRF raw image (image/x-sony-srf)
  1376. # SRF map
  1377. # Terragen Surface Map (https://www.planetside.co.uk/terragen)
  1378. # FileLocator Pro search criteria file (https://www.mythicsoft.com/filelocatorpro)
  1379. !:ext srf
  1380. #!:mime image/x-garmin-srf
  1381. # version 1.00,2.00,2.10,2.40,2.50
  1382. >0x2f string >0 \b, version %4.4s
  1383. # width (2880,2881,3240)
  1384. >0x55 uleshort >0 \b, %dx
  1385. # height (80,90)
  1386. >>0x53 uleshort x \b%d
  1387. # Type: Ulead Photo Explorer5 (.pe5)
  1388. # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
  1389. # From: Simon Horman <horms@debian.org>
  1390. 0 string IIO2H Ulead Photo Explorer5
  1391. # Type: X11 cursor
  1392. # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  1393. # From: Mathias Brodala <info@noctus.net>
  1394. 0 string Xcur X11 cursor
  1395. # Type: Olympus ORF raw images.
  1396. # URL: https://libopenraw.freedesktop.org/wiki/Olympus_ORF
  1397. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1398. 0 string MMOR Olympus ORF raw image data, big-endian
  1399. !:mime image/x-olympus-orf
  1400. 0 string IIRO Olympus ORF raw image data, little-endian
  1401. !:mime image/x-olympus-orf
  1402. 0 string IIRS Olympus ORF raw image data, little-endian
  1403. !:mime image/x-olympus-orf
  1404. # Type: files used in modern AVCHD camcoders to store clip information
  1405. # Extension: .cpi
  1406. # From: Alexander Danilov <alexander.a.danilov@gmail.com>
  1407. 0 string HDMV0100 AVCHD Clip Information
  1408. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1409. # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
  1410. # Radiance HDR; usually has .pic or .hdr extension.
  1411. 0 string #?RADIANCE\n Radiance HDR image data
  1412. #!mime image/vnd.radiance
  1413. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1414. # URL: https://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
  1415. # Used by the pfstools packages. The regex matches for the image size could
  1416. # probably use some work. The MIME type is made up; if there's one in
  1417. # actual common use, it should replace the one below.
  1418. 0 string PFS1\x0a PFS HDR image data
  1419. #!mime image/x-pfs
  1420. >1 regex [0-9]*\ \b, %s
  1421. >>1 regex \ [0-9]{4} \bx%s
  1422. # Type: Foveon X3F
  1423. # URL: https://www.photofo.com/downloads/x3f-raw-format.pdf
  1424. # From: Adam Buchbinder <adam.buchbinder@gmail.com>
  1425. # Note that the MIME type isn't defined anywhere that I can find; if
  1426. # there's a canonical type for this format, it should replace this one.
  1427. 0 string FOVb Foveon X3F raw image data
  1428. !:mime image/x-x3f
  1429. >6 leshort x \b, version %d.
  1430. >4 leshort x \b%d
  1431. >28 lelong x \b, %dx
  1432. >32 lelong x \b%d
  1433. # Paint.NET file
  1434. # From Adam Buchbinder <adam.buchbinder@gmail.com>
  1435. 0 string PDN3 Paint.NET image data
  1436. !:mime image/x-paintnet
  1437. # Not really an image.
  1438. # From: "Tano M. Fotang" <mfotang@quanteq.com>
  1439. 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
  1440. # doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
  1441. # example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
  1442. 90 bequad 0x574D50484F544F00 JPEG-XR Image
  1443. >98 byte&0x08 =0x08 \b, hard tiling
  1444. >99 byte&0x80 =0x80 \b, tiling present
  1445. >99 byte&0x40 =0x40 \b, codestream present
  1446. >99 byte&0x38 x \b, spatial xform=
  1447. >99 byte&0x38 0x00 \bTL
  1448. >99 byte&0x38 0x08 \bBL
  1449. >99 byte&0x38 0x10 \bTR
  1450. >99 byte&0x38 0x18 \bBR
  1451. >99 byte&0x38 0x20 \bBT
  1452. >99 byte&0x38 0x28 \bRB
  1453. >99 byte&0x38 0x30 \bLT
  1454. >99 byte&0x38 0x38 \bLB
  1455. >100 byte&0x80 =0x80 \b, short header
  1456. >>102 beshort+1 x \b, %d
  1457. >>104 beshort+1 x \bx%d
  1458. >100 byte&0x80 =0x00 \b, long header
  1459. >>102 belong+1 x \b, %x
  1460. >>106 belong+1 x \bx%x
  1461. >101 beshort&0xf x \b, bitdepth=
  1462. >>101 beshort&0xf 0x0 \b1-WHITE=1
  1463. >>101 beshort&0xf 0x1 \b8
  1464. >>101 beshort&0xf 0x2 \b16
  1465. >>101 beshort&0xf 0x3 \b16-SIGNED
  1466. >>101 beshort&0xf 0x4 \b16-FLOAT
  1467. >>101 beshort&0xf 0x5 \b(reserved 5)
  1468. >>101 beshort&0xf 0x6 \b32-SIGNED
  1469. >>101 beshort&0xf 0x7 \b32-FLOAT
  1470. >>101 beshort&0xf 0x8 \b5
  1471. >>101 beshort&0xf 0x9 \b10
  1472. >>101 beshort&0xf 0xa \b5-6-5
  1473. >>101 beshort&0xf 0xb \b(reserved %d)
  1474. >>101 beshort&0xf 0xc \b(reserved %d)
  1475. >>101 beshort&0xf 0xd \b(reserved %d)
  1476. >>101 beshort&0xf 0xe \b(reserved %d)
  1477. >>101 beshort&0xf 0xf \b1-BLACK=1
  1478. >101 beshort&0xf0 x \b, colorfmt=
  1479. >>101 beshort&0xf0 0x00 \bYONLY
  1480. >>101 beshort&0xf0 0x10 \bYUV240
  1481. >>101 beshort&0xf0 0x20 \bYWV422
  1482. >>101 beshort&0xf0 0x30 \bYWV444
  1483. >>101 beshort&0xf0 0x40 \bCMYK
  1484. >>101 beshort&0xf0 0x50 \bCMYKDIRECT
  1485. >>101 beshort&0xf0 0x60 \bNCOMPONENT
  1486. >>101 beshort&0xf0 0x70 \bRGB
  1487. >>101 beshort&0xf0 0x80 \bRGBE
  1488. >>101 beshort&0xf0 >0x80 \b(reserved 0x%x)
  1489. # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
  1490. #
  1491. # BPG (Better Portable Graphics) format
  1492. # https://bellard.org/bpg/
  1493. # http://fileformats.archiveteam.org/wiki/BPG
  1494. #
  1495. 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
  1496. !:mime image/bpg
  1497. # From: Joerg Jenderek
  1498. # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
  1499. 0 string icns Mac OS X icon
  1500. !:mime image/x-icns
  1501. !:apple ????icns
  1502. !:ext icns
  1503. >4 ubelong >0
  1504. # file size
  1505. >>4 ubelong x \b, %d bytes
  1506. # icon type
  1507. >>8 string x \b, "%4.4s" type
  1508. # TIM images
  1509. 0 lelong 0x00000010 TIM image,
  1510. >4 lelong 0x8 4-Bit,
  1511. >4 lelong 0x9 8-Bit,
  1512. >4 lelong 0x2 15-Bit,
  1513. >4 lelong 0x3 24-Bit,
  1514. >4 lelong &8
  1515. >>(8.l+12) leshort x Pixel at (%d,
  1516. >>(8.l+14) leshort x \b%d)
  1517. >>(8.l+16) leshort x Size=%dx
  1518. >>(8.l+18) leshort x \b%d,
  1519. >>4 lelong 0x8 16 CLUT Entries at
  1520. >>4 lelong 0x9 256 CLUT Entries at
  1521. >>12 leshort x (%d,
  1522. >>14 leshort x \b%d)
  1523. >4 lelong ^8
  1524. >>12 leshort x Pixel at (%d,
  1525. >>14 leshort x \b%d)
  1526. >>16 leshort x Size=%dx
  1527. >>18 leshort x \b%d
  1528. # MDEC streams
  1529. 0 lelong 0x80010160 MDEC video stream,
  1530. >16 leshort x %dx
  1531. >18 leshort x \b%d
  1532. #>8 lelong x %d frames
  1533. #>4 leshort x secCount=%d;
  1534. #>6 leshort x nSectors=%d;
  1535. #>12 lelong x frameSize=%d;
  1536. # BS encoded bitstreams
  1537. 2 leshort 0x3800 BS image,
  1538. >6 leshort x Version %d,
  1539. >4 leshort x Quantization %d,
  1540. >0 leshort x (Decompresses to %d words)
  1541. # Type: farbfeld image.
  1542. # Url: http://tools.suckless.org/farbfeld/
  1543. # From: Ian D. Scott <ian@iandouglasscott.com>
  1544. #
  1545. 0 string farbfeld farbfeld image data,
  1546. >8 ubelong x %dx
  1547. >12 ubelong x \b%d
  1548. # Type: Microsoft DirectDraw Surface (common data)
  1549. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  1550. # From: Morten Hustveit <morten@debian.org>
  1551. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  1552. 0 name ms-directdraw-surface
  1553. >0x10 ulelong x %u x
  1554. >0x0C ulelong x %u
  1555. # Color depth.
  1556. >0x58 ulelong >0 \b, %u-bit color
  1557. # Determine the pixel format.
  1558. >0x50 ulelong&0x4 4
  1559. # FIXME: Handle DX10 and XBOX formats.
  1560. >>0x54 string x \b, compressed using %.4s
  1561. >0x50 ulelong&0x2 0x2 \b, alpha only
  1562. >0x50 ulelong&0x200 0x200 \b, YUV
  1563. >0x50 ulelong&0x20000 0x20000 \b, luminance
  1564. # RGB pixel format
  1565. >0x50 ulelong&0x40 0x40
  1566. # Determine the RGB format using the color masks.
  1567. # ulequad order: 0xGGGGGGGGRRRRRRRR, 0xAAAAAAAABBBBBBBB
  1568. >>0x58 ulelong 16
  1569. # NOTE: 15-bit color formats usually have 16-bit listed as the color depth.
  1570. >>>0x5C ulequad 0x000003E000007C00
  1571. >>>>0x64 ulequad 0x000000000000001F \b, RGB555
  1572. >>>0x5C ulequad 0x000003E000001F00
  1573. >>>>0x64 ulequad 0x000000000000007C \b, BGR555
  1574. >>>0x5C ulequad 0x000007E00000F800
  1575. >>>>0x64 ulequad 0x000000000000001F \b, RGB565
  1576. >>>0x5C ulequad 0x000007E000001F00
  1577. >>>>0x64 ulequad 0x00000000000000F8 \b, BGR565
  1578. >>>0x5C ulequad 0x000000F000000F00
  1579. >>>>0x64 ulequad 0x0000F0000000000F \b, ARGB4444
  1580. >>>0x5C ulequad 0x000000F00000000F
  1581. >>>>0x64 ulequad 0x0000F00000000F00 \b, ABGR4444
  1582. >>>0x5C ulequad 0x00000F000000F000
  1583. >>>>0x64 ulequad 0x0000000F000000F0 \b, RGBA4444
  1584. >>>0x5C ulequad 0x00000F00000000F0
  1585. >>>>0x64 ulequad 0x0000000F0000F000 \b, BGRA4444
  1586. >>>0x5C ulequad 0x000000F000000F00
  1587. >>>>0x64 ulequad 0x000000000000000F \b, xRGB4444
  1588. >>>0x5C ulequad 0x000000F00000000F
  1589. >>>>0x64 ulequad 0x0000000000000F00 \b, xBGR4444
  1590. >>>0x5C ulequad 0x00000F000000F000
  1591. >>>>0x64 ulequad 0x00000000000000F0 \b, RGBx4444
  1592. >>>0x5C ulequad 0x00000F00000000F0
  1593. >>>>0x64 ulequad 0x000000000000F000 \b, BGRx4444
  1594. >>>0x5C ulequad 0x000003E000007C00
  1595. >>>>0x64 ulequad 0x000080000000001F \b, ARGB1555
  1596. >>>0x5C ulequad 0x000003E000001F00
  1597. >>>>0x64 ulequad 0x000080000000007C \b, ABGR1555
  1598. >>>0x5C ulequad 0x000007C00000F800
  1599. >>>>0x64 ulequad 0x000000010000003E \b, RGBA5551
  1600. >>>0x5C ulequad 0x000007C00000003E
  1601. >>>>0x64 ulequad 0x000000010000F800 \b, BGRA5551
  1602. >>88 ulelong 24
  1603. >>>0x5C ulequad 0x0000FF0000FF0000
  1604. >>>>0x64 ulequad 0x00000000000000FF \b, RGB888
  1605. >>>0x5C ulequad 0x0000FF00000000FF
  1606. >>>>0x64 ulequad 0x0000000000FF0000 \b, BGR888
  1607. >>88 ulelong 32
  1608. >>>0x5C ulequad 0x0000FF0000FF0000
  1609. >>>>0x64 ulequad 0xFF000000000000FF \b, ARGB8888
  1610. >>>0x5C ulequad 0x0000FF00000000FF
  1611. >>>>0x64 ulequad 0xFF00000000FF0000 \b, ABGR8888
  1612. >>>0x5C ulequad 0x00FF0000FF000000
  1613. >>>>0x64 ulequad 0x000000FF0000FF00 \b, RGBA8888
  1614. >>>0x5C ulequad 0x00FF00000000FF00
  1615. >>>>0x64 ulequad 0x000000FFFF000000 \b, BGBA8888
  1616. >>>0x5C ulequad 0x0000FF0000FF0000
  1617. >>>>0x64 ulequad 0x00000000000000FF \b, xRGB8888
  1618. >>>0x5C ulequad 0x0000FF00000000FF
  1619. >>>>0x64 ulequad 0x0000000000FF0000 \b, xBGR8888
  1620. >>>0x5C ulequad 0x00FF0000FF000000
  1621. >>>>0x64 ulequad 0x000000000000FF00 \b, RGBx8888
  1622. >>>0x5C ulequad 0x00FF00000000FF00
  1623. >>>>0x64 ulequad 0x00000000FF000000 \b, BGBx8888
  1624. # Less common 32-bit color formats.
  1625. >>>0x5C ulequad 0xFFFF00000000FFFF
  1626. >>>>0x64 ulequad 0x0000000000000000 \b, G16R16
  1627. >>>0x5C ulequad 0x0000FFFFFFFF0000
  1628. >>>>0x64 ulequad 0x0000000000000000 \b, R16G16
  1629. >>>0x5C ulequad 0x000FFC003FF00000
  1630. >>>>0x64 ulequad 0xC0000000000003FF \b, A2R10G10B10
  1631. >>>0x5C ulequad 0x000FFC00000003FF
  1632. >>>>0x64 ulequad 0xC00000003FF00000 \b, A2B10G10R10
  1633. # Type: Microsoft DirectDraw Surface
  1634. # URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  1635. # From: Morten Hustveit <morten@debian.org>
  1636. # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
  1637. 0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS):
  1638. >0 use ms-directdraw-surface
  1639. # Type: Sega PVR image.
  1640. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1641. # References:
  1642. # - https://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
  1643. # - https://github.com/yazgoo/pvrx2png
  1644. # - https://github.com/nickworonekin/puyotools
  1645. # Sega PVR header.
  1646. 0 name sega-pvr-image-header
  1647. >0x0C leshort x %u x
  1648. >0x0E leshort x %u
  1649. # Image format.
  1650. >0x08 byte 0 \b, ARGB1555
  1651. >0x08 byte 1 \b, RGB565
  1652. >0x08 byte 2 \b, ARGB4444
  1653. >0x08 byte 3 \b, YUV442
  1654. >0x08 byte 4 \b, Bump
  1655. >0x08 byte 5 \b, 4bpp
  1656. >0x08 byte 6 \b, 8bpp
  1657. # Image data type.
  1658. >0x09 byte 0x01 \b, square twiddled
  1659. >0x09 byte 0x02 \b, square twiddled & mipmap
  1660. >0x09 byte 0x03 \b, VQ
  1661. >0x09 byte 0x04 \b, VQ & mipmap
  1662. >0x09 byte 0x05 \b, 8-bit CLUT twiddled
  1663. >0x09 byte 0x06 \b, 4-bit CLUT twiddled
  1664. >0x09 byte 0x07 \b, 8-bit direct twiddled
  1665. >0x09 byte 0x08 \b, 4-bit direct twiddled
  1666. >0x09 byte 0x09 \b, rectangle
  1667. >0x09 byte 0x0B \b, rectangular stride
  1668. >0x09 byte 0x0D \b, rectangular twiddled
  1669. >0x09 byte 0x10 \b, small VQ
  1670. >0x09 byte 0x11 \b, small VQ & mipmap
  1671. >0x09 byte 0x12 \b, square twiddled & mipmap
  1672. # Sega PVR image.
  1673. 0 string PVRT
  1674. >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1675. >>0x20 use ms-directdraw-surface
  1676. >0x10 belong !0x44445320 Sega PVR image:
  1677. >>0 use sega-pvr-image-header
  1678. # Sega PVR image with GBIX.
  1679. 0 string GBIX
  1680. >0x10 string PVRT
  1681. >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
  1682. >>>0x20 use ms-directdraw-surface
  1683. >>0x10 belong !0x44445320 Sega PVR image:
  1684. >>>0x10 use sega-pvr-image-header
  1685. >>0x08 lelong x \b, global index = %u
  1686. # Sega GVR header.
  1687. 0 name sega-gvr-image-header
  1688. >0x0C beshort x %u x
  1689. >0x0E beshort x %u
  1690. # Image data format.
  1691. >0x0B byte 0 \b, I4
  1692. >0x0B byte 1 \b, I8
  1693. >0x0B byte 2 \b, IA4
  1694. >0x0B byte 3 \b, IA8
  1695. >0x0B byte 4 \b, RGB565
  1696. >0x0B byte 5 \b, RGB5A3
  1697. >0x0B byte 6 \b, ARGB8888
  1698. >0x0B byte 8 \b, CI4
  1699. >0x0B byte 9 \b, CI8
  1700. >0x0B byte 14 \b, DXT1
  1701. # Sega GVR image.
  1702. 0 string GVRT Sega GVR image:
  1703. >0x10 use sega-gvr-image-header
  1704. # Sega GVR image with GBIX.
  1705. 0 string GBIX
  1706. >0x10 string GVRT Sega GVR image:
  1707. >>0x10 use sega-gvr-image-header
  1708. >>0x08 belong x \b, global index = %u
  1709. # Sega GVR image with GCIX. (Wii)
  1710. 0 string GCIX
  1711. >0x10 string GVRT Sega GVR image:
  1712. >>0x10 use sega-gvr-image-header
  1713. >>0x08 belong x \b, global index = %u
  1714. # Light Field Picture
  1715. # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
  1716. # Typical file extensions: .lfp .lfr .lfx
  1717. 0 belong 0x894C4650
  1718. >4 belong 0x0D0A1A0A
  1719. >12 belong 0x00000000 Lytro Light Field Picture
  1720. >8 belong x \b, version %d
  1721. # Type: Vision Research Phantom CINE Format
  1722. # URL: https://www.phantomhighspeed.com/
  1723. # URL2: http://phantomhighspeed.force.com/vriknowledge/servlet/fileField?id=0BEU0000000Cfyk
  1724. # From: Harry Mallon <hjmallon at gmail.com>
  1725. #
  1726. # This has a short "CI" code but the 44 is the size of the struct which is
  1727. # stable
  1728. 0 string CI
  1729. >2 leshort 44 Vision Research CINE Video,
  1730. >>4 leshort 0 Grayscale,
  1731. >>4 leshort 1 JPEG Compressed,
  1732. >>4 leshort 2 RAW,
  1733. >>6 leshort x version %d,
  1734. >>20 lelong x %d frames,
  1735. >>48 lelong x %dx
  1736. >>52 lelong x \b%d
  1737. # Type: ARRI Raw Image
  1738. # Info: SMPTE RDD30:2014
  1739. # From: Harry Mallon <hjmallon at gmail.com>
  1740. 0 string ARRI ARRI ARI image data,
  1741. >4 lelong 0x78563412 little-endian,
  1742. >4 lelong 0x12345678 big-endian,
  1743. >12 lelong x version %d,
  1744. >20 lelong x %dx
  1745. >24 lelong x \b%d
  1746. # Type: Khronos KTX texture.
  1747. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1748. # References:
  1749. # - https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
  1750. # glEnum decoding.
  1751. # NOTE: Only the most common formats are listed here.
  1752. 0 name khronos-ktx-glEnum
  1753. >0 lelong 0x1907 \b, RGB
  1754. >0 lelong 0x1908 \b, RGBA
  1755. >0 lelong 0x1909 \b, LUMINANCE
  1756. >0 lelong 0x190A \b, LUMINANCE_ALPHA
  1757. >0 lelong 0x80E1 \b, BGR
  1758. >0 lelong 0x80E2 \b, BGRA
  1759. >0 lelong 0x83A0 \b, RGB_S3TC
  1760. >0 lelong 0x83A1 \b, RGB4_S3TC
  1761. >0 lelong 0x83A2 \b, RGBA_S3TC
  1762. >0 lelong 0x83A3 \b, RGBA4_S3TC
  1763. >0 lelong 0x83A4 \b, RGBA_DXT5_S3TC
  1764. >0 lelong 0x83A5 \b, RGBA4_DXT5_S3TC
  1765. >0 lelong 0x8D64 \b, ETC1_RGB8_OES
  1766. >0 lelong 0x9270 \b, COMPRESSED_R11_EAC
  1767. >0 lelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
  1768. >0 lelong 0x9272 \b, COMPRESSED_RG11_EAC
  1769. >0 lelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
  1770. >0 lelong 0x9274 \b, COMPRESSED_RGB8_ETC2
  1771. >0 lelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
  1772. >0 lelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
  1773. >0 lelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
  1774. >0 lelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
  1775. >0 lelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
  1776. >0 lelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
  1777. >0 lelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
  1778. >0 lelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
  1779. >0 lelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
  1780. >0 lelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
  1781. >0 lelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
  1782. >0 lelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
  1783. >0 lelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
  1784. >0 lelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
  1785. >0 lelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
  1786. >0 lelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
  1787. >0 lelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
  1788. >0 lelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
  1789. >0 lelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
  1790. >0 lelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
  1791. >0 lelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
  1792. >0 lelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
  1793. >0 lelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
  1794. >0 lelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
  1795. >0 lelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
  1796. >0 lelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
  1797. >0 lelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
  1798. >0 lelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
  1799. >0 lelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
  1800. >0 lelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
  1801. >0 lelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
  1802. >0 lelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
  1803. >0 lelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
  1804. # Endian-specific KTX header.
  1805. # TODO: glType (all textures I've seen so far are GL_UNSIGNED_BYTE)
  1806. 0 name khronos-ktx-endian-header
  1807. >20 lelong x \b, %u
  1808. >24 lelong >1 x %u
  1809. >28 lelong >1 x %u
  1810. >8 lelong >0
  1811. >>8 use khronos-ktx-glEnum
  1812. >8 lelong 0
  1813. >>12 use khronos-ktx-glEnum
  1814. # Main KTX header.
  1815. # Determine endianness, then check the rest of the header.
  1816. 0 string \xABKTX\ 11\xBB\r\n\x1A\n Khronos KTX texture
  1817. >12 lelong 0x04030201 (little-endian)
  1818. >>16 use khronos-ktx-endian-header
  1819. >12 belong 0x04030201 (big-endian)
  1820. >>16 use \^khronos-ktx-endian-header
  1821. # Type: Valve VTF texture.
  1822. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1823. # References:
  1824. # - https://developer.valvesoftware.com/wiki/Valve_Texture_Format
  1825. # VTF image formats.
  1826. 0 name vtf-image-format
  1827. >0 lelong 0 RGBA8888
  1828. >0 lelong 1 ABGR8888
  1829. >0 lelong 2 RGB888
  1830. >0 lelong 3 BGR888
  1831. >0 lelong 4 RGB565
  1832. >0 lelong 5 I8
  1833. >0 lelong 6 IA88
  1834. >0 lelong 7 P8
  1835. >0 lelong 8 A8
  1836. >0 lelong 9 RGB888 (bluescreen)
  1837. >0 lelong 10 BGR888 (bluescreen)
  1838. >0 lelong 11 ARGB8888
  1839. >0 lelong 12 BGRA8888
  1840. >0 lelong 13 DXT1
  1841. >0 lelong 14 DXT3
  1842. >0 lelong 15 DXT5
  1843. >0 lelong 16 BGRx8888
  1844. >0 lelong 17 BGR565
  1845. >0 lelong 18 BGRx5551
  1846. >0 lelong 19 BGRA4444
  1847. >0 lelong 20 DXT1+A1
  1848. >0 lelong 21 BGRA5551
  1849. >0 lelong 22 UV88
  1850. >0 lelong 23 UVWQ8888
  1851. >0 lelong 24 RGBA16161616F
  1852. >0 lelong 25 RGBA16161616
  1853. >0 lelong 26 UVLX8888
  1854. # Main VTF header.
  1855. 0 string VTF\0 Valve Texture Format
  1856. >4 lelong x v%u
  1857. >8 lelong x \b.%u
  1858. >0x10 leshort x \b, %u
  1859. >0x12 leshort >1 x %u
  1860. >4 lequad 0x0000000700000002
  1861. >>0x3F leshort >1 x %u
  1862. >0x18 leshort >1 \b, %u frames
  1863. >0x38 byte x \b, mipmaps: %u
  1864. >0x34 lelong >-1 \b,
  1865. >>0x34 use vtf-image-format
  1866. # Type: Valve VTF3 (PS3) texture.
  1867. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1868. 0 string VTF3 Valve Texture Format (PS3)
  1869. >0x14 beshort x \b, %u
  1870. >0x16 beshort x \b x %u
  1871. >0x10 belong&0x2000 0 \b, DXT1
  1872. >0x10 belong&0x2000 0x2000 \b, DXT5
  1873. # Type: ASTC texture.
  1874. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1875. # References:
  1876. # - https://stackoverflow.com/questions/22600678/determine-internal-format-of-given-astc-compressed-image-through-its-header
  1877. # - https://stackoverflow.com/a/22682244
  1878. 0 lelong 0x5ca1ab13 ASTC
  1879. >4 byte x %u
  1880. >5 byte x \bx%u
  1881. >6 byte >1 \bx%u
  1882. # X, Y, and Z dimensions are stored as 24-bit LE.
  1883. # Pretend it's 32-bit and mask off the high byte.
  1884. >7 lelong&0x00FFFFFF x texture, %u
  1885. >10 lelong&0x00FFFFFF x x %u
  1886. >13 lelong&0x00FFFFFF >1 x %u
  1887. # Zebra Metafile graphic
  1888. # http://www.fileformat.info/format/zbr/egff.htm
  1889. 0 beshort 0x9a02 Zebra Metafile graphic
  1890. >2 leshort 1 (version 1.x)
  1891. >2 leshort 2 (version 1.1x or 1.2x)
  1892. >2 leshort 3 (version 1.49)
  1893. >2 leshort 4 (version 1.50)
  1894. >4 string x (comment = %s)
  1895. # Microsoft Paint graphic
  1896. # http://www.fileformat.info/format/mspaint/egff.htm
  1897. 0 string DanM icrosoft Paint image data (version 1.x)
  1898. >4 leshort x (%d
  1899. >>6 leshort x x %d)
  1900. 0 string LinS Microsoft Paint image data (version 2.0)
  1901. >4 leshort x (%d
  1902. >>6 leshort x x %d)
  1903. # reMarkable tablet internal file format (https://www.remarkable.com/)
  1904. # https://github.com/ax3l/lines-are-beautiful
  1905. # https://plasma.ninja/blog/devices/remarkable/binary/format/2017/12/26/\
  1906. # reMarkable-lines-file-format.html#what-to-do-next
  1907. # from Axel Huebl
  1908. 0 string reMarkable
  1909. >11 string lines
  1910. >>17 string with
  1911. >>>22 string selections
  1912. >>>>33 string and
  1913. >>>>>37 string layers
  1914. >>>>>>43 lelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
  1915. # newer per-page files for the reMarkable
  1916. 0 string reMarkable
  1917. >11 string .lines
  1918. >>18 string file,
  1919. >>>24 string version=
  1920. >>>>32 byte x reMarkable tablet page (v%c), 1404 x 1872,
  1921. >>>>>43 lelong x %d layer(s)
  1922. # Type: PVR3 texture.
  1923. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1924. # References:
  1925. # - http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
  1926. # PVR3 pixel formats.
  1927. 0 name pvr3-pixel-format
  1928. >4 ulelong 0
  1929. >>0 ulelong 0 PVRTC 2bpp RGB
  1930. >>0 ulelong 1 PVRTC 2bpp RGBA
  1931. >>0 ulelong 2 PVRTC 4bpp RGB
  1932. >>0 ulelong 3 PVRTC 4bpp RGBA
  1933. >>0 ulelong 4 PVRTC-II 2bpp
  1934. >>0 ulelong 5 PVRTC-II 4bpp
  1935. >>0 ulelong 6 ETC1
  1936. >>0 ulelong 7 DXT1
  1937. >>0 ulelong 8 DXT2
  1938. >>0 ulelong 9 DXT3
  1939. >>0 ulelong 10 DXT4
  1940. >>0 ulelong 11 DXT5
  1941. >>0 ulelong 12 BC4
  1942. >>0 ulelong 13 BC5
  1943. >>0 ulelong 14 BC6
  1944. >>0 ulelong 15 BC7
  1945. >>0 ulelong 16 UYVY
  1946. >>0 ulelong 17 YUY2
  1947. >>0 ulelong 18 BW1bpp
  1948. >>0 ulelong 19 R9G9B9E5 Shared Exponent
  1949. >>0 ulelong 20 RGBG8888
  1950. >>0 ulelong 21 GRGB8888
  1951. >>0 ulelong 22 ETC2 RGB
  1952. >>0 ulelong 23 ETC2 RGBA
  1953. >>0 ulelong 24 ETC2 RGB A1
  1954. >>0 ulelong 25 EAC R11
  1955. >>0 ulelong 26 EAC RG11
  1956. >>0 ulelong 27 ASTC_4x4
  1957. >>0 ulelong 28 ASTC_5x4
  1958. >>0 ulelong 29 ASTC_5x5
  1959. >>0 ulelong 30 ASTC_6x5
  1960. >>0 ulelong 31 ASTC_6x6
  1961. >>0 ulelong 32 ASTC_8x5
  1962. >>0 ulelong 33 ASTC_8x6
  1963. >>0 ulelong 34 ASTC_8x8
  1964. >>0 ulelong 35 ASTC_10x5
  1965. >>0 ulelong 36 ASTC_10x6
  1966. >>0 ulelong 37 ASTC_10x8
  1967. >>0 ulelong 38 ASTC_10x10
  1968. >>0 ulelong 39 ASTC_12x10
  1969. >>0 ulelong 40 ASTC_12x12
  1970. >>0 ulelong 41 ASTC_3x3x3
  1971. >>0 ulelong 42 ASTC_4x3x3
  1972. >>0 ulelong 43 ASTC_4x4x3
  1973. >>0 ulelong 44 ASTC_4x4x4
  1974. >>0 ulelong 45 ASTC_5x4x4
  1975. >>0 ulelong 46 ASTC_5x5x4
  1976. >>0 ulelong 47 ASTC_5x5x5
  1977. >>0 ulelong 48 ASTC_6x5x5
  1978. >>0 ulelong 49 ASTC_6x6x5
  1979. >>0 ulelong 50 ASTC_6x6x6
  1980. >4 ulelong !0
  1981. >>0 byte !0 %c
  1982. >>1 byte !0 \b%c
  1983. >>2 byte !0 \b%c
  1984. >>3 byte !0 \b%c
  1985. 0 string PVR\x03 PVR 3.0 texture:
  1986. >0x18 ulelong x %u x
  1987. >0x1C ulelong x %u
  1988. >0x20 ulelong >1 x %u
  1989. >0x08 byte x \b,
  1990. >0x08 use pvr3-pixel-format
  1991. >0x10 ulelong 1 \b, sRGB
  1992. >0x04 ulelong&0x02 0x02 \b, premultiplied alpha
  1993. # Type: Microsoft Xbox XPR0 texture.
  1994. # From: David Korth <gerbilsoft@gerbilsoft.com>
  1995. # References:
  1996. # - https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/XbD3D8Types.h
  1997. # XPR pixel formats.
  1998. 0 name xbox-xpr-pixel-format
  1999. >0 byte 0x00 L8
  2000. >0 byte 0x01 AL8
  2001. >0 byte 0x02 ARGB1555
  2002. >0 byte 0x03 RGB555
  2003. >0 byte 0x04 ARGB4444
  2004. >0 byte 0x05 RGB565
  2005. >0 byte 0x06 ARGB8888
  2006. >0 byte 0x07 xRGB8888
  2007. >0 byte 0x0B P8
  2008. >0 byte 0x0C DXT1
  2009. >0 byte 0x0E DXT2
  2010. >0 byte 0x0F DXT4
  2011. >0 byte 0x10 Linear ARGB1555
  2012. >0 byte 0x11 Linear RGB565
  2013. >0 byte 0x12 Linear ARGB8888
  2014. >0 byte 0x13 Linear L8
  2015. >0 byte 0x16 Linear R8B8
  2016. >0 byte 0x17 Linear G8B8
  2017. >0 byte 0x19 A8
  2018. >0 byte 0x1A A8L8
  2019. >0 byte 0x1B Linear AL8
  2020. >0 byte 0x1C Linear RGB555
  2021. >0 byte 0x1D Linear ARGB4444
  2022. >0 byte 0x1E Linear xRGB8888
  2023. >0 byte 0x1F Linear A8
  2024. >0 byte 0x20 Linear A8L8
  2025. >0 byte 0x24 YUY2
  2026. >0 byte 0x25 UYVY
  2027. >0 byte 0x27 L6V5U5
  2028. >0 byte 0x28 V8U8
  2029. >0 byte 0x29 R8B8
  2030. >0 byte 0x2A D24S8
  2031. >0 byte 0x2B F24S8
  2032. >0 byte 0x2C D16
  2033. >0 byte 0x2D F16
  2034. >0 byte 0x2E Linear D24S8
  2035. >0 byte 0x2F Linear F24S8
  2036. >0 byte 0x30 Linear D16
  2037. >0 byte 0x31 Linear F16
  2038. >0 byte 0x32 L16
  2039. >0 byte 0x33 V16U16
  2040. >0 byte 0x35 Linear L16
  2041. >0 byte 0x36 Linear V16U16
  2042. >0 byte 0x37 Linear L6V5U5
  2043. >0 byte 0x38 RGBA5551
  2044. >0 byte 0x39 RGBA4444
  2045. >0 byte 0x3A QWVU8888
  2046. >0 byte 0x3B BGRA8888
  2047. >0 byte 0x3C RGBA8888
  2048. >0 byte 0x3D Linear RGBA5551
  2049. >0 byte 0x3E Linear RGBA4444
  2050. >0 byte 0x3F Linear ABGR8888
  2051. >0 byte 0x40 Linear BGRA8888
  2052. >0 byte 0x41 Linear RGBA8888
  2053. >0 byte 0x64 Vertex Data
  2054. 0 string XPR0 Microsoft Xbox XPR0 texture
  2055. >0x19 byte x \b, format:
  2056. >>0x19 use xbox-xpr-pixel-format
  2057. # ILDA Image Data Transfer Format
  2058. # https://www.ilda.com/resources/StandardsDocs/ILDA_IDTF14_rev011.pdf
  2059. #
  2060. # Updated by Chuck Hein (laser@geekdude.com)
  2061. #
  2062. 0 string ILDA ILDA Image Data Transfer Format
  2063. >7 byte 0x00 3D Coordinates with Indexed Color
  2064. >7 byte 0x01 2D Coordinates with Indexed Color
  2065. >7 byte 0x02 Color Palette
  2066. >7 byte 0x04 3D Coordinates with True Color
  2067. >7 byte 0x05 2D Coordinates with True Color
  2068. >8 string >0 \b, palette %s
  2069. >16 string >0 \b, company %s
  2070. >24 beshort >0 \b, number of records %d
  2071. >>26 beshort x \b, palette number %d
  2072. >>28 beshort >0 \b, number of frames %d
  2073. >>30 byte >0 \b, projector number %d
  2074. # Dropbox "lepton" compressed jpeg format
  2075. # https://github.com/dropbox/lepton
  2076. 0 belong&0xfffff0ff 0xcf84005a Lepton image file
  2077. >2 byte x (version %d)