images 45 KB

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