images 56 KB

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