images 45 KB

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