images 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #------------------------------------------------------------------------------
  2. # images: file(1) magic for image formats (see also "iff")
  3. #
  4. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  5. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  6. # merging several one- and two-line files into here.
  7. #
  8. # little magic: PCX (first byte is 0x0a)
  9. # Targa - matches `povray', `ppmtotga' and `xv' outputs
  10. # by Philippe De Muyter <phdm@macqel.be>
  11. # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
  12. # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
  13. # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
  14. # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
  15. # `tgatoppm' recognizes a superset (Index may be anything)
  16. 1 belong&0xfff7ffff 0x01010000 Targa image data - Map
  17. >2 byte&8 8 - RLE
  18. 1 belong&0xfff7ffff 0x00020000 Targa image data - RGB
  19. >2 byte&8 8 - RLE
  20. 1 belong&0xfff7ffff 0x00030000 Targa image data - Mono
  21. >2 byte&8 8 - RLE
  22. # PBMPLUS images
  23. # The next byte following the magic is always whitespace.
  24. 0 string P1 Netpbm PBM image text
  25. 0 string P2 Netpbm PGM image text
  26. 0 string P3 Netpbm PPM image text
  27. 0 string P4 Netpbm PBM "rawbits" image data
  28. 0 string P5 Netpbm PGM "rawbits" image data
  29. 0 string P6 Netpbm PPM "rawbits" image data
  30. 0 string P7 Netpbm PAM image file
  31. # From: bryanh@giraffe-data.com (Bryan Henderson)
  32. 0 string \117\072 Solitaire Image Recorder format
  33. >4 string \013 MGI Type 11
  34. >4 string \021 MGI Type 17
  35. 0 string .MDA MicroDesign data
  36. >21 byte 48 version 2
  37. >21 byte 51 version 3
  38. 0 string .MDP MicroDesign page data
  39. >21 byte 48 version 2
  40. >21 byte 51 version 3
  41. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  42. 0 string IIN1 NIFF image data
  43. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  44. # The second word of TIFF files is the TIFF version number, 42, which has
  45. # never changed. The TIFF specification recommends testing for it.
  46. 0 string MM\x00\x2a TIFF image data, big-endian
  47. 0 string II\x2a\x00 TIFF image data, little-endian
  48. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  49. # (Greg Roelofs, newt@uchicago.edu)
  50. # (Albert Cahalan, acahalan@cs.uml.edu)
  51. #
  52. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  53. #
  54. 0 string \x89PNG PNG image data,
  55. >4 belong !0x0d0a1a0a CORRUPTED,
  56. >4 belong 0x0d0a1a0a
  57. >>16 belong x %ld x
  58. >>20 belong x %ld,
  59. >>24 byte x %d-bit
  60. >>25 byte 0 grayscale,
  61. >>25 byte 2 \b/color RGB,
  62. >>25 byte 3 colormap,
  63. >>25 byte 4 gray+alpha,
  64. >>25 byte 6 \b/color RGBA,
  65. #>>26 byte 0 deflate/32K,
  66. >>28 byte 0 non-interlaced
  67. >>28 byte 1 interlaced
  68. 1 string PNG PNG image data, CORRUPTED
  69. # GIF
  70. 0 string GIF8 GIF image data
  71. >4 string 7a \b, version 8%s,
  72. >4 string 9a \b, version 8%s,
  73. >6 leshort >0 %hd x
  74. >8 leshort >0 %hd,
  75. #>10 byte &0x80 color mapped,
  76. #>10 byte&0x07 =0x00 2 colors
  77. #>10 byte&0x07 =0x01 4 colors
  78. #>10 byte&0x07 =0x02 8 colors
  79. #>10 byte&0x07 =0x03 16 colors
  80. #>10 byte&0x07 =0x04 32 colors
  81. #>10 byte&0x07 =0x05 64 colors
  82. #>10 byte&0x07 =0x06 128 colors
  83. #>10 byte&0x07 =0x07 256 colors
  84. # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
  85. # 1 plane, no encoding.
  86. 0 string \361\0\100\273 CMU window manager raster image data
  87. >4 lelong >0 %d x
  88. >8 lelong >0 %d,
  89. >12 lelong >0 %d-bit
  90. # Magick Image File Format
  91. 0 string id=ImageMagick MIFF image data
  92. # Artisan
  93. 0 long 1123028772 Artisan image data
  94. >4 long 1 \b, rectangular 24-bit
  95. >4 long 2 \b, rectangular 8-bit with colormap
  96. >4 long 3 \b, rectangular 32-bit (24-bit with matte)
  97. # FIG (Facility for Interactive Generation of figures), an object-based format
  98. 0 string #FIG FIG image text
  99. >5 string x \b, version %.3s
  100. # PHIGS
  101. 0 string ARF_BEGARF PHIGS clear text archive
  102. 0 string @(#)SunPHIGS SunPHIGS
  103. # version number follows, in the form m.n
  104. >40 string SunBin binary
  105. >32 string archive archive
  106. # GKS (Graphics Kernel System)
  107. 0 string GKSM GKS Metafile
  108. >24 string SunGKS \b, SunGKS
  109. # CGM image files
  110. 0 string BEGMF clear text Computer Graphics Metafile
  111. # XXX - questionable magic
  112. 0 beshort&0xffe0 0x0020 binary Computer Graphics Metafile
  113. 0 beshort 0x3020 character Computer Graphics Metafile
  114. # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  115. 0 string yz MGR bitmap, modern format, 8-bit aligned
  116. 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
  117. 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
  118. 0 string yx MGR bitmap, modern format, squeezed
  119. # Fuzzy Bitmap (FBM) images
  120. 0 string %bitmap\0 FBM image data
  121. >30 long 0x31 \b, mono
  122. >30 long 0x33 \b, color
  123. # facsimile data
  124. 1 string PC\ Research,\ Inc group 3 fax data
  125. >29 byte 0 \b, normal resolution (204x98 DPI)
  126. >29 byte 1 \b, fine resolution (204x196 DPI)
  127. # PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, newt@uchicago.edu)
  128. 0 string BM PC bitmap data
  129. >14 leshort 12 \b, OS/2 1.x format
  130. >>18 leshort x \b, %d x
  131. >>20 leshort x %d
  132. >14 leshort 64 \b, OS/2 2.x format
  133. >>18 leshort x \b, %d x
  134. >>20 leshort x %d
  135. >14 leshort 40 \b, Windows 3.x format
  136. >>18 lelong x \b, %d x
  137. >>22 lelong x %d x
  138. >>28 leshort x %d
  139. 0 string IC PC icon data
  140. 0 string PI PC pointer image data
  141. 0 string CI PC color icon data
  142. 0 string CP PC color pointer image data
  143. # Conflicts with other entries [BABYL]
  144. #0 string BA PC bitmap array data
  145. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  146. # note possible collision with C/REXX entry in c-lang; currently commented out
  147. 0 string /*\ XPM\ */ X pixmap image text
  148. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  149. 0 leshort 0xcc52 RLE image data,
  150. >6 leshort x %d x
  151. >8 leshort x %d
  152. >2 leshort >0 \b, lower left corner: %d
  153. >4 leshort >0 \b, lower right corner: %d
  154. >10 byte&0x1 =0x1 \b, clear first
  155. >10 byte&0x2 =0x2 \b, no background
  156. >10 byte&0x4 =0x4 \b, alpha channel
  157. >10 byte&0x8 =0x8 \b, comment
  158. >11 byte >0 \b, %d color channels
  159. >12 byte >0 \b, %d bits per pixel
  160. >13 byte >0 \b, %d color map channels
  161. # image file format (Robert Potter, potter@cs.rochester.edu)
  162. 0 string Imagefile\ version- iff image data
  163. # this adds the whole header (inc. version number), informative but longish
  164. >10 string >\0 %s
  165. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  166. 0 belong 0x59a66a95 Sun raster image data
  167. >4 belong >0 \b, %d x
  168. >8 belong >0 %d,
  169. >12 belong >0 %d-bit,
  170. #>16 belong >0 %d bytes long,
  171. >20 belong 0 old format,
  172. #>20 belong 1 standard,
  173. >20 belong 2 compressed,
  174. >20 belong 3 RGB,
  175. >20 belong 4 TIFF,
  176. >20 belong 5 IFF,
  177. >20 belong 0xffff reserved for testing,
  178. >24 belong 0 no colormap
  179. >24 belong 1 RGB colormap
  180. >24 belong 2 raw colormap
  181. #>28 belong >0 colormap is %d bytes long
  182. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  183. #
  184. # See
  185. # http://reality.sgi.com/grafica/sgiimage.html
  186. #
  187. 0 beshort 474 SGI image data
  188. #>2 byte 0 \b, verbatim
  189. >2 byte 1 \b, RLE
  190. #>3 byte 1 \b, normal precision
  191. >3 byte 2 \b, high precision
  192. >4 beshort x \b, %d-D
  193. >6 beshort x \b, %d x
  194. >8 beshort x %d
  195. >10 beshort x \b, %d channel
  196. >10 beshort !1 \bs
  197. >80 string >0 \b, "%s"
  198. 0 string IT01 FIT image data
  199. >4 belong x \b, %d x
  200. >8 belong x %d x
  201. >12 belong x %d
  202. #
  203. 0 string IT02 FIT image data
  204. >4 belong x \b, %d x
  205. >8 belong x %d x
  206. >12 belong x %d
  207. #
  208. 2048 string PCD_IPI Kodak Photo CD image pack file
  209. >0xe02 byte&0x03 0x00 , landscape mode
  210. >0xe02 byte&0x03 0x01 , portrait mode
  211. >0xe02 byte&0x03 0x02 , landscape mode
  212. >0xe02 byte&0x03 0x03 , portrait mode
  213. 0 string PCD_OPA Kodak Photo CD overview pack file
  214. # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  215. # FITS is the Flexible Image Transport System, the de facto standard for
  216. # data and image transfer, storage, etc., for the astronomical community.
  217. # (FITS floating point formats are big-endian.)
  218. 0 string SIMPLE\ \ = FITS image data
  219. >109 string 8 \b, 8-bit, character or unsigned binary integer
  220. >108 string 16 \b, 16-bit, two's complement binary integer
  221. >107 string \ 32 \b, 32-bit, two's complement binary integer
  222. >107 string -32 \b, 32-bit, floating point, single precision
  223. >107 string -64 \b, 64-bit, floating point, double precision
  224. # other images
  225. 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
  226. 0 string !! Bennet Yee's "face" format
  227. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  228. # stuff.
  229. #
  230. 0 beshort 0x1010 PEX Binary Archive
  231. # Visio drawings
  232. 03000 string Visio\ (TM)\ Drawing %s
  233. # Tgif files
  234. 0 string \%TGIF\ x Tgif file version %s
  235. # DICOM medical imaging data
  236. 128 string DICM DICOM medical imaging data
  237. # XWD - X-Windows Dump file.
  238. # As described in /usr/X11R6/include/X11/XWDFile.h
  239. # used by the xwd program.
  240. # Bradford Castalia, idaeim, 1/01
  241. 4 belong 7 XWD X-Windows Dump image data
  242. >100 string >\0 \b, "%s"
  243. >16 belong x \b, %dx
  244. >20 belong x \b%dx
  245. >12 belong x \b%d
  246. # PDS - Planetary Data System
  247. # These files use Parameter Value Language in the header section.
  248. # Unfortunately, there is no certain magic, but the following
  249. # strings have been found to be most likely.
  250. 0 string NJPL1I00 PDS (JPL) image data
  251. 2 string NJPL1I PDS (JPL) image data
  252. 0 string CCSD3ZF PDS (CCSD) image data
  253. 2 string CCSD3Z PDS (CCSD) image data
  254. 0 string PDS_ PDS image data
  255. 0 string LBLSIZE= PDS (VICAR) image data
  256. # pM8x: ATARI STAD compressed bitmap format
  257. #
  258. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  259. # p M 8 5/6 xx yy zz data...
  260. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  261. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  262. # most frequent byte, xx and zz are runlength escape codes, where xx is
  263. # used for runs of yy.
  264. #
  265. 0 string pM85 Atari ST STAD bitmap image data (hor)
  266. >5 byte 0x00 (white background)
  267. >5 byte 0xFF (black background)
  268. 0 string pM86 Atari ST STAD bitmap image data (vert)
  269. >5 byte 0x00 (white background)
  270. >5 byte 0xFF (black background)
  271. # XXX:
  272. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  273. # magic.
  274. # SGI RICE image file <mpruett@sgi.com>
  275. #0 beshort 0x5249 RICE image
  276. #>2 beshort x v%d
  277. #>4 beshort x (%d x
  278. #>6 beshort x %d)
  279. #>8 beshort 0 8 bit
  280. #>8 beshort 1 10 bit
  281. #>8 beshort 2 12 bit
  282. #>8 beshort 3 13 bit
  283. #>10 beshort 0 4:2:2
  284. #>10 beshort 1 4:2:2:4
  285. #>10 beshort 2 4:4:4
  286. #>10 beshort 3 4:4:4:4
  287. #>12 beshort 1 RGB
  288. #>12 beshort 2 CCIR601
  289. #>12 beshort 3 RP175
  290. #>12 beshort 4 YUV
  291. #------------------------------------------------------------------------------
  292. #
  293. # Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image file format
  294. # for the EPOC operating system, which is used with PDAs like those from Psion
  295. #
  296. # see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description
  297. # of various EPOC file formats
  298. 0 string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file