2 #------------------------------------------------------------------------------
3 # $File: images,v 1.126 2017/06/11 22:25:44 christos Exp $
4 # images: file(1) magic for image formats (see also "iff", and "c-lang" for
7 # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
8 # additions by janl@ifi.uio.no as well as others. Jan also suggested
9 # merging several one- and two-line files into here.
11 # little magic: PCX (first byte is 0x0a)
13 # Targa - matches `povray', `ppmtotga' and `xv' outputs
14 # by Philippe De Muyter <phdm@macqel.be>
15 # URL: http://justsolve.archiveteam.org/wiki/TGA
16 # Reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
17 # Update: Joerg Jenderek
18 # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
19 # ,32 or 33 (both not observed)
20 # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
21 # or theoretically 2-128 reserved for use by Truevision or 128-255 may be used for developer applications
22 # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
23 # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
24 # `tgatoppm' recognizes a superset (Index may be anything)
26 # test of Color Map Type 0~no 1~color map
27 # and Image Type 1 2 3 9 10 11 32 33
28 # and Color Map Entry Size 0 15 16 24 32
29 0 ubequad&0x00FeC400000000C0 0
30 # skip more garbage by looking for positive image type
32 # skip some compiled terminfo by looking for image type less equal 33
34 # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel sizes 15 16 24 32
36 # skip more by looking for pixel size 0Fh 10h 18h 20h
37 >>>>16 ubyte&0xC0 0x00
39 >>>>>1 belong&0xfff7ffff 0x01010000
41 >>>>>1 belong&0xfff7ffff 0x00020000
43 >>>>>1 belong&0xfff7ffff 0x00030000
46 # skip 260-16.ico by looking for no color map
48 # implies no first map entry
50 >>>>>>>>0 use tga-image
51 # display tga bitmap image information
53 >2 ubyte <34 Targa image data
56 # normal extension .tga but some Truevision products used others:
57 # tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
58 !:ext tga/tpic/icb/vda/vst
59 # image type 1 2 3 9 10 11 32 33
63 >>17 ubyte&0x0F >0 \bA
64 >2 ubyte&0xF7 3 - Mono
65 # type not found, but by http://www.fileformat.info/format/tga/corion.htm
66 # Compressed color-mapped data, using Huffman, Delta, and runlength encoding
68 # Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
70 # Color Map Type 0~no 1~color map
72 # first color map entry, 0 normal
74 # color map length 0 2 1dh 3bh d9h 100h
76 # 8~run length encoding bit
78 # gimp can create big pictures!
80 >12 uleshort =0 65536 x
81 # image height. 0 interpreted as 65536
84 # Image Pixel Size 15 16 24 32
86 # X origin of image. 0 normal
88 # Y origin of image. 0 normal; positive for top
90 # Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
91 >17 ubyte&0x0F >0 - %d-bit alpha
92 # bits 5-4 give direction. normal bottom left
94 #>17 ubyte ^0x20 - bottom
95 >17 ubyte &0x10 - right
96 #>17 ubyte ^0x10 - left
97 # some info say other bits 6-7 should be zero
98 # but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
99 # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
100 #>17 ubyte&0xC0 0x00 - no interleave
101 >17 ubyte&0xC0 0x40 - interleave
102 >17 ubyte&0xC0 0x80 - four way interleave
103 >17 ubyte&0xC0 0xC0 - reserved
104 # positive length implies identification field
107 # last 18 bytes of newer tga file footer signature
108 >18 search/4261301/s TRUEVISION-XFILE.\0
109 # extension area offset if not 0
111 # length of the extension area. normal 495 for version 2.0
112 >>>(&-4.l) uleshort 0x01EF
114 >>>>&0 string >\0 - author "%-.40s"
115 # Comment[324]=4 * 80 null terminated
116 >>>>&41 string >\0 - comment "%-.80s"
118 >>>>&365 ubequad&0xffffFFFFffff0000 !0
120 >>>>>&-6 uleshort x %d
122 >>>>>&-8 uleshort x \b-%d
124 >>>>>&-4 uleshort x \b-%d
126 >>>>&371 ubequad&0xffffFFFFffff0000 !0
128 >>>>>&-8 uleshort x %d
130 >>>>>&-6 uleshort x \b:%.2d
132 >>>>>&-4 uleshort x \b:%.2d
134 >>>>&377 string >\0 - job "%-.40s"
135 # JobHour Jobminute Jobsecond
136 >>>>&418 ubequad&0xffffFFFFffff0000 !0
137 >>>>>&-8 uleshort x %d
138 >>>>>&-6 uleshort x \b:%.2d
139 >>>>>&-4 uleshort x \b:%.2d
141 >>>>&424 string >\0 - %-.40s
142 # SoftwareVersionNumber
144 >>>>>&40 uleshort/100 x %d
145 >>>>>&40 uleshort%100 x \b.%d
147 >>>>>&42 ubyte >0x20 \b%c
149 >>>>&468 ulelong >0 - keycolor 0x%8.8x
150 # Denominator of Pixel ratio. 0~no pixel aspect
153 >>>>>&-4 uleshort >0 - aspect %d
154 >>>>>&-2 uleshort x \b/%d
155 # Denominator of Gamma ratio. 0~no Gamma value
158 >>>>>&-4 uleshort >0 - gamma %d
159 >>>>>&-2 uleshort x \b/%d
161 #>>>>&480 ulelong x - col offset 0x%8.8x
163 #>>>>&484 ulelong x - stamp offset 0x%8.8x
165 #>>>>&488 ulelong x - scan offset 0x%8.8x
167 #>>>>&492 ubyte x - Attributes 0x%x
171 # The next byte following the magic is always whitespace.
172 # strength is changed to try these patterns before "x86 boot sector"
174 >3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
175 >>&0 regex =[0-9]{1,50} \b, size = %s x
176 >>>&0 regex =[0-9]{1,50} \b %s
179 >0 regex/4 P1[\040\t\f\r\n]
181 >>>0 string x \b, bitmap
183 !:mime image/x-portable-bitmap
186 >0 regex/4 P2[\040\t\f\r\n]
188 >>>0 string x \b, greymap
190 !:mime image/x-portable-greymap
193 >0 regex/4 P3[\040\t\f\r\n]
195 >>>0 string x \b, pixmap
197 !:mime image/x-portable-pixmap
200 >0 regex/4 P4[\040\t\f\r\n]
202 >>>0 string x \b, rawbits, bitmap
204 !:mime image/x-portable-bitmap
207 >0 regex/4 P5[\040\t\f\r\n]
209 >>>0 string x \b, rawbits, greymap
211 !:mime image/x-portable-greymap
214 >0 regex/4 P6[\040\t\f\r\n]
216 >>>0 string x \b, rawbits, pixmap
218 !:mime image/x-portable-pixmap
220 0 string P7 Netpbm PAM image file
221 !:mime image/x-portable-pixmap
223 # From: bryanh@giraffe-data.com (Bryan Henderson)
224 0 string \117\072 Solitaire Image Recorder format
225 >4 string \013 MGI Type 11
226 >4 string \021 MGI Type 17
227 0 string .MDA MicroDesign data
228 >21 byte 48 version 2
229 >21 byte 51 version 3
230 0 string .MDP MicroDesign page data
231 >21 byte 48 version 2
232 >21 byte 51 version 3
234 # NIFF (Navy Interchange File Format, a modification of TIFF) images
235 # [GRR: this *must* go before TIFF]
236 0 string IIN1 NIFF image data
239 # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
240 # (CIFF) file. These are apparently all little-endian.
241 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
242 # URL: http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
243 0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
244 !:mime image/x-canon-crw
245 >16 leshort x \b, version %d.
248 # Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
249 # number. Put this above the TIFF test to make sure we detect them.
250 # These are apparently all little-endian.
251 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
252 # URL: http://libopenraw.freedesktop.org/wiki/Canon_CR2
253 0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
254 !:mime image/x-canon-cr2
255 >10 byte x \b, version %d.
258 # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
259 # The second word of TIFF files is the TIFF version number, 42, which has
260 # never changed. The TIFF specification recommends testing for it.
261 0 string MM\x00\x2a TIFF image data, big-endian
263 >(4.L) use \^tiff_ifd
264 0 string II\x2a\x00 TIFF image data, little-endian
269 >0 leshort x \b, direntries=%d
279 >>>8 leshort x \b, width=%d
282 >>>8 leshort x \b, height=%d
285 >>8 leshort x \b, bps=%d
288 >>4 lelong 1 \b, compression=
289 >>>8 leshort 1 \bnone
290 >>>8 leshort 2 \bhuffman
291 >>>8 leshort 3 \bbi-level group 3
292 >>>8 leshort 4 \bbi-level group 4
294 >>>8 leshort 6 \bJPEG (old)
295 >>>8 leshort 7 \bJPEG
296 >>>8 leshort 8 \bdeflate
297 >>>8 leshort 9 \bJBIG, ITU-T T.85
298 >>>8 leshort 0xa \bJBIG, ITU-T T.43
299 >>>8 leshort 0x7ffe \bNeXT RLE 2-bit
300 >>>8 leshort 0x8005 \bPackBits (Macintosh RLE)
301 >>>8 leshort 0x8029 \bThunderscan RLE
302 >>>8 leshort 0x807f \bRasterPadding (CT or MP)
303 >>>8 leshort 0x8080 \bRLE (Line Work)
304 >>>8 leshort 0x8081 \bRLE (High-Res Cont-Tone)
305 >>>8 leshort 0x8082 \bRLE (Binary Line Work)
306 >>>8 leshort 0x80b2 \bDeflate (PKZIP)
307 >>>8 leshort 0x80b3 \bKodak DCS
308 >>>8 leshort 0x8765 \bJBIG
309 >>>8 leshort 0x8798 \bJPEG2000
310 >>>8 leshort 0x8799 \bNikon NEF Compressed
312 >>>>8 leshort x \b(unknown 0x%x)
314 >0 leshort 0x106 \b, PhotometricIntepretation=
316 >>8 leshort 0 \bWhiteIsZero
317 >>8 leshort 1 \bBlackIsZero
319 >>8 leshort 3 \bRGB Palette
320 >>8 leshort 4 \bTransparency Mask
322 >>8 leshort 6 \bYCbCr
323 >>8 leshort 8 \bCIELab
325 >>>8 leshort x \b(unknown=0x%x)
333 >>(8.l) string x \b, name=%s
337 >>(8.l) string x \b, description=%s
341 >>(8.l) string x \b, manufacturer=%s
345 >>(8.l) string x \b, model=%s
351 >0 leshort 0x112 \b, orientation=
352 >>8 leshort 1 \bupper-left
353 >>8 leshort 3 \blower-right
354 >>8 leshort 6 \bupper-right
355 >>8 leshort 8 \blower-left
356 >>8 leshort 9 \bundefined
358 >>>8 leshort x \b[*%d*]
362 >>8 lelong x \b, xresolution=%d
366 >>8 lelong x \b, yresolution=%d
370 >>8 leshort x \b, resolutionunit=%d
374 >>(8.l) string x \b, software=%s
378 >>(8.l) string x \b, datetime=%s
382 >>(8.l) string x \b, hostcomputer=%s
387 # PrimaryChromaticities
396 # ReferenceBlackWhite
401 >>(8.l) string x \b, copyright=%s
407 >0 leshort 0x8825 \b, GPS-Data
410 #>0 leshort x \b, unknown=0x%x
413 0 string MM\x00\x2b Big TIFF image data, big-endian
415 0 string II\x2b\x00 Big TIFF image data, little-endian
418 # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
419 # (Greg Roelofs, newt@uchicago.edu)
420 # (Albert Cahalan, acahalan@cs.uml.edu)
422 # 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
431 >9 byte 2 \b/color RGB,
433 >9 byte 4 gray+alpha,
434 >9 byte 6 \b/color RGBA,
435 #>10 byte 0 deflate/32K,
436 >12 byte 0 non-interlaced
437 >12 byte 1 interlaced
439 # Standard PNG image.
440 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
445 # Apple CgBI PNG image.
446 0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
447 >24 string \x00\x00\x00\x0DIHDR PNG image data (CgBI)
452 # possible GIF replacements; none yet released!
453 # (Greg Roelofs, newt@uchicago.edu)
455 # GRR 950115: this was mine ("Zip GIF"):
456 0 string GIF94z ZIF image (GIF+deflate alpha)
457 !:mime image/x-unknown
459 # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
461 0 string FGF95a FGF image (GIF+deflate beta)
462 !:mime image/x-unknown
464 # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
465 # (best; not yet implemented):
467 0 string PBF PBF image (deflate compression)
468 !:mime image/x-unknown
471 0 string GIF8 GIF image data
474 >4 string 7a \b, version 8%s,
475 >4 string 9a \b, version 8%s,
478 #>10 byte &0x80 color mapped,
479 #>10 byte&0x07 =0x00 2 colors
480 #>10 byte&0x07 =0x01 4 colors
481 #>10 byte&0x07 =0x02 8 colors
482 #>10 byte&0x07 =0x03 16 colors
483 #>10 byte&0x07 =0x04 32 colors
484 #>10 byte&0x07 =0x05 64 colors
485 #>10 byte&0x07 =0x06 128 colors
486 #>10 byte&0x07 =0x07 256 colors
488 # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
489 # 1 plane, no encoding.
490 0 string \361\0\100\273 CMU window manager raster image data
495 # Magick Image File Format
496 0 string id=ImageMagick MIFF image data
499 0 long 1123028772 Artisan image data
500 >4 long 1 \b, rectangular 24-bit
501 >4 long 2 \b, rectangular 8-bit with colormap
502 >4 long 3 \b, rectangular 32-bit (24-bit with matte)
504 # FIG (Facility for Interactive Generation of figures), an object-based format
505 0 search/1 #FIG FIG image text
506 >5 string x \b, version %.3s
509 0 string ARF_BEGARF PHIGS clear text archive
510 0 string @(#)SunPHIGS SunPHIGS
511 # version number follows, in the form m.n
512 >40 string SunBin binary
513 >32 string archive archive
515 # GKS (Graphics Kernel System)
516 0 string GKSM GKS Metafile
517 >24 string SunGKS \b, SunGKS
520 0 string BEGMF clear text Computer Graphics Metafile
522 # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
523 0 string yz MGR bitmap, modern format, 8-bit aligned
524 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
525 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
526 0 string yx MGR bitmap, modern format, squeezed
528 # Fuzzy Bitmap (FBM) images
529 0 string %bitmap\0 FBM image data
530 >30 long 0x31 \b, mono
531 >30 long 0x33 \b, color
534 1 string PC\ Research,\ Inc group 3 fax data
535 >29 byte 0 \b, normal resolution (204x98 DPI)
536 >29 byte 1 \b, fine resolution (204x196 DPI)
537 # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
538 0 string Sfff structured fax file
540 # From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
541 # most files with the extension .EPA and some with .BMP
542 0 string \x11\x06 Award BIOS Logo, 136 x 84
543 !:mime image/x-award-bioslogo
544 0 string \x11\x09 Award BIOS Logo, 136 x 126
545 !:mime image/x-award-bioslogo
546 #0 string \x07\x1f BIOS Logo corrupted?
547 # http://www.blackfiveservices.co.uk/awbmtools.shtml
548 # http://biosgfx.narod.ru/v3/
549 # http://biosgfx.narod.ru/abr-2/
551 >4 leshort <1981 Award BIOS bitmap
552 !:mime image/x-award-bmp
553 # image width is a multiple of 4
555 >>>4 leshort x \b, %d
557 >>4 leshort&0x0003 >0 \b,
558 >>>4 leshort&0x0003 =1
560 >>>4 leshort&0x0003 =2
562 >>>4 leshort&0x0003 =3
565 # at offset 8 starts imagedata followed by "RGB " marker
567 # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
568 # http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
569 # 28bitmap_information_header.29
571 >14 leshort 12 PC bitmap, OS/2 1.x format
572 !:mime image/x-ms-bmp
573 >>18 leshort x \b, %d x
575 >14 leshort 64 PC bitmap, OS/2 2.x format
576 !:mime image/x-ms-bmp
577 >>18 leshort x \b, %d x
579 >14 leshort 40 PC bitmap, Windows 3.x format
580 !:mime image/x-ms-bmp
581 >>18 lelong x \b, %d x
584 >14 leshort 124 PC bitmap, Windows 98/2000 and newer format
585 !:mime image/x-ms-bmp
586 >>18 lelong x \b, %d x
589 >14 leshort 108 PC bitmap, Windows 95/NT4 and newer format
590 !:mime image/x-ms-bmp
591 >>18 lelong x \b, %d x
594 >14 leshort 128 PC bitmap, Windows NT/2000 format
595 !:mime image/x-ms-bmp
596 >>18 lelong x \b, %d x
600 #0 string IC PC icon data
601 #0 string PI PC pointer image data
602 #0 string CI PC color icon data
603 #0 string CP PC color pointer image data
604 # Conflicts with other entries [BABYL]
605 #0 string BA PC bitmap array data
607 # XPM icons (Greg Roelofs, newt@uchicago.edu)
608 0 search/1 /*\ XPM\ */ X pixmap image text
611 # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
612 0 leshort 0xcc52 RLE image data,
615 >2 leshort >0 \b, lower left corner: %d
616 >4 leshort >0 \b, lower right corner: %d
617 >10 byte&0x1 =0x1 \b, clear first
618 >10 byte&0x2 =0x2 \b, no background
619 >10 byte&0x4 =0x4 \b, alpha channel
620 >10 byte&0x8 =0x8 \b, comment
621 >11 byte >0 \b, %d color channels
622 >12 byte >0 \b, %d bits per pixel
623 >13 byte >0 \b, %d color map channels
625 # image file format (Robert Potter, potter@cs.rochester.edu)
626 0 string Imagefile\ version- iff image data
627 # this adds the whole header (inc. version number), informative but longish
630 # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
631 0 belong 0x59a66a95 Sun raster image data
632 >4 belong >0 \b, %d x
634 >12 belong >0 %d-bit,
635 #>16 belong >0 %d bytes long,
636 >20 belong 0 old format,
637 #>20 belong 1 standard,
638 >20 belong 2 compressed,
642 >20 belong 0xffff reserved for testing,
643 >24 belong 0 no colormap
644 >24 belong 1 RGB colormap
645 >24 belong 2 raw colormap
646 #>28 belong >0 colormap is %d bytes long
648 # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
651 # http://reality.sgi.com/grafica/sgiimage.html
653 0 beshort 474 SGI image data
654 #>2 byte 0 \b, verbatim
656 #>3 byte 1 \b, normal precision
657 >3 byte 2 \b, high precision
658 >4 beshort x \b, %d-D
659 >6 beshort x \b, %d x
661 >10 beshort x \b, %d channel
663 >80 string >0 \b, "%s"
665 0 string IT01 FIT image data
670 0 string IT02 FIT image data
675 2048 string PCD_IPI Kodak Photo CD image pack file
676 >0xe02 byte&0x03 0x00 , landscape mode
677 >0xe02 byte&0x03 0x01 , portrait mode
678 >0xe02 byte&0x03 0x02 , landscape mode
679 >0xe02 byte&0x03 0x03 , portrait mode
680 0 string PCD_OPA Kodak Photo CD overview pack file
682 # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
683 # FITS is the Flexible Image Transport System, the de facto standard for
684 # data and image transfer, storage, etc., for the astronomical community.
685 # (FITS floating point formats are big-endian.)
686 0 string SIMPLE\ \ = FITS image data
687 >109 string 8 \b, 8-bit, character or unsigned binary integer
688 >108 string 16 \b, 16-bit, two's complement binary integer
689 >107 string \ 32 \b, 32-bit, two's complement binary integer
690 >107 string -32 \b, 32-bit, floating point, single precision
691 >107 string -64 \b, 64-bit, floating point, double precision
694 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
696 # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
699 0 beshort 0x1010 PEX Binary Archive
701 # DICOM medical imaging data
702 # URL: https://en.wikipedia.org/wiki/DICOM#Data_format
703 # Note: "dcm" is the official file name extension
704 # XnView mention also "dc3" and "acr" as file name extension
705 128 string DICM DICOM medical imaging data
706 !:mime application/dicom
709 # XWD - X Window Dump file.
710 # As described in /usr/X11R6/include/X11/XWDFile.h
711 # used by the xwd program.
712 # Bradford Castalia, idaeim, 1/01
713 # updated by Adam Buchbinder, 2/09
714 # The following assumes version 7 of the format; the first long is the length
715 # of the header, which is at least 25 4-byte longs, and the one at offset 8
716 # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
717 # which is a maximum of 32.
721 >>>4 belong 7 XWD X Window Dump image data
722 !:mime image/x-xwindowdump
723 >>>>100 string >\0 \b, "%s"
724 >>>>16 belong x \b, %dx
725 >>>>20 belong x \b%dx
728 # PDS - Planetary Data System
729 # These files use Parameter Value Language in the header section.
730 # Unfortunately, there is no certain magic, but the following
731 # strings have been found to be most likely.
732 0 string NJPL1I00 PDS (JPL) image data
733 2 string NJPL1I PDS (JPL) image data
734 0 string CCSD3ZF PDS (CCSD) image data
735 2 string CCSD3Z PDS (CCSD) image data
736 0 string PDS_ PDS image data
737 0 string LBLSIZE= PDS (VICAR) image data
739 # pM8x: ATARI STAD compressed bitmap format
741 # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
742 # p M 8 5/6 xx yy zz data...
743 # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
744 # bytes either run horizontally (pM85) or vertically (pM86). yy is the
745 # most frequent byte, xx and zz are runlength escape codes, where xx is
746 # used for runs of yy.
748 0 string pM85 Atari ST STAD bitmap image data (hor)
749 >5 byte 0x00 (white background)
750 >5 byte 0xFF (black background)
751 0 string pM86 Atari ST STAD bitmap image data (vert)
752 >5 byte 0x00 (white background)
753 >5 byte 0xFF (black background)
755 # Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
756 # http://www.atarimax.com/jindroush.atari.org/afmtatr.html
757 0 leshort 0x0296 Atari ATR image
760 # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
762 # SGI RICE image file <mpruett@sgi.com>
763 #0 beshort 0x5249 RICE image
772 #>10 beshort 1 4:2:2:4
774 #>10 beshort 3 4:4:4:4
776 #>12 beshort 2 CCIR601
781 # From: Dan Fandrich <dan@coneharvesters.com>
782 # updated by Joerg Jenderek at Feb 2013 by http://de.wikipedia.org/wiki/PCX
783 # http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
784 # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
785 # 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
786 0 ubelong&0xffF8fe00 0x0a000000
787 # for PCX bit depth > 0
789 # test for valid versions
794 >>>>1 ubyte 0 ver. 2.5 image data
795 >>>>1 ubyte 2 ver. 2.8 image data, with palette
796 >>>>1 ubyte 3 ver. 2.8 image data, without palette
797 >>>>1 ubyte 4 for Windows image data
798 >>>>1 ubyte 5 ver. 3.0 image data
799 >>>>4 uleshort x bounding box [%d,
800 >>>>6 uleshort x %d] -
801 >>>>8 uleshort x [%d,
802 >>>>10 uleshort x %d],
803 >>>>65 ubyte >1 %d planes each of
805 >>>>68 byte 1 colour,
806 >>>>68 byte 2 grayscale,
807 # this should not happen
808 >>>>68 default x image,
809 >>>>12 leshort >0 %d x
810 >>>>>14 uleshort x %d dpi,
811 >>>>2 byte 0 uncompressed
812 >>>>2 byte 1 RLE compressed
815 # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
816 0 string 8BPS Adobe Photoshop Image
817 !:mime image/vnd.adobe.photoshop
819 >18 belong x \b, %d x
822 >24 beshort 1 grayscale
823 >>12 beshort 2 with alpha
824 >24 beshort 2 indexed
829 >24 beshort 7 multichannel
830 >24 beshort 8 duotone
833 >>12 beshort x \b, %dx
835 >22 beshort x %d-bit channel
838 # XV thumbnail indicator (ThMO)
839 0 string P7\ 332 XV thumbnail image data
841 # NITF is defined by United States MIL-STD-2500A
842 0 string NITF National Imagery Transmission Format
843 >25 string >\0 dated %.14s
845 # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
846 # Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
847 # Update: Joerg Jenderek
848 # See http://fileformats.archiveteam.org/wiki/GEM_Raster
849 # For variations, also see:
850 # http://www.seasip.info/Gem/ff_img.html (Ventura)
851 # http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
852 # http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
853 # http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
860 # no example for NOSIG
863 # no example for HYPERPAINT
871 # no example or description
876 # version is 2 for some XIMG and 1 for all others
877 >0 beshort <0x0003 GEM
878 # http://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
880 # header_size 24 25 27 59 779 words for colored bitmaps
882 >>>16 string STTT\0\x10 STTT
883 >>>16 string TIMG\0 TIMG
884 # HYPERPAINT or NOSIG variant
886 >>>>2 beshort =24 NOSIG
887 >>>>2 beshort !24 HYPERPAINT
888 # NOSIG or XIMG variant
890 >>>>16 string !XIMG\0 NOSIG
891 >>16 string =XIMG\0 XIMG Image data
893 # to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
894 >>16 string !XIMG\0 Image data
896 # header_size is 9 for Ventura files and 8 for other GEM Paint files
897 >>2 beshort 9 (Ventura)
898 #>>2 beshort 8 (Paint)
902 >>4 beshort x %d planes,
903 # in tenths of a millimetre
905 >>10 beshort x %d pixelsize
906 # pattern_size 1-8. 2 for GEM Paint
907 >>6 beshort !2 \b, pattern size %d
909 # GEM Metafile (Wolfram Kleff)
910 0 lelong 0x0018FFFF GEM Metafile data
911 >4 leshort x version %d
914 # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
915 # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
917 0 string \0\nSMJPEG SMJPEG
918 >8 belong x %d.x data
919 # According to the specification you could find any number of _TXT
920 # headers here, but I can't think of any way of handling that. None of
921 # the SMJPEG files I tried it on used this feature. Even if such a
922 # file is encountered the output should still be reasonable.
924 >>24 beshort >0 %d Hz
927 >>28 string NONE uncompressed
928 # >>28 string APCM ADPCM compressed
931 # Help! Isn't there any way to avoid writing this part twice?
933 # >>>48 string JFIF JPEG
934 >>>40 belong >0 %d frames
935 >>>44 beshort >0 (%d x
938 # >>32 string JFIF JPEG
939 >>24 belong >0 %d frames
940 >>28 beshort >0 (%d x
943 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
945 # "thumbnail file" (icon)
946 # descended from "xv", but in use by other applications as well (Wolfram Kleff)
947 0 string P7\ 332 XV "thumbnail file" (icon) data
949 # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
950 0 string KiSS KISS/GS
953 >>8 leshort x %d colors
954 >>10 leshort x %d groups
962 # Webshots (www.webshots.com), by John Harrison
963 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
965 # Hercules DASD image files
966 # From Jan Jaeger <jj@septa.nl>
967 0 string CKD_P370 Hercules CKD DASD image file
968 >8 long x \b, %d heads per cylinder
969 >12 long x \b, track size %d bytes
970 >16 byte x \b, device type 33%2.2X
972 0 string CKD_C370 Hercules compressed CKD DASD image file
973 >8 long x \b, %d heads per cylinder
974 >12 long x \b, track size %d bytes
975 >16 byte x \b, device type 33%2.2X
977 0 string CKD_S370 Hercules CKD DASD shadow file
978 >8 long x \b, %d heads per cylinder
979 >12 long x \b, track size %d bytes
980 >16 byte x \b, device type 33%2.2X
982 # Squeak images and programs - etoffi@softhome.net
983 0 string \146\031\0\0 Squeak image data
984 0 search/1 'From\040Squeak Squeak program text
986 # partimage: file(1) magic for PartImage files (experimental, incomplete)
987 # Author: Hans-Joachim Baader <hjb@pro-linux.de>
988 0 string PaRtImAgE-VoLuMe PartImage
989 >0x0020 string 0.6.1 file version %s
990 >>0x0060 lelong >-1 volume %d
991 #>>0x0064 8 byte identifier
993 >>0x0200 string >\0 type %s
994 >>0x1400 string >\0 device %s,
995 >>0x1600 string >\0 original filename %s,
996 # Some fields omitted
997 >>0x2744 lelong 0 not compressed
998 >>0x2744 lelong 1 gzip compressed
999 >>0x2744 lelong 2 bzip2 compressed
1000 >>0x2744 lelong >2 compressed with unknown algorithm
1001 >0x0020 string >0.6.1 file version %s
1002 >0x0020 string <0.6.1 file version %s
1004 # DCX is multi-page PCX, using a simple header of up to 1024
1005 # offsets for the respective PCX components.
1006 # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
1007 0 lelong 987654321 DCX multi-page PCX image data
1009 # Simon Walton <simonw@matteworld.com>
1010 # Kodak Cineon format for scanned negatives
1011 # http://www.kodak.com/US/en/motion/support/dlad/
1012 0 lelong 0xd75f2a80 Cineon image data
1013 >200 belong >0 \b, %d x
1017 # Bio-Rad .PIC is an image format used by microscope control systems
1018 # and related image processing software used by biologists.
1019 # From: Vebjorn Ljosa <vebjorn@ljosa.com>
1020 # BOOL values are two-byte integers; use them to rule out false positives.
1021 # http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
1022 # Samples: http://www.loci.wisc.edu/software/sample-data
1025 >>54 leshort 12345 Bio-Rad .PIC Image File
1026 >>>0 leshort >0 %d x
1028 >>>4 leshort =1 1 image in file
1029 >>>4 leshort >1 %d images in file
1031 # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
1032 # The description of *.mrw format can be found at
1033 # http://www.dalibor.cz/minolta/raw_file_format.htm
1034 0 string \000MRM Minolta Dimage camera raw image data
1036 # Summary: DjVu image / document
1038 # Reference: http://djvu.org/docs/DjVu3Spec.djvu
1039 # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
1040 # Modified by (1): Abel Cheung <abelcheung@gmail.com>
1042 >12 string DJVM DjVu multiple page document
1043 !:mime image/vnd.djvu
1044 >12 string DJVU DjVu image or single page document
1045 !:mime image/vnd.djvu
1046 >12 string DJVI DjVu shared document
1047 !:mime image/vnd.djvu
1048 >12 string THUM DjVu page thumbnails
1049 !:mime image/vnd.djvu
1051 # Originally by Marc Espie
1052 # Modified by Robert Minsk <robertminsk at yahoo.com>
1053 # http://www.openexr.com/openexrfilelayout.pdf
1054 0 lelong 20000630 OpenEXR image data,
1056 >4 lelong&0x000000ff x version %d,
1057 >4 lelong ^0x00000200 storage: scanline
1058 >4 lelong &0x00000200 storage: tiled
1059 >8 search/0x1000 compression\0 \b, compression:
1068 >>&16 byte >7 unknown
1069 >8 search/0x1000 dataWindow\0 \b, dataWindow:
1072 >>&18 lelong x \b(%d
1074 >8 search/0x1000 displayWindow\0 \b, displayWindow:
1077 >>&18 lelong x \b(%d
1079 >8 search/0x1000 lineOrder\0 \b, lineOrder:
1080 >>&14 byte 0 increasing y
1081 >>&14 byte 1 decreasing y
1082 >>&14 byte 2 random y
1083 >>&14 byte >2 unknown
1085 # SMPTE Digital Picture Exchange Format, SMPTE DPX
1087 # ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
1088 # Moving-Picture Exchange (DPX), v1.0, 18 February 1994
1089 # Robert Minsk <robertminsk at yahoo.com>
1090 0 string SDPX DPX image data, big-endian,
1094 >>776 belong x \b%d,
1097 >>772 belong x \b%d,
1098 >768 beshort 0 left to right/top to bottom
1099 >768 beshort 1 right to left/top to bottom
1100 >768 beshort 2 left to right/bottom to top
1101 >768 beshort 3 right to left/bottom to top
1102 >768 beshort 4 top to bottom/left to right
1103 >768 beshort 5 top to bottom/right to left
1104 >768 leshort 6 bottom to top/left to right
1105 >768 leshort 7 bottom to top/right to left
1107 # From: Tom Hilinski <tom.hilinski@comcast.net>
1108 # http://www.unidata.ucar.edu/packages/netcdf/
1109 0 string CDF\001 NetCDF Data Format data
1111 #-----------------------------------------------------------------------
1112 # Hierarchical Data Format, used to facilitate scientific data exchange
1113 # specifications at http://hdf.ncsa.uiuc.edu/
1114 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
1115 !:mime application/x-hdf
1116 0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
1117 !:mime application/x-hdf
1118 512 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 512 bytes user block
1119 !:mime application/x-hdf
1120 1024 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 1k user block
1121 !:mime application/x-hdf
1122 2048 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 2k user block
1123 !:mime application/x-hdf
1124 4096 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) with 4k user block
1125 !:mime application/x-hdf
1128 # From: Tobias Burnus <burnus@net-b.de>
1129 # Xara (for a while: Corel Xara) is a graphic package, see
1130 # http://www.xara.com/ for Windows and as GPL application for Linux
1131 0 string XARA\243\243 Xara graphics file
1133 # http://www.cartesianinc.com/Tech/
1134 0 string CPC\262 Cartesian Perceptual Compression image
1137 # From Albert Cahalan <acahalan@gmail.com>
1138 # puredigital used it for the CVS disposable camcorder
1139 #8 lelong 4 ZBM bitmap image data
1143 # From Albert Cahalan <acahalan@gmail.com>
1144 # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
1145 0 string C565 OLPC firmware icon image data
1149 # Applied Images - Image files from Cytovision
1150 # Gustavo Junior Alves <gjalves@gjalves.com.br>
1151 0 string \xce\xda\xde\xfa Cytovision Metaphases file
1152 0 string \xed\xad\xef\xac Cytovision Karyotype file
1153 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
1154 0 string \xed\xfe\xda\xbe Cytovision FLEX file
1155 0 string \xed\xab\xed\xfe Cytovision FLEX file
1156 0 string \xad\xfd\xea\xad Cytovision RATS file
1158 # Wavelet Scalar Quantization format used in gray-scale fingerprint images
1159 # From Tano M Fotang <mfotang@quanteq.com>
1160 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
1162 # Type: PCO B16 image files
1163 # URL: http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
1164 # From: Florian Philipp <florian.philipp@binarywings.net>
1166 # Description: Pixel image format produced by PCO Camware, typically used
1167 # together with PCO cameras.
1168 # Note: Different versions exist for e.g. 8 bit and 16 bit images.
1169 # Documentation is incomplete.
1170 0 string/b PCO- PCO B16 image data
1171 >12 lelong x \b, %dx
1173 >20 lelong 0 \b, short header
1174 >20 lelong -1 \b, extended header
1175 >>24 lelong 0 \b, grayscale
1176 >>>36 lelong 0 linear LUT
1177 >>>36 lelong 1 logarithmic LUT
1179 >>>32 lelong x \b,%d]
1180 >>24 lelong 1 \b, color
1181 >>>64 lelong 0 linear LUT
1182 >>>64 lelong 1 logarithmic LUT
1184 >>>44 lelong x \b,%d]
1186 >>>52 lelong x \b,%d]
1188 >>>60 lelong x \b,%d]
1190 # Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
1191 # From: Markus Heidelberg <markus.heidelberg at web.de>
1192 0 string/t [BitmapInfo2] Polar Monitor Bitmap text
1193 !:mime image/x-polar-monitor-bitmap
1195 # From: Rick Richardson <rickrich@gmail.com>
1196 # updated by: Joerg Jenderek
1197 # URL: http://techmods.net/nuvi/
1198 0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
1199 # extension is also used for
1200 # Sony SRF raw image (image/x-sony-srf)
1202 # Terragen Surface Map (http://www.planetside.co.uk/terragen)
1203 # FileLocator Pro search criteria file (http://www.mythicsoft.com/filelocatorpro)
1205 #!:mime image/x-garmin-srf
1206 # version 1.00,2.00,2.10,2.40,2.50
1207 >0x2f string >0 \b, version %4.4s
1208 # width (2880,2881,3240)
1209 >0x55 uleshort >0 \b, %dx
1211 >>0x53 uleshort x \b%d
1213 # Type: Ulead Photo Explorer5 (.pe5)
1214 # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
1215 # From: Simon Horman <horms@debian.org>
1216 0 string IIO2H Ulead Photo Explorer5
1219 # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
1220 # From: Mathias Brodala <info@noctus.net>
1221 0 string Xcur X11 cursor
1223 # Type: Olympus ORF raw images.
1224 # URL: http://libopenraw.freedesktop.org/wiki/Olympus_ORF
1225 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
1226 0 string MMOR Olympus ORF raw image data, big-endian
1227 !:mime image/x-olympus-orf
1228 0 string IIRO Olympus ORF raw image data, little-endian
1229 !:mime image/x-olympus-orf
1230 0 string IIRS Olympus ORF raw image data, little-endian
1231 !:mime image/x-olympus-orf
1233 # Type: files used in modern AVCHD camcoders to store clip information
1235 # From: Alexander Danilov <alexander.a.danilov@gmail.com>
1236 0 string HDMV0100 AVCHD Clip Information
1238 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
1239 # URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
1240 # Radiance HDR; usually has .pic or .hdr extension.
1241 0 string #?RADIANCE\n Radiance HDR image data
1242 #!mime image/vnd.radiance
1244 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
1245 # URL: http://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
1246 # Used by the pfstools packages. The regex matches for the image size could
1247 # probably use some work. The MIME type is made up; if there's one in
1248 # actual common use, it should replace the one below.
1249 0 string PFS1\x0a PFS HDR image data
1251 >1 regex [0-9]*\ \b, %s
1252 >>1 regex \ [0-9]{4} \bx%s
1255 # URL: http://www.photofo.com/downloads/x3f-raw-format.pdf
1256 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
1257 # Note that the MIME type isn't defined anywhere that I can find; if
1258 # there's a canonical type for this format, it should replace this one.
1259 0 string FOVb Foveon X3F raw image data
1261 >6 leshort x \b, version %d.
1263 >28 lelong x \b, %dx
1267 # From Adam Buchbinder <adam.buchbinder@gmail.com>
1268 0 string PDN3 Paint.NET image data
1269 !:mime image/x-paintnet
1271 # Not really an image.
1272 # From: "Tano M. Fotang" <mfotang@quanteq.com>
1273 0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
1275 # doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
1276 # example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
1277 90 bequad 0x574D50484F544F00 JPEG-XR Image
1278 >98 byte&0x08 =0x08 \b, hard tiling
1279 >99 byte&0x80 =0x80 \b, tiling present
1280 >99 byte&0x40 =0x40 \b, codestream present
1281 >99 byte&0x38 x \b, spatial xform=
1282 >99 byte&0x38 0x00 \bTL
1283 >99 byte&0x38 0x08 \bBL
1284 >99 byte&0x38 0x10 \bTR
1285 >99 byte&0x38 0x18 \bBR
1286 >99 byte&0x38 0x20 \bBT
1287 >99 byte&0x38 0x28 \bRB
1288 >99 byte&0x38 0x30 \bLT
1289 >99 byte&0x38 0x38 \bLB
1290 >100 byte&0x80 =0x80 \b, short header
1291 >>102 beshort+1 x \b, %d
1292 >>104 beshort+1 x \bx%d
1293 >100 byte&0x80 =0x00 \b, long header
1294 >>102 belong+1 x \b, %x
1295 >>106 belong+1 x \bx%x
1296 >101 beshort&0xf x \b, bitdepth=
1297 >>101 beshort&0xf 0x0 \b1-WHITE=1
1298 >>101 beshort&0xf 0x1 \b8
1299 >>101 beshort&0xf 0x2 \b16
1300 >>101 beshort&0xf 0x3 \b16-SIGNED
1301 >>101 beshort&0xf 0x4 \b16-FLOAT
1302 >>101 beshort&0xf 0x5 \b(reserved 5)
1303 >>101 beshort&0xf 0x6 \b32-SIGNED
1304 >>101 beshort&0xf 0x7 \b32-FLOAT
1305 >>101 beshort&0xf 0x8 \b5
1306 >>101 beshort&0xf 0x9 \b10
1307 >>101 beshort&0xf 0xa \b5-6-5
1308 >>101 beshort&0xf 0xb \b(reserved %d)
1309 >>101 beshort&0xf 0xc \b(reserved %d)
1310 >>101 beshort&0xf 0xd \b(reserved %d)
1311 >>101 beshort&0xf 0xe \b(reserved %d)
1312 >>101 beshort&0xf 0xf \b1-BLACK=1
1313 >101 beshort&0xf0 x \b, colorfmt=
1314 >>101 beshort&0xf0 0x00 \bYONLY
1315 >>101 beshort&0xf0 0x10 \bYUV240
1316 >>101 beshort&0xf0 0x20 \bYWV422
1317 >>101 beshort&0xf0 0x30 \bYWV444
1318 >>101 beshort&0xf0 0x40 \bCMYK
1319 >>101 beshort&0xf0 0x50 \bCMYKDIRECT
1320 >>101 beshort&0xf0 0x60 \bNCOMPONENT
1321 >>101 beshort&0xf0 0x70 \bRGB
1322 >>101 beshort&0xf0 0x80 \bRGBE
1323 >>101 beshort&0xf0 >0x80 \b(reserved 0x%x)
1325 # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
1327 # BPG (Better Portable Graphics) format
1328 # http://bellard.org/bpg/
1329 # http://fileformats.archiveteam.org/wiki/BPG
1331 0 string \x42\x50\x47\xFB BPG (Better Portable Graphics)
1334 # From: Joerg Jenderek
1335 # URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
1336 0 string icns Mac OS X icon
1342 >>4 ubelong x \b, %d bytes
1344 >>8 string x \b, "%4.4s" type
1347 0 lelong 0x00000010 TIM image,
1348 >4 lelong 0x8 4-Bit,
1349 >4 lelong 0x9 8-Bit,
1350 >4 lelong 0x2 15-Bit,
1351 >4 lelong 0x3 24-Bit,
1353 >>(8.l+12) leshort x Pixel at (%d,
1354 >>(8.l+14) leshort x \b%d)
1355 >>(8.l+16) leshort x Size=%dx
1356 >>(8.l+18) leshort x \b%d,
1357 >>4 lelong 0x8 16 CLUT Entries at
1358 >>4 lelong 0x9 256 CLUT Entries at
1360 >>14 leshort x \b%d)
1362 >>12 leshort x Pixel at (%d,
1363 >>14 leshort x \b%d)
1364 >>16 leshort x Size=%dx
1368 0 lelong 0x80010160 MDEC video stream,
1371 #>8 lelong x %d frames
1372 #>4 leshort x secCount=%d;
1373 #>6 leshort x nSectors=%d;
1374 #>12 lelong x frameSize=%d;
1376 # BS encoded bitstreams
1377 2 leshort 0x3800 BS image,
1378 >6 leshort x Version %d,
1379 >4 leshort x Quantization %d,
1380 >0 leshort x (Decompresses to %d words)
1382 # Type: farbfeld image.
1383 # Url: http://tools.suckless.org/farbfeld/
1384 # From: Ian D. Scott <ian@iandouglasscott.com>
1386 0 string farbfeld farbfeld image data,
1390 # Type: Sega PVR image.
1391 # From: David Korth <gerbilsoft@gerbilsoft.com>
1393 # - http://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
1394 # - https://github.com/yazgoo/pvrx2png
1395 # - https://github.com/nickworonekin/puyotools
1398 0 name sega-pvr-image-header
1399 >0x0C leshort x %d x
1402 >0x08 byte 0 \b, ARGB1555
1403 >0x08 byte 1 \b, RGB565
1404 >0x08 byte 2 \b, ARGB4444
1405 >0x08 byte 3 \b, YUV442
1406 >0x08 byte 4 \b, Bump
1407 >0x08 byte 5 \b, 4bpp
1408 >0x08 byte 6 \b, 8bpp
1410 >0x09 byte 0x01 \b, square twiddled
1411 >0x09 byte 0x02 \b, square twiddled & mipmap
1412 >0x09 byte 0x03 \b, VQ
1413 >0x09 byte 0x04 \b, VQ & mipmap
1414 >0x09 byte 0x05 \b, 8-bit CLUT twiddled
1415 >0x09 byte 0x06 \b, 4-bit CLUT twiddled
1416 >0x09 byte 0x07 \b, 8-bit direct twiddled
1417 >0x09 byte 0x08 \b, 4-bit direct twiddled
1418 >0x09 byte 0x09 \b, rectangle
1419 >0x09 byte 0x0B \b, rectangular stride
1420 >0x09 byte 0x0D \b, rectangular twiddled
1421 >0x09 byte 0x10 \b, small VQ
1422 >0x09 byte 0x11 \b, small VQ & mipmap
1423 >0x09 byte 0x12 \b, square twiddled & mipmap
1425 # Sega PVR (Xbox) image header.
1426 # Contains an embedded DirectDraw surface instead of PVR data.
1427 0 name sega-pvr-xbox-dds-header
1434 >0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1435 >>0x20 use sega-pvr-xbox-dds-header
1436 >0x10 belong !0x44445320 Sega PVR image:
1437 >>0 use sega-pvr-image-header
1439 # Sega PVR image with GBIX.
1442 >>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1443 >>>0x20 use sega-pvr-xbox-dds-header
1444 >>0x10 belong !0x44445320 Sega PVR image:
1445 >>>0x10 use sega-pvr-image-header
1446 >>0x08 lelong x \b, global index = %u
1449 0 name sega-gvr-image-header
1450 >0x0C beshort x %d x
1452 # Image data format.
1455 >0x0B byte 2 \b, IA4
1456 >0x0B byte 3 \b, IA8
1457 >0x0B byte 4 \b, RGB565
1458 >0x0B byte 5 \b, RGB5A3
1459 >0x0B byte 6 \b, ARGB8888
1460 >0x0B byte 8 \b, CI4
1461 >0x0B byte 9 \b, CI8
1462 >0x0B byte 14 \b, DXT1
1465 0 string GVRT Sega GVR image:
1466 >0x10 use sega-gvr-image-header
1468 # Sega GVR image with GBIX.
1470 >0x10 string GVRT Sega GVR image:
1471 >>0x10 use sega-gvr-image-header
1472 >>0x08 belong x \b, global index = %u
1474 # Light Field Picture
1475 # Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
1476 # Typical file extensions: .lfp .lfr .lfx
1479 >4 belong 0x0D0A1A0A
1480 >12 belong 0x00000000 Lytro Light Field Picture
1481 >8 belong x \b, version %d