1226048Sobrien
268349Sobrien#------------------------------------------------------------------------------
3330569Sgordon# $File: images,v 1.126 2017/06/11 22:25:44 christos Exp $
4186690Sobrien# images:  file(1) magic for image formats (see also "iff", and "c-lang" for
5186690Sobrien# XPM bitmaps)
668349Sobrien#
768349Sobrien# originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
868349Sobrien# additions by janl@ifi.uio.no as well as others. Jan also suggested
968349Sobrien# merging several one- and two-line files into here.
1068349Sobrien#
1168349Sobrien# little magic: PCX (first byte is 0x0a)
1268349Sobrien
1368349Sobrien# Targa - matches `povray', `ppmtotga' and `xv' outputs
1468349Sobrien# by Philippe De Muyter <phdm@macqel.be>
15330569Sgordon# URL: http://justsolve.archiveteam.org/wiki/TGA
16330569Sgordon# Reference: http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
17330569Sgordon# Update: Joerg Jenderek
1868349Sobrien# at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
19330569Sgordon#	,32 or 33 (both not observed)
2068349Sobrien# at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
21330569Sgordon#	or theoretically 2-128 reserved for use by Truevision or 128-255 may be used for developer applications
2268349Sobrien# at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
2368349Sobrien# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
2468349Sobrien# `tgatoppm' recognizes a superset (Index may be anything)
25330569Sgordon#
26330569Sgordon# test of Color Map Type 0~no 1~color map
27330569Sgordon# and Image Type 1 2 3 9 10 11 32 33
28330569Sgordon# and Color Map Entry Size 0 15 16 24 32
29330569Sgordon0	ubequad&0x00FeC400000000C0	0
30330569Sgordon# skip more garbage by looking for positive image type
31330569Sgordon>2	ubyte			>0
32330569Sgordon# skip some compiled terminfo by looking for image type less equal 33
33330569Sgordon>>2	ubyte			<34
34330569Sgordon# skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel sizes 15 16 24 32
35330569Sgordon>>>16	ubyte			<33
36330569Sgordon# skip more by looking for pixel size 0Fh 10h 18h 20h
37330569Sgordon>>>>16	ubyte&0xC0		0x00
38330569Sgordon# Color Map
39330569Sgordon>>>>>1	belong&0xfff7ffff	0x01010000
40330569Sgordon>>>>>>0		use		tga-image
41330569Sgordon>>>>>1	belong&0xfff7ffff	0x00020000
42330569Sgordon>>>>>>0		use		tga-image
43330569Sgordon>>>>>1	belong&0xfff7ffff	0x00030000
44330569Sgordon>>>>>>0		use		tga-image
45330569Sgordon>>>>>1	default			x
46330569Sgordon# skip 260-16.ico by looking for no color map
47330569Sgordon>>>>>>1	ubyte			0
48330569Sgordon# implies no first map entry
49330569Sgordon>>>>>>>3	uleshort		0
50330569Sgordon>>>>>>>>0	use		tga-image
51330569Sgordon#	display tga bitmap image information
52330569Sgordon0	name				tga-image
53330569Sgordon>2	ubyte		<34		Targa image data
54330569Sgordon!:mime	image/x-tga
55330569Sgordon!:apple	????TPIC
56330569Sgordon# normal extension .tga but some Truevision products used others:
57330569Sgordon# tpic (Apple),icb (Image Capture Board),vda (Video Display Adapter),vst (NuVista),win (UNSURE about that)
58330569Sgordon!:ext	tga/tpic/icb/vda/vst
59330569Sgordon# image type 1 2 3 9 10 11 32 33
60330569Sgordon>2	ubyte&0xF7	1		- Map
61330569Sgordon>2	ubyte&0xF7	2		- RGB
62330569Sgordon# alpha channel
63330569Sgordon>>17	ubyte&0x0F	>0		\bA
64330569Sgordon>2	ubyte&0xF7	3		- Mono
65330569Sgordon# type not found, but by http://www.fileformat.info/format/tga/corion.htm
66330569Sgordon# Compressed color-mapped data, using Huffman, Delta, and runlength encoding
67330569Sgordon>2	ubyte		32		- Color
68330569Sgordon# Compressed color-mapped data, using Huffman, Delta, and RLE. 4-pass quadtree- type process
69330569Sgordon>2	ubyte		33		- Color
70330569Sgordon# Color Map Type 0~no 1~color map
71330569Sgordon>1	ubyte		1		(
72330569Sgordon# first color map entry, 0 normal
73330569Sgordon>>3	uleshort	>0		\b%d-
74330569Sgordon# color map length 0 2 1dh 3bh d9h 100h
75330569Sgordon>>5	uleshort	x		\b%d)
76330569Sgordon# 8~run length encoding bit
77330569Sgordon>2	ubyte&0x08	8		- RLE
78330569Sgordon# gimp can create big pictures!
79330569Sgordon>12	uleshort	>0		%d x
80330569Sgordon>12	uleshort	=0		65536 x
81330569Sgordon# image height. 0 interpreted as 65536
82330569Sgordon>14	uleshort	>0		%d
83330569Sgordon>14	uleshort	=0		65536
84330569Sgordon# Image Pixel Size 15 16 24 32
85330569Sgordon>16	ubyte		x		x %d
86330569Sgordon# X origin of image. 0 normal
87330569Sgordon>8	uleshort	>0		+%d
88330569Sgordon# Y origin of image. 0 normal; positive for top
89330569Sgordon>10	uleshort	>0		+%d
90330569Sgordon# Image descriptor: bits 3-0 give the alpha channel depth, bits 5-4 give direction
91330569Sgordon>17	ubyte&0x0F	>0		- %d-bit alpha
92330569Sgordon# bits 5-4 give direction. normal bottom left
93330569Sgordon>17	ubyte		&0x20		- top
94330569Sgordon#>17	ubyte		^0x20		- bottom
95330569Sgordon>17	ubyte		&0x10		- right
96330569Sgordon#>17	ubyte		^0x10		- left
97330569Sgordon# some info say other bits 6-7 should be zero
98330569Sgordon# but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
99330569Sgordon# 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
100330569Sgordon#>17	ubyte&0xC0	0x00		- no interleave
101330569Sgordon>17	ubyte&0xC0	0x40		- interleave
102330569Sgordon>17	ubyte&0xC0	0x80		- four way interleave
103330569Sgordon>17	ubyte&0xC0	0xC0		- reserved
104330569Sgordon# positive length implies identification field
105330569Sgordon>0	ubyte		>0
106330569Sgordon>>18	string		x		"%s"
107330569Sgordon# last 18 bytes of newer tga file footer signature
108330569Sgordon>18	search/4261301/s	TRUEVISION-XFILE.\0
109330569Sgordon# extension area offset if not 0
110330569Sgordon>>&-8		ulelong			>0
111330569Sgordon# length of the extension area. normal 495 for version 2.0
112330569Sgordon>>>(&-4.l)	uleshort		0x01EF
113330569Sgordon# AuthorName[41]
114330569Sgordon>>>>&0		string			>\0		- author "%-.40s"
115330569Sgordon# Comment[324]=4 * 80 null terminated
116330569Sgordon>>>>&41		string			>\0		- comment "%-.80s"
117330569Sgordon# date
118330569Sgordon>>>>&365	ubequad&0xffffFFFFffff0000	!0
119330569Sgordon# Day
120330569Sgordon>>>>>&-6		uleshort		x		%d
121330569Sgordon# Month
122330569Sgordon>>>>>&-8		uleshort		x		\b-%d
123330569Sgordon# Year
124330569Sgordon>>>>>&-4		uleshort		x		\b-%d
125330569Sgordon# time
126330569Sgordon>>>>&371	ubequad&0xffffFFFFffff0000	!0
127330569Sgordon# hour
128330569Sgordon>>>>>&-8		uleshort		x		%d
129330569Sgordon# minutes
130330569Sgordon>>>>>&-6		uleshort		x		\b:%.2d
131330569Sgordon# second
132330569Sgordon>>>>>&-4		uleshort		x		\b:%.2d
133330569Sgordon# JobName[41]
134330569Sgordon>>>>&377		string			>\0		- job "%-.40s"
135330569Sgordon# JobHour Jobminute Jobsecond
136330569Sgordon>>>>&418	ubequad&0xffffFFFFffff0000	!0
137330569Sgordon>>>>>&-8		uleshort		x		%d
138330569Sgordon>>>>>&-6		uleshort		x		\b:%.2d
139330569Sgordon>>>>>&-4		uleshort		x		\b:%.2d
140330569Sgordon# SoftwareId[41]
141330569Sgordon>>>>&424		string			>\0		- %-.40s
142330569Sgordon# SoftwareVersionNumber
143330569Sgordon>>>>&424	ubyte				>0
144330569Sgordon>>>>>&40		uleshort/100		x		%d
145330569Sgordon>>>>>&40		uleshort%100		x		\b.%d
146330569Sgordon# VersionLetter
147330569Sgordon>>>>>&42		ubyte			>0x20		\b%c
148330569Sgordon# KeyColor
149330569Sgordon>>>>&468		ulelong			>0		- keycolor 0x%8.8x
150330569Sgordon# Denominator of Pixel ratio. 0~no pixel aspect
151330569Sgordon>>>>&474	uleshort			>0
152330569Sgordon# Numerator
153330569Sgordon>>>>>&-4		uleshort		>0		- aspect %d
154330569Sgordon>>>>>&-2		uleshort		x		\b/%d
155330569Sgordon# Denominator of Gamma ratio. 0~no Gamma value
156330569Sgordon>>>>&478	uleshort			>0
157330569Sgordon# Numerator
158330569Sgordon>>>>>&-4		uleshort		>0		- gamma %d
159330569Sgordon>>>>>&-2		uleshort		x		\b/%d
160330569Sgordon# ColorOffset
161330569Sgordon#>>>>&480	ulelong			x		- col offset 0x%8.8x
162330569Sgordon# StampOffset
163330569Sgordon#>>>>&484	ulelong			x		- stamp offset 0x%8.8x
164330569Sgordon# ScanOffset
165330569Sgordon#>>>>&488	ulelong			x		- scan offset 0x%8.8x
166330569Sgordon# AttributesType
167330569Sgordon#>>>>&492	ubyte			x		- Attributes 0x%x
168330569Sgordon## EndOfTGA
16968349Sobrien
17068349Sobrien# PBMPLUS images
17168349Sobrien# The next byte following the magic is always whitespace.
172267843Sdelphij# strength is changed to try these patterns before "x86 boot sector"
173284778Sdelphij0	name		netpbm
174290152Sdelphij>3	regex/s		=[0-9]{1,50}\ [0-9]{1,50}	Netpbm image data
175284778Sdelphij>>&0	regex		=[0-9]{1,50} 			\b, size = %s x
176284778Sdelphij>>>&0	regex		=[0-9]{1,50}			\b %s
177284778Sdelphij
178330569Sgordon0	search/1	P1
179330569Sgordon>0	regex/4		P1[\040\t\f\r\n]
180330569Sgordon>>0	use		netpbm
181330569Sgordon>>>0	string		x	\b, bitmap
182267843Sdelphij!:strength + 45
183186690Sobrien!:mime	image/x-portable-bitmap
184284778Sdelphij
185330569Sgordon0	search/1	P2
186330569Sgordon>0	regex/4		P2[\040\t\f\r\n]
187330569Sgordon>>0	use		netpbm
188330569Sgordon>>>0	string		x	\b, greymap
189267843Sdelphij!:strength + 45
190186690Sobrien!:mime	image/x-portable-greymap
191284778Sdelphij
192267843Sdelphij0	search/1	P3
193330569Sgordon>0	regex/4		P3[\040\t\f\r\n]
194330569Sgordon>>0	use		netpbm
195330569Sgordon>>>0	string		x	\b, pixmap
196267843Sdelphij!:strength + 45
197186690Sobrien!:mime	image/x-portable-pixmap
198284778Sdelphij
199330569Sgordon0	string		P4
200330569Sgordon>0	regex/4		P4[\040\t\f\r\n]
201330569Sgordon>>0	use		netpbm
202330569Sgordon>>>0	string		x	\b, rawbits, bitmap
203267843Sdelphij!:strength + 45
204186690Sobrien!:mime	image/x-portable-bitmap
205284778Sdelphij
206330569Sgordon0	string		P5
207330569Sgordon>0	regex/4		P5[\040\t\f\r\n]
208330569Sgordon>>0	use		netpbm
209330569Sgordon>>>0	string		x	\b, rawbits, greymap
210267843Sdelphij!:strength + 45
211186690Sobrien!:mime	image/x-portable-greymap
212284778Sdelphij
213330569Sgordon0	string		P6
214330569Sgordon>0	regex/4		P6[\040\t\f\r\n]
215330569Sgordon>>0	use		netpbm
216330569Sgordon>>>0	string		x	\b, rawbits, pixmap
217267843Sdelphij!:strength + 45
218186690Sobrien!:mime	image/x-portable-pixmap
219284778Sdelphij
22069216Sobrien0	string		P7		Netpbm PAM image file
221186690Sobrien!:mime	image/x-portable-pixmap
22268349Sobrien
22369216Sobrien# From: bryanh@giraffe-data.com (Bryan Henderson)
22469216Sobrien0	string		\117\072	Solitaire Image Recorder format
22569216Sobrien>4	string		\013		MGI Type 11
22669216Sobrien>4	string		\021		MGI Type 17
22769216Sobrien0	string		.MDA		MicroDesign data
22869216Sobrien>21	byte		48		version 2
22969216Sobrien>21	byte		51		version 3
23069216Sobrien0	string		.MDP		MicroDesign page data
23169216Sobrien>21	byte		48		version 2
23269216Sobrien>21	byte		51		version 3
23369216Sobrien
23468349Sobrien# NIFF (Navy Interchange File Format, a modification of TIFF) images
235186690Sobrien# [GRR:  this *must* go before TIFF]
23668349Sobrien0	string		IIN1		NIFF image data
237186690Sobrien!:mime	image/x-niff
23868349Sobrien
239226048Sobrien# Canon RAW version 1 (CRW) files are a type of Canon Image File Format
240226048Sobrien# (CIFF) file. These are apparently all little-endian.
241226048Sobrien# From: Adam Buchbinder <adam.buchbinder@gmail.com>
242226048Sobrien# URL: http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
243226048Sobrien0	string		II\x1a\0\0\0HEAPCCDR	Canon CIFF raw image data
244226048Sobrien!:mime	image/x-canon-crw
245226048Sobrien>16	leshort		x	\b, version %d.
246226048Sobrien>14	leshort		x	\b%d
247226048Sobrien
248226048Sobrien# Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
249226048Sobrien# number. Put this above the TIFF test to make sure we detect them.
250226048Sobrien# These are apparently all little-endian.
251226048Sobrien# From: Adam Buchbinder <adam.buchbinder@gmail.com>
252226048Sobrien# URL: http://libopenraw.freedesktop.org/wiki/Canon_CR2
253226048Sobrien0	string		II\x2a\0\x10\0\0\0CR	Canon CR2 raw image data
254226048Sobrien!:mime	image/x-canon-cr2
255226048Sobrien>10	byte		x	\b, version %d.
256226048Sobrien>11	byte		x	\b%d
257226048Sobrien
25868349Sobrien# Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
25968349Sobrien# The second word of TIFF files is the TIFF version number, 42, which has
26068349Sobrien# never changed.  The TIFF specification recommends testing for it.
26168349Sobrien0	string		MM\x00\x2a	TIFF image data, big-endian
262186690Sobrien!:mime	image/tiff
263277592Sdelphij>(4.L)	use		\^tiff_ifd
26468349Sobrien0	string		II\x2a\x00	TIFF image data, little-endian
265186690Sobrien!:mime	image/tiff
266276415Sdelphij>(4.l)	use		tiff_ifd
26768349Sobrien
268276415Sdelphij0	name		tiff_ifd
269276415Sdelphij>0	leshort		x		\b, direntries=%d
270276415Sdelphij>2	use		tiff_entry
271276415Sdelphij
272276415Sdelphij0	name		tiff_entry
273277592Sdelphij# NewSubFileType
274277592Sdelphij>0	leshort		0xfe
275277592Sdelphij>>12	use		tiff_entry
276276415Sdelphij>0	leshort		0x100
277276415Sdelphij>>4	lelong		1
278276415Sdelphij>>>12	use		tiff_entry
279277592Sdelphij>>>8	leshort		x		\b, width=%d
280276415Sdelphij>0	leshort		0x101
281276415Sdelphij>>4	lelong		1
282277592Sdelphij>>>8	leshort		x		\b, height=%d
283276415Sdelphij>>>12	use		tiff_entry
284276415Sdelphij>0	leshort		0x102
285277592Sdelphij>>8	leshort		x		\b, bps=%d
286276415Sdelphij>>12	use		tiff_entry
287276415Sdelphij>0	leshort		0x103
288276415Sdelphij>>4	lelong		1		\b, compression=
289277592Sdelphij>>>8	leshort		1		\bnone
290277592Sdelphij>>>8	leshort		2		\bhuffman
291277592Sdelphij>>>8	leshort		3		\bbi-level group 3
292277592Sdelphij>>>8	leshort		4		\bbi-level group 4
293277592Sdelphij>>>8	leshort		5		\bLZW
294277592Sdelphij>>>8	leshort		6		\bJPEG (old)
295277592Sdelphij>>>8	leshort		7		\bJPEG
296277592Sdelphij>>>8	leshort		8		\bdeflate
297277592Sdelphij>>>8	leshort		9		\bJBIG, ITU-T T.85
298277592Sdelphij>>>8	leshort		0xa		\bJBIG, ITU-T T.43
299277592Sdelphij>>>8	leshort		0x7ffe		\bNeXT RLE 2-bit
300277592Sdelphij>>>8	leshort		0x8005		\bPackBits (Macintosh RLE)
301277592Sdelphij>>>8	leshort		0x8029		\bThunderscan RLE
302277592Sdelphij>>>8	leshort		0x807f		\bRasterPadding (CT or MP)
303277592Sdelphij>>>8	leshort		0x8080		\bRLE (Line Work)
304277592Sdelphij>>>8	leshort		0x8081		\bRLE (High-Res Cont-Tone)
305277592Sdelphij>>>8	leshort		0x8082		\bRLE (Binary Line Work)
306277592Sdelphij>>>8	leshort		0x80b2		\bDeflate (PKZIP)
307277592Sdelphij>>>8	leshort		0x80b3		\bKodak DCS
308277592Sdelphij>>>8	leshort		0x8765		\bJBIG
309277592Sdelphij>>>8	leshort		0x8798		\bJPEG2000
310277592Sdelphij>>>8	leshort		0x8799		\bNikon NEF Compressed
311330569Sgordon>>>8	default		x
312277592Sdelphij>>>>8	leshort		x		\b(unknown 0x%x)
313276415Sdelphij>>>12	use		tiff_entry
314276415Sdelphij>0	leshort		0x106		\b, PhotometricIntepretation=
315284778Sdelphij>>8	clear		x
316277592Sdelphij>>8	leshort		0		\bWhiteIsZero
317277592Sdelphij>>8	leshort		1		\bBlackIsZero
318277592Sdelphij>>8	leshort		2		\bRGB
319277592Sdelphij>>8	leshort		3		\bRGB Palette
320277592Sdelphij>>8	leshort		4		\bTransparency Mask
321277592Sdelphij>>8	leshort		5		\bCMYK
322277592Sdelphij>>8	leshort		6		\bYCbCr
323277592Sdelphij>>8	leshort		8		\bCIELab
324284778Sdelphij>>8	default		x
325277592Sdelphij>>>8	leshort		x		\b(unknown=0x%x)
326276415Sdelphij>>12	use		tiff_entry
327276415Sdelphij# FillOrder
328276415Sdelphij>0	leshort		0x10a
329276415Sdelphij>>4	lelong		1
330276415Sdelphij>>>12	use		tiff_entry
331276415Sdelphij# DocumentName
332276415Sdelphij>0	leshort		0x10d
333276415Sdelphij>>(8.l)	string		x		\b, name=%s
334276415Sdelphij>>>12	use		tiff_entry
335276415Sdelphij# ImageDescription
336276415Sdelphij>0	leshort		0x10e
337276415Sdelphij>>(8.l)	string		x		\b, description=%s
338276415Sdelphij>>>12	use		tiff_entry
339277592Sdelphij# Make
340277592Sdelphij>0	leshort		0x10f
341277592Sdelphij>>(8.l)	string		x		\b, manufacturer=%s
342277592Sdelphij>>>12	use		tiff_entry
343277592Sdelphij# Model
344277592Sdelphij>0	leshort		0x110
345277592Sdelphij>>(8.l)	string		x		\b, model=%s
346277592Sdelphij>>>12	use		tiff_entry
347276415Sdelphij# StripOffsets
348276415Sdelphij>0	leshort		0x111
349276415Sdelphij>>12	use		tiff_entry
350277592Sdelphij# Orientation
351277592Sdelphij>0	leshort		0x112		\b, orientation=
352277592Sdelphij>>8	leshort		1		\bupper-left
353277592Sdelphij>>8	leshort		3		\blower-right
354277592Sdelphij>>8	leshort		6		\bupper-right
355277592Sdelphij>>8	leshort		8		\blower-left
356277592Sdelphij>>8	leshort		9		\bundefined
357277592Sdelphij>>8	default		x
358277592Sdelphij>>>8	leshort		x		\b[*%d*]
359276415Sdelphij>>12	use		tiff_entry
360277592Sdelphij# XResolution
361277592Sdelphij>0	leshort		0x11a
362277592Sdelphij>>8	lelong		x		\b, xresolution=%d
363277592Sdelphij>>12	use		tiff_entry
364277592Sdelphij# YResolution
365277592Sdelphij>0	leshort		0x11b
366277592Sdelphij>>8	lelong		x		\b, yresolution=%d
367277592Sdelphij>>12	use		tiff_entry
368277592Sdelphij# ResolutionUnit
369277592Sdelphij>0	leshort		0x128
370277592Sdelphij>>8	leshort		x		\b, resolutionunit=%d
371277592Sdelphij>>12	use		tiff_entry
372277592Sdelphij# Software
373277592Sdelphij>0	leshort		0x131
374277592Sdelphij>>(8.l)	string		x		\b, software=%s
375277592Sdelphij>>12	use		tiff_entry
376276415Sdelphij# Datetime
377276415Sdelphij>0	leshort		0x132
378276415Sdelphij>>(8.l)	string		x		\b, datetime=%s
379277592Sdelphij>>12	use		tiff_entry
380276415Sdelphij# HostComputer
381276415Sdelphij>0	leshort		0x13c
382276415Sdelphij>>(8.l)	string		x		\b, hostcomputer=%s
383277592Sdelphij>>12	use		tiff_entry
384277592Sdelphij# WhitePoint
385277592Sdelphij>0	leshort		0x13e
386277592Sdelphij>>12	use		tiff_entry
387277592Sdelphij# PrimaryChromaticities
388277592Sdelphij>0	leshort		0x13f
389277592Sdelphij>>12	use		tiff_entry
390277592Sdelphij# YCbCrCoefficients
391277592Sdelphij>0	leshort		0x211
392277592Sdelphij>>12	use		tiff_entry
393277592Sdelphij# YCbCrPositioning
394277592Sdelphij>0	leshort		0x213
395277592Sdelphij>>12	use		tiff_entry
396277592Sdelphij# ReferenceBlackWhite
397277592Sdelphij>0	leshort		0x214
398277592Sdelphij>>12	use		tiff_entry
399277592Sdelphij# Copyright
400277592Sdelphij>0	leshort		0x8298
401277592Sdelphij>>(8.l)	string		x		\b, copyright=%s
402277592Sdelphij>>12	use		tiff_entry
403277592Sdelphij# ExifOffset
404277592Sdelphij>0	leshort		0x8769
405277592Sdelphij>>12	use		tiff_entry
406277592Sdelphij# GPS IFD
407277592Sdelphij>0	leshort		0x8825		\b, GPS-Data
408277592Sdelphij>>12	use		tiff_entry
409277592Sdelphij
410276415Sdelphij#>0	leshort		x		\b, unknown=0x%x
411277592Sdelphij#>>12	use		tiff_entry
412276415Sdelphij
413234250Sobrien0	string		MM\x00\x2b	Big TIFF image data, big-endian
414234250Sobrien!:mime	image/tiff
415234250Sobrien0	string		II\x2b\x00	Big TIFF image data, little-endian
416234250Sobrien!:mime	image/tiff
417234250Sobrien
41868349Sobrien# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
41968349Sobrien# (Greg Roelofs, newt@uchicago.edu)
42068349Sobrien# (Albert Cahalan, acahalan@cs.uml.edu)
42168349Sobrien#
422330569Sgordon# 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
42368349Sobrien#
424330569Sgordon
425330569Sgordon# IHDR parser
426330569Sgordon0	name		png-ihdr
427330569Sgordon>0	belong		x		\b, %d x
428330569Sgordon>4	belong		x		%d,
429330569Sgordon>8	byte		x		%d-bit
430330569Sgordon>9	byte		0		grayscale,
431330569Sgordon>9	byte		2		\b/color RGB,
432330569Sgordon>9	byte		3		colormap,
433330569Sgordon>9	byte		4		gray+alpha,
434330569Sgordon>9	byte		6		\b/color RGBA,
435330569Sgordon#>10	byte		0		deflate/32K,
436330569Sgordon>12	byte		0		non-interlaced
437330569Sgordon>12	byte		1		interlaced
438330569Sgordon
439330569Sgordon# Standard PNG image.
440330569Sgordon0	string		\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR	PNG image data
441186690Sobrien!:mime	image/png
442330569Sgordon!:strength +10
443330569Sgordon>16	use		png-ihdr
44468349Sobrien
445330569Sgordon# Apple CgBI PNG image.
446330569Sgordon0	string		\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
447330569Sgordon>24	string  	\x00\x00\x00\x0DIHDR	PNG image data (CgBI)
448330569Sgordon!:mime	image/png
449330569Sgordon!:strength +10
450330569Sgordon>>32	use		png-ihdr
451330569Sgordon
452186690Sobrien# possible GIF replacements; none yet released!
453186690Sobrien# (Greg Roelofs, newt@uchicago.edu)
454186690Sobrien#
455186690Sobrien# GRR 950115:  this was mine ("Zip GIF"):
456186690Sobrien0	string		GIF94z		ZIF image (GIF+deflate alpha)
457186690Sobrien!:mime	image/x-unknown
458186690Sobrien#
459186690Sobrien# GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
460330569Sgordon#
461186690Sobrien0	string		FGF95a		FGF image (GIF+deflate beta)
462186690Sobrien!:mime	image/x-unknown
463186690Sobrien#
464186690Sobrien# GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
465186690Sobrien# (best; not yet implemented):
466330569Sgordon#
467186690Sobrien0	string		PBF		PBF image (deflate compression)
468186690Sobrien!:mime	image/x-unknown
469186690Sobrien
47068349Sobrien# GIF
47168349Sobrien0	string		GIF8		GIF image data
472186690Sobrien!:mime	image/gif
473191736Sobrien!:apple	8BIMGIFf
47468349Sobrien>4	string		7a		\b, version 8%s,
47568349Sobrien>4	string		9a		\b, version 8%s,
476267843Sdelphij>6	leshort		>0		%d x
477267843Sdelphij>8	leshort		>0		%d
47868349Sobrien#>10	byte		&0x80		color mapped,
47968349Sobrien#>10	byte&0x07	=0x00		2 colors
48068349Sobrien#>10	byte&0x07	=0x01		4 colors
48168349Sobrien#>10	byte&0x07	=0x02		8 colors
48268349Sobrien#>10	byte&0x07	=0x03		16 colors
48368349Sobrien#>10	byte&0x07	=0x04		32 colors
48468349Sobrien#>10	byte&0x07	=0x05		64 colors
48568349Sobrien#>10	byte&0x07	=0x06		128 colors
48668349Sobrien#>10	byte&0x07	=0x07		256 colors
48768349Sobrien
48868349Sobrien# ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
48968349Sobrien# 1 plane, no encoding.
49068349Sobrien0	string		\361\0\100\273	CMU window manager raster image data
49168349Sobrien>4	lelong		>0		%d x
49268349Sobrien>8	lelong		>0		%d,
49368349Sobrien>12	lelong		>0		%d-bit
49468349Sobrien
49568349Sobrien# Magick Image File Format
49668349Sobrien0	string		id=ImageMagick	MIFF image data
49768349Sobrien
49868349Sobrien# Artisan
49968349Sobrien0	long		1123028772	Artisan image data
50068349Sobrien>4	long		1		\b, rectangular 24-bit
50168349Sobrien>4	long		2		\b, rectangular 8-bit with colormap
50268349Sobrien>4	long		3		\b, rectangular 32-bit (24-bit with matte)
50368349Sobrien
50468349Sobrien# FIG (Facility for Interactive Generation of figures), an object-based format
505186690Sobrien0	search/1	#FIG		FIG image text
50668349Sobrien>5	string		x		\b, version %.3s
50768349Sobrien
50868349Sobrien# PHIGS
50968349Sobrien0	string		ARF_BEGARF		PHIGS clear text archive
51068349Sobrien0	string		@(#)SunPHIGS		SunPHIGS
51168349Sobrien# version number follows, in the form m.n
51268349Sobrien>40	string		SunBin			binary
51368349Sobrien>32	string		archive			archive
51468349Sobrien
51568349Sobrien# GKS (Graphics Kernel System)
51668349Sobrien0	string		GKSM		GKS Metafile
51768349Sobrien>24	string		SunGKS		\b, SunGKS
51868349Sobrien
51968349Sobrien# CGM image files
52068349Sobrien0	string		BEGMF		clear text Computer Graphics Metafile
52168349Sobrien
52268349Sobrien# MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
52368349Sobrien0	string	yz	MGR bitmap, modern format, 8-bit aligned
52468349Sobrien0	string	zz	MGR bitmap, old format, 1-bit deep, 16-bit aligned
52568349Sobrien0	string	xz	MGR bitmap, old format, 1-bit deep, 32-bit aligned
52668349Sobrien0	string	yx	MGR bitmap, modern format, squeezed
52768349Sobrien
52868349Sobrien# Fuzzy Bitmap (FBM) images
52968349Sobrien0	string		%bitmap\0	FBM image data
53068349Sobrien>30	long		0x31		\b, mono
53168349Sobrien>30	long		0x33		\b, color
53268349Sobrien
53368349Sobrien# facsimile data
53468349Sobrien1	string		PC\ Research,\ Inc	group 3 fax data
53568349Sobrien>29	byte		0		\b, normal resolution (204x98 DPI)
53668349Sobrien>29	byte		1		\b, fine resolution (204x196 DPI)
537110949Sobrien# From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
538110949Sobrien0	string		Sfff		structured fax file
53968349Sobrien
540267843Sdelphij# From: Joerg Jenderek <joerg.jen.der.ek@gmx.net>
541267843Sdelphij# most files with the extension .EPA and some with .BMP
542267843Sdelphij0	string		\x11\x06	Award BIOS Logo, 136 x 84
543267843Sdelphij!:mime	image/x-award-bioslogo
544267843Sdelphij0	string		\x11\x09	Award BIOS Logo, 136 x 126
545267843Sdelphij!:mime	image/x-award-bioslogo
546267843Sdelphij#0	string		\x07\x1f	BIOS Logo corrupted?
547267843Sdelphij# http://www.blackfiveservices.co.uk/awbmtools.shtml
548267843Sdelphij# http://biosgfx.narod.ru/v3/
549267843Sdelphij# http://biosgfx.narod.ru/abr-2/
550330569Sgordon0	string		AWBM
551267843Sdelphij>4	leshort		<1981		Award BIOS bitmap
552267843Sdelphij!:mime	image/x-award-bmp
553267843Sdelphij# image width is a multiple of 4
554330569Sgordon>>4	leshort&0x0003	0
555267843Sdelphij>>>4		leshort	x		\b, %d
556267843Sdelphij>>>6		leshort	x		x %d
557267843Sdelphij>>4	leshort&0x0003	>0		\b,
558330569Sgordon>>>4	leshort&0x0003	=1
559267843Sdelphij>>>>4		leshort	x		%d+3
560330569Sgordon>>>4	leshort&0x0003	=2
561267843Sdelphij>>>>4		leshort	x		%d+2
562330569Sgordon>>>4	leshort&0x0003	=3
563267843Sdelphij>>>>4		leshort	x		%d+1
564267843Sdelphij>>>6		leshort	x		x %d
565267843Sdelphij# at offset 8 starts imagedata followed by "RGB " marker
566110949Sobrien
567186690Sobrien# PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, newt@uchicago.edu)
568267843Sdelphij# http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
569267843Sdelphij# 28bitmap_information_header.29
570186690Sobrien0	string		BM
571186690Sobrien>14	leshort		12		PC bitmap, OS/2 1.x format
572186690Sobrien!:mime	image/x-ms-bmp
57368349Sobrien>>18	leshort		x		\b, %d x
57468349Sobrien>>20	leshort		x		%d
575186690Sobrien>14	leshort		64		PC bitmap, OS/2 2.x format
576186690Sobrien!:mime	image/x-ms-bmp
57768349Sobrien>>18	leshort		x		\b, %d x
57868349Sobrien>>20	leshort		x		%d
579186690Sobrien>14	leshort		40		PC bitmap, Windows 3.x format
580186690Sobrien!:mime	image/x-ms-bmp
58168349Sobrien>>18	lelong		x		\b, %d x
58268349Sobrien>>22	lelong		x		%d x
58368349Sobrien>>28	leshort		x		%d
584267843Sdelphij>14	leshort		124		PC bitmap, Windows 98/2000 and newer format
585267843Sdelphij!:mime	image/x-ms-bmp
586267843Sdelphij>>18	lelong		x		\b, %d x
587267843Sdelphij>>22	lelong		x		%d x
588267843Sdelphij>>28	leshort		x		%d
589267843Sdelphij>14	leshort		108		PC bitmap, Windows 95/NT4 and newer format
590267843Sdelphij!:mime	image/x-ms-bmp
591267843Sdelphij>>18	lelong		x		\b, %d x
592267843Sdelphij>>22	lelong		x		%d x
593267843Sdelphij>>28	leshort		x		%d
594186690Sobrien>14	leshort		128		PC bitmap, Windows NT/2000 format
595186690Sobrien!:mime	image/x-ms-bmp
596186690Sobrien>>18	lelong		x		\b, %d x
597186690Sobrien>>22	lelong		x		%d x
598186690Sobrien>>28	leshort		x		%d
599133359Sobrien# Too simple - MPi
600133359Sobrien#0	string		IC		PC icon data
601133359Sobrien#0	string		PI		PC pointer image data
602133359Sobrien#0	string		CI		PC color icon data
603133359Sobrien#0	string		CP		PC color pointer image data
60468349Sobrien# Conflicts with other entries [BABYL]
60568349Sobrien#0	string		BA		PC bitmap array data
60668349Sobrien
60768349Sobrien# XPM icons (Greg Roelofs, newt@uchicago.edu)
608186690Sobrien0	search/1	/*\ XPM\ */	X pixmap image text
609234250Sobrien!:mime	image/x-xpmi
61068349Sobrien
61168349Sobrien# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
61268349Sobrien0	leshort		0xcc52		RLE image data,
61368349Sobrien>6	leshort		x		%d x
61468349Sobrien>8	leshort		x		%d
61568349Sobrien>2	leshort		>0		\b, lower left corner: %d
61668349Sobrien>4	leshort		>0		\b, lower right corner: %d
61768349Sobrien>10	byte&0x1	=0x1		\b, clear first
61868349Sobrien>10	byte&0x2	=0x2		\b, no background
61968349Sobrien>10	byte&0x4	=0x4		\b, alpha channel
62068349Sobrien>10	byte&0x8	=0x8		\b, comment
62168349Sobrien>11	byte		>0		\b, %d color channels
62268349Sobrien>12	byte		>0		\b, %d bits per pixel
62368349Sobrien>13	byte		>0		\b, %d color map channels
62468349Sobrien
62568349Sobrien# image file format (Robert Potter, potter@cs.rochester.edu)
62668349Sobrien0	string		Imagefile\ version-	iff image data
62768349Sobrien# this adds the whole header (inc. version number), informative but longish
62868349Sobrien>10	string		>\0		%s
62968349Sobrien
63068349Sobrien# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
63168349Sobrien0	belong		0x59a66a95	Sun raster image data
63268349Sobrien>4	belong		>0		\b, %d x
63368349Sobrien>8	belong		>0		%d,
63468349Sobrien>12	belong		>0		%d-bit,
63568349Sobrien#>16	belong		>0		%d bytes long,
63668349Sobrien>20	belong		0		old format,
63768349Sobrien#>20	belong		1		standard,
63868349Sobrien>20	belong		2		compressed,
63968349Sobrien>20	belong		3		RGB,
64068349Sobrien>20	belong		4		TIFF,
64168349Sobrien>20	belong		5		IFF,
64268349Sobrien>20	belong		0xffff		reserved for testing,
64368349Sobrien>24	belong		0		no colormap
64468349Sobrien>24	belong		1		RGB colormap
64568349Sobrien>24	belong		2		raw colormap
64668349Sobrien#>28	belong		>0		colormap is %d bytes long
64768349Sobrien
64868349Sobrien# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
64968349Sobrien#
65068349Sobrien# See
65168349Sobrien#	http://reality.sgi.com/grafica/sgiimage.html
65268349Sobrien#
65368349Sobrien0	beshort		474		SGI image data
65468349Sobrien#>2	byte		0		\b, verbatim
65568349Sobrien>2	byte		1		\b, RLE
65668349Sobrien#>3	byte		1		\b, normal precision
65768349Sobrien>3	byte		2		\b, high precision
65868349Sobrien>4	beshort		x		\b, %d-D
65968349Sobrien>6	beshort		x		\b, %d x
66068349Sobrien>8	beshort		x		%d
66168349Sobrien>10	beshort		x		\b, %d channel
66268349Sobrien>10	beshort		!1		\bs
66368349Sobrien>80	string		>0		\b, "%s"
66468349Sobrien
66568349Sobrien0	string		IT01		FIT image data
66668349Sobrien>4	belong		x		\b, %d x
66768349Sobrien>8	belong		x		%d x
66868349Sobrien>12	belong		x		%d
66968349Sobrien#
67068349Sobrien0	string		IT02		FIT image data
67168349Sobrien>4	belong		x		\b, %d x
67268349Sobrien>8	belong		x		%d x
67368349Sobrien>12	belong		x		%d
67468349Sobrien#
67568349Sobrien2048	string		PCD_IPI		Kodak Photo CD image pack file
67684685Sobrien>0xe02	byte&0x03	0x00		, landscape mode
67784685Sobrien>0xe02	byte&0x03	0x01		, portrait mode
67884685Sobrien>0xe02	byte&0x03	0x02		, landscape mode
67984685Sobrien>0xe02	byte&0x03	0x03		, portrait mode
68068349Sobrien0	string		PCD_OPA		Kodak Photo CD overview pack file
68168349Sobrien
68268349Sobrien# FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
68368349Sobrien# FITS is the Flexible Image Transport System, the de facto standard for
68468349Sobrien# data and image transfer, storage, etc., for the astronomical community.
68568349Sobrien# (FITS floating point formats are big-endian.)
68668349Sobrien0	string	SIMPLE\ \ =	FITS image data
68768349Sobrien>109	string	8		\b, 8-bit, character or unsigned binary integer
68868349Sobrien>108	string	16		\b, 16-bit, two's complement binary integer
68968349Sobrien>107	string	\ 32		\b, 32-bit, two's complement binary integer
69068349Sobrien>107	string	-32		\b, 32-bit, floating point, single precision
69168349Sobrien>107	string	-64		\b, 64-bit, floating point, double precision
69268349Sobrien
69368349Sobrien# other images
69468349Sobrien0	string	This\ is\ a\ BitMap\ file	Lisp Machine bit-array-file
69568349Sobrien
69668349Sobrien# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
69768349Sobrien# stuff.
69868349Sobrien#
69968349Sobrien0	beshort		0x1010		PEX Binary Archive
70068349Sobrien
70168349Sobrien# DICOM medical imaging data
702330569Sgordon# URL:		https://en.wikipedia.org/wiki/DICOM#Data_format
703330569Sgordon# Note:		"dcm" is the official file name extension
704330569Sgordon# 		XnView mention also "dc3" and "acr" as file name extension
70568349Sobrien128	string	DICM			DICOM medical imaging data
706186690Sobrien!:mime	application/dicom
707330569Sgordon!:ext dcm/dicom/dic
70874784Sobrien
709133359Sobrien# XWD - X Window Dump file.
71074784Sobrien#   As described in /usr/X11R6/include/X11/XWDFile.h
71174784Sobrien#   used by the xwd program.
71274784Sobrien#   Bradford Castalia, idaeim, 1/01
713226048Sobrien#   updated by Adam Buchbinder, 2/09
714226048Sobrien# The following assumes version 7 of the format; the first long is the length
715226048Sobrien# of the header, which is at least 25 4-byte longs, and the one at offset 8
716226048Sobrien# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
717226048Sobrien# which is a maximum of 32.
718226048Sobrien0	belong	>100
719226048Sobrien>8	belong	<3
720226048Sobrien>>12	belong	<33
721226048Sobrien>>>4	belong	7			XWD X Window Dump image data
722226048Sobrien!:mime	image/x-xwindowdump
723226048Sobrien>>>>100	string	>\0			\b, "%s"
724226048Sobrien>>>>16	belong	x			\b, %dx
725226048Sobrien>>>>20	belong	x			\b%dx
726226048Sobrien>>>>12	belong	x			\b%d
72774784Sobrien
72874784Sobrien# PDS - Planetary Data System
72974784Sobrien#   These files use Parameter Value Language in the header section.
73074784Sobrien#   Unfortunately, there is no certain magic, but the following
73174784Sobrien#   strings have been found to be most likely.
73274784Sobrien0	string	NJPL1I00		PDS (JPL) image data
73374784Sobrien2	string	NJPL1I			PDS (JPL) image data
73474784Sobrien0	string	CCSD3ZF			PDS (CCSD) image data
73574784Sobrien2	string	CCSD3Z			PDS (CCSD) image data
73674784Sobrien0	string	PDS_			PDS image data
73774784Sobrien0	string	LBLSIZE=		PDS (VICAR) image data
73874784Sobrien
73974784Sobrien# pM8x: ATARI STAD compressed bitmap format
74074784Sobrien#
74174784Sobrien# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
74274784Sobrien# p M 8 5/6 xx yy zz data...
74374784Sobrien# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
74474784Sobrien# bytes either run horizontally (pM85) or vertically (pM86). yy is the
74574784Sobrien# most frequent byte, xx and zz are runlength escape codes, where xx is
74674784Sobrien# used for runs of yy.
74774784Sobrien#
74874784Sobrien0	string	pM85		Atari ST STAD bitmap image data (hor)
74974784Sobrien>5	byte	0x00		(white background)
75074784Sobrien>5	byte	0xFF		(black background)
75174784Sobrien0	string	pM86		Atari ST STAD bitmap image data (vert)
75274784Sobrien>5	byte	0x00		(white background)
75374784Sobrien>5	byte	0xFF		(black background)
75480588Sobrien
755267843Sdelphij# Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
756169962Sobrien# http://www.atarimax.com/jindroush.atari.org/afmtatr.html
757169962Sobrien0	leshort	0x0296		Atari ATR image
758169962Sobrien
75984685Sobrien# XXX:
76084685Sobrien# This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
76184685Sobrien# magic.
76280588Sobrien# SGI RICE image file <mpruett@sgi.com>
76384685Sobrien#0	beshort	0x5249		RICE image
76484685Sobrien#>2	beshort	x		v%d
76584685Sobrien#>4	beshort	x		(%d x
76684685Sobrien#>6	beshort	x		%d)
76784685Sobrien#>8	beshort	0		8 bit
76884685Sobrien#>8	beshort	1		10 bit
76984685Sobrien#>8	beshort	2		12 bit
77084685Sobrien#>8	beshort	3		13 bit
77184685Sobrien#>10	beshort	0		4:2:2
77284685Sobrien#>10	beshort	1		4:2:2:4
77384685Sobrien#>10	beshort	2		4:4:4
77484685Sobrien#>10	beshort	3		4:4:4:4
77584685Sobrien#>12	beshort	1		RGB
77684685Sobrien#>12	beshort	2		CCIR601
77784685Sobrien#>12	beshort	3		RP175
77884685Sobrien#>12	beshort	4		YUV
77984685Sobrien
780110949Sobrien# PCX image files
781110949Sobrien# From: Dan Fandrich <dan@coneharvesters.com>
782267843Sdelphij# updated by Joerg Jenderek at Feb 2013 by http://de.wikipedia.org/wiki/PCX
783267843Sdelphij# http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
784267843Sdelphij# GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
785267843Sdelphij# 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
786330569Sgordon0	ubelong&0xffF8fe00	0x0a000000
787330569Sgordon# for PCX bit depth > 0
788330569Sgordon>3	ubyte		>0
789267843Sdelphij# test for valid versions
790330569Sgordon>>1	ubyte		<6
791267843Sdelphij>>>1	ubyte		!1	PCX
792267843Sdelphij!:mime	image/x-pcx
793267843Sdelphij#!:mime	image/pcx
794267843Sdelphij>>>>1	ubyte		0	ver. 2.5 image data
795267843Sdelphij>>>>1	ubyte		2	ver. 2.8 image data, with palette
796267843Sdelphij>>>>1	ubyte		3	ver. 2.8 image data, without palette
797267843Sdelphij>>>>1	ubyte		4	for Windows image data
798267843Sdelphij>>>>1	ubyte		5	ver. 3.0 image data
799267843Sdelphij>>>>4	uleshort	x	bounding box [%d,
800267843Sdelphij>>>>6	uleshort	x	%d] -
801267843Sdelphij>>>>8	uleshort	x	[%d,
802267843Sdelphij>>>>10	uleshort	x	%d],
803267843Sdelphij>>>>65	ubyte		>1	%d planes each of
804267843Sdelphij>>>>3	ubyte		x	%d-bit
805267843Sdelphij>>>>68	byte		1	colour,
806267843Sdelphij>>>>68	byte		2	grayscale,
807267843Sdelphij# this should not happen
808267843Sdelphij>>>>68	default		x	image,
809267843Sdelphij>>>>12	leshort		>0	%d x
810267843Sdelphij>>>>>14	uleshort	x	%d dpi,
811267843Sdelphij>>>>2	byte		0	uncompressed
812267843Sdelphij>>>>2	byte		1	RLE compressed
813133359Sobrien
814133359Sobrien# Adobe Photoshop
815226048Sobrien# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
816133359Sobrien0	string		8BPS Adobe Photoshop Image
817186690Sobrien!:mime	image/vnd.adobe.photoshop
818226048Sobrien>4   beshort 2 (PSB)
819226048Sobrien>18  belong  x \b, %d x
820226048Sobrien>14  belong  x %d,
821226048Sobrien>24  beshort 0 bitmap
822226048Sobrien>24  beshort 1 grayscale
823226048Sobrien>>12 beshort 2 with alpha
824226048Sobrien>24  beshort 2 indexed
825226048Sobrien>24  beshort 3 RGB
826226048Sobrien>>12 beshort 4 \bA
827226048Sobrien>24  beshort 4 CMYK
828226048Sobrien>>12 beshort 5 \bA
829226048Sobrien>24  beshort 7 multichannel
830226048Sobrien>24  beshort 8 duotone
831226048Sobrien>24  beshort 9 lab
832226048Sobrien>12  beshort > 1
833226048Sobrien>>12  beshort x \b, %dx
834226048Sobrien>12  beshort 1 \b,
835226048Sobrien>22  beshort x %d-bit channel
836226048Sobrien>12  beshort > 1 \bs
837133359Sobrien
838133359Sobrien# XV thumbnail indicator (ThMO)
839133359Sobrien0	string		P7\ 332		XV thumbnail image data
840133359Sobrien
841133359Sobrien# NITF is defined by United States MIL-STD-2500A
842133359Sobrien0	string	NITF	National Imagery Transmission Format
843133359Sobrien>25	string	>\0	dated %.14s
844133359Sobrien
845133359Sobrien# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
846284778Sdelphij# Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
847330569Sgordon# Update: Joerg Jenderek
848284778Sdelphij# See http://fileformats.archiveteam.org/wiki/GEM_Raster
849284778Sdelphij# For variations, also see:
850330569Sgordon#    http://www.seasip.info/Gem/ff_img.html (Ventura)
851284778Sdelphij#    http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
852284778Sdelphij#    http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
853284778Sdelphij#    http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
854284778Sdelphij0       beshort     0x0001
855330569Sgordon# header_size
856330569Sgordon>2      beshort     0x0008
857284778Sdelphij>>0     use gem_info
858330569Sgordon>2      beshort     0x0009
859284778Sdelphij>>0     use gem_info
860330569Sgordon# no example for NOSIG
861330569Sgordon>2      beshort     24
862330569Sgordon>>0     use gem_info
863330569Sgordon# no example for HYPERPAINT
864330569Sgordon>2      beshort     25
865330569Sgordon>>0     use gem_info
866330569Sgordon16      string      XIMG\0
867284778Sdelphij>0      use gem_info
868330569Sgordon# no example
869330569Sgordon16      string      STTT\0\x10
870284778Sdelphij>0      use gem_info
871330569Sgordon# no example or description
872330569Sgordon16      string      TIMG\0
873284778Sdelphij>0      use gem_info
874284778Sdelphij
875284778Sdelphij0   name        gem_info
876330569Sgordon# version is 2 for some XIMG and 1 for all others
877330569Sgordon>0	beshort		<0x0003		GEM
878330569Sgordon# http://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
879330569Sgordon!:mime	image/x-gem
880330569Sgordon# header_size 24 25 27 59 779 words for colored bitmaps
881330569Sgordon>>2	beshort		>9
882330569Sgordon>>>16	string		STTT\0\x10	STTT
883330569Sgordon>>>16	string		TIMG\0		TIMG
884330569Sgordon# HYPERPAINT or NOSIG variant
885330569Sgordon>>>16	string		\0\x80
886330569Sgordon>>>>2	beshort		=24		NOSIG
887330569Sgordon>>>>2	beshort		!24		HYPERPAINT
888330569Sgordon# NOSIG or XIMG variant
889330569Sgordon>>>16	default		x
890330569Sgordon>>>>16	string		!XIMG\0		NOSIG
891330569Sgordon>>16	string		=XIMG\0		XIMG Image data
892330569Sgordon!:ext	img/ximg
893330569Sgordon# to avoid Warning: Current entry does not yet have a description for adding a EXTENSION type
894330569Sgordon>>16	string		!XIMG\0		Image data
895330569Sgordon!:ext	img
896330569Sgordon# header_size is 9 for Ventura files and 8 for other GEM Paint files
897330569Sgordon>>2	beshort		9		(Ventura)
898330569Sgordon#>>2	beshort		8		(Paint)
899330569Sgordon>>12	beshort		x		%d x
900330569Sgordon>>14	beshort		x		%d,
901330569Sgordon# 1 4 8
902330569Sgordon>>4	beshort		x		%d planes,
903330569Sgordon# in tenths of a millimetre
904330569Sgordon>>8	beshort		x		%d x
905330569Sgordon>>10	beshort		x		%d pixelsize
906330569Sgordon# pattern_size 1-8. 2 for GEM Paint
907330569Sgordon>>6	beshort		!2		\b, pattern size %d
908133359Sobrien
909133359Sobrien# GEM Metafile (Wolfram Kleff)
910133359Sobrien0	lelong		0x0018FFFF	GEM Metafile data
911133359Sobrien>4	leshort		x		version %d
912133359Sobrien
913133359Sobrien#
914133359Sobrien# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
915133359Sobrien# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
916133359Sobrien#
917133359Sobrien0	string	\0\nSMJPEG	SMJPEG
918133359Sobrien>8	belong	x		%d.x data
919133359Sobrien# According to the specification you could find any number of _TXT
920133359Sobrien# headers here, but I can't think of any way of handling that. None of
921133359Sobrien# the SMJPEG files I tried it on used this feature. Even if such a
922133359Sobrien# file is encountered the output should still be reasonable.
923133359Sobrien>16	string	_SND		\b,
924133359Sobrien>>24	beshort	>0		%d Hz
925133359Sobrien>>26	byte	8		8-bit
926133359Sobrien>>26	byte	16		16-bit
927133359Sobrien>>28	string	NONE		uncompressed
928133359Sobrien# >>28	string	APCM		ADPCM compressed
929133359Sobrien>>27	byte	1		mono
930133359Sobrien>>28	byte	2		stereo
931133359Sobrien# Help! Isn't there any way to avoid writing this part twice?
932133359Sobrien>>32	string	_VID		\b,
933133359Sobrien# >>>48	string	JFIF		JPEG
934133359Sobrien>>>40	belong	>0		%d frames
935133359Sobrien>>>44	beshort	>0		(%d x
936133359Sobrien>>>46	beshort	>0		%d)
937133359Sobrien>16	string	_VID		\b,
938133359Sobrien# >>32	string	JFIF		JPEG
939133359Sobrien>>24	belong	>0		%d frames
940133359Sobrien>>28	beshort	>0		(%d x
941133359Sobrien>>30	beshort	>0		%d)
942133359Sobrien
943133359Sobrien0	string	Paint\ Shop\ Pro\ Image\ File	Paint Shop Pro Image File
944133359Sobrien
945133359Sobrien# "thumbnail file" (icon)
946133359Sobrien# descended from "xv", but in use by other applications as well (Wolfram Kleff)
947133359Sobrien0       string          P7\ 332         XV "thumbnail file" (icon) data
948133359Sobrien
949133359Sobrien# taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
950133359Sobrien0       string          KiSS            KISS/GS
951133359Sobrien>4      byte            16              color
952133359Sobrien>>5     byte            x               %d bit
953133359Sobrien>>8     leshort         x               %d colors
954133359Sobrien>>10    leshort         x               %d groups
955133359Sobrien>4      byte            32              cell
956133359Sobrien>>5     byte            x               %d bit
957133359Sobrien>>8     leshort         x               %d x
958133359Sobrien>>10    leshort         x               %d
959133359Sobrien>>12    leshort         x               +%d
960133359Sobrien>>14    leshort         x               +%d
961133359Sobrien
962133359Sobrien# Webshots (www.webshots.com), by John Harrison
963133359Sobrien0       string          C\253\221g\230\0\0\0 Webshots Desktop .wbz file
964133359Sobrien
965133359Sobrien# Hercules DASD image files
966133359Sobrien# From Jan Jaeger <jj@septa.nl>
967133359Sobrien0       string  CKD_P370        Hercules CKD DASD image file
968133359Sobrien>8      long    x               \b, %d heads per cylinder
969133359Sobrien>12     long    x               \b, track size %d bytes
970133359Sobrien>16     byte    x               \b, device type 33%2.2X
971133359Sobrien
972133359Sobrien0       string  CKD_C370        Hercules compressed CKD DASD image file
973133359Sobrien>8      long    x               \b, %d heads per cylinder
974133359Sobrien>12     long    x               \b, track size %d bytes
975133359Sobrien>16     byte    x               \b, device type 33%2.2X
976133359Sobrien
977133359Sobrien0       string  CKD_S370        Hercules CKD DASD shadow file
978133359Sobrien>8      long    x               \b, %d heads per cylinder
979133359Sobrien>12     long    x               \b, track size %d bytes
980133359Sobrien>16     byte    x               \b, device type 33%2.2X
981133359Sobrien
982186690Sobrien# Squeak images and programs - etoffi@softhome.net
983186690Sobrien0	string		\146\031\0\0	Squeak image data
984186690Sobrien0	search/1	'From\040Squeak	Squeak program text
985133359Sobrien
986133359Sobrien# partimage: file(1) magic for PartImage files (experimental, incomplete)
987133359Sobrien# Author: Hans-Joachim Baader <hjb@pro-linux.de>
988133359Sobrien0		string	PaRtImAgE-VoLuMe	PartImage
989133359Sobrien>0x0020		string	0.6.1		file version %s
990267843Sdelphij>>0x0060	lelong	>-1		volume %d
991133359Sobrien#>>0x0064 8 byte identifier
992133359Sobrien#>>0x007c reserved
993133359Sobrien>>0x0200	string	>\0		type %s
994133359Sobrien>>0x1400	string	>\0		device %s,
995133359Sobrien>>0x1600	string	>\0		original filename %s,
996133359Sobrien# Some fields omitted
997133359Sobrien>>0x2744	lelong	0		not compressed
998133359Sobrien>>0x2744	lelong	1		gzip compressed
999133359Sobrien>>0x2744	lelong	2		bzip2 compressed
1000133359Sobrien>>0x2744	lelong	>2		compressed with unknown algorithm
1001133359Sobrien>0x0020		string	>0.6.1		file version %s
1002133359Sobrien>0x0020		string	<0.6.1		file version %s
1003133359Sobrien
1004133359Sobrien# DCX is multi-page PCX, using a simple header of up to 1024
1005133359Sobrien# offsets for the respective PCX components.
1006133359Sobrien# From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
1007133359Sobrien0	lelong	987654321	DCX multi-page PCX image data
1008133359Sobrien
1009133359Sobrien# Simon Walton <simonw@matteworld.com>
1010133359Sobrien# Kodak Cineon format for scanned negatives
1011133359Sobrien# http://www.kodak.com/US/en/motion/support/dlad/
1012133359Sobrien0	lelong  0xd75f2a80	Cineon image data
1013267843Sdelphij>200	belong  >0		\b, %d x
1014267843Sdelphij>204	belong  >0		%d
1015133359Sobrien
1016133359Sobrien
1017133359Sobrien# Bio-Rad .PIC is an image format used by microscope control systems
1018133359Sobrien# and related image processing software used by biologists.
1019133359Sobrien# From: Vebjorn Ljosa <vebjorn@ljosa.com>
1020226048Sobrien# BOOL values are two-byte integers; use them to rule out false positives.
1021226048Sobrien# http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
1022226048Sobrien# Samples: http://www.loci.wisc.edu/software/sample-data
1023226048Sobrien14	leshort <2
1024226048Sobrien>62	leshort <2
1025226048Sobrien>>54	leshort 12345		Bio-Rad .PIC Image File
1026267843Sdelphij>>>0	leshort >0		%d x
1027267843Sdelphij>>>2	leshort >0		%d,
1028226048Sobrien>>>4	leshort =1		1 image in file
1029267843Sdelphij>>>4	leshort >1		%d images in file
1030133359Sobrien
1031133359Sobrien# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
1032133359Sobrien# The description of *.mrw format can be found at
1033133359Sobrien# http://www.dalibor.cz/minolta/raw_file_format.htm
1034133359Sobrien0	string	\000MRM			Minolta Dimage camera raw image data
1035133359Sobrien
1036186690Sobrien# Summary: DjVu image / document
1037186690Sobrien# Extension: .djvu
1038186690Sobrien# Reference: http://djvu.org/docs/DjVu3Spec.djvu
1039186690Sobrien# Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
1040186690Sobrien# Modified by (1): Abel Cheung <abelcheung@gmail.com>
1041186690Sobrien0	string	AT&TFORM
1042226048Sobrien>12	string	DJVM		DjVu multiple page document
1043186690Sobrien!:mime	image/vnd.djvu
1044186690Sobrien>12	string	DJVU		DjVu image or single page document
1045226048Sobrien!:mime	image/vnd.djvu
1046186690Sobrien>12	string	DJVI		DjVu shared document
1047226048Sobrien!:mime	image/vnd.djvu
1048186690Sobrien>12	string	THUM		DjVu page thumbnails
1049226048Sobrien!:mime	image/vnd.djvu
1050133359Sobrien
1051267843Sdelphij# Originally by Marc Espie
1052267843Sdelphij# Modified by Robert Minsk <robertminsk at yahoo.com>
1053267843Sdelphij# http://www.openexr.com/openexrfilelayout.pdf
1054267843Sdelphij0	lelong		20000630	OpenEXR image data,
1055267843Sdelphij!:mime image/x-exr
1056267843Sdelphij>4	lelong&0x000000ff x		version %d,
1057267843Sdelphij>4	lelong		^0x00000200	storage: scanline
1058267843Sdelphij>4	lelong		&0x00000200	storage: tiled
1059267843Sdelphij>8	search/0x1000	compression\0	\b, compression:
1060267843Sdelphij>>&16	byte		0		none
1061267843Sdelphij>>&16	byte		1		rle
1062267843Sdelphij>>&16	byte		2		zips
1063267843Sdelphij>>&16	byte		3		zip
1064267843Sdelphij>>&16	byte		4		piz
1065267843Sdelphij>>&16	byte		5		pxr24
1066267843Sdelphij>>&16	byte		6		b44
1067267843Sdelphij>>&16	byte		7		b44a
1068267843Sdelphij>>&16	byte		>7		unknown
1069267843Sdelphij>8	 search/0x1000	dataWindow\0	\b, dataWindow:
1070267843Sdelphij>>&10	lelong		x		(%d
1071267843Sdelphij>>&14	lelong		x		%d)-
1072267843Sdelphij>>&18	lelong		x		\b(%d
1073267843Sdelphij>>&22	lelong		x		%d)
1074267843Sdelphij>8	search/0x1000	displayWindow\0	\b, displayWindow:
1075267843Sdelphij>>&10	lelong		x		(%d
1076267843Sdelphij>>&14	lelong		x		%d)-
1077267843Sdelphij>>&18	lelong		x		\b(%d
1078267843Sdelphij>>&22	lelong		x		%d)
1079267843Sdelphij>8	search/0x1000	lineOrder\0	 \b, lineOrder:
1080267843Sdelphij>>&14	byte		0		increasing y
1081267843Sdelphij>>&14	byte		1		decreasing y
1082267843Sdelphij>>&14	byte		2		random y
1083267843Sdelphij>>&14	byte		>2		unknown
1084133359Sobrien
1085267843Sdelphij# SMPTE Digital Picture Exchange Format, SMPTE DPX
1086267843Sdelphij#
1087267843Sdelphij# ANSI/SMPTE 268M-1994, SMPTE Standard for File Format for Digital
1088267843Sdelphij# Moving-Picture Exchange (DPX), v1.0, 18 February 1994
1089267843Sdelphij# Robert Minsk <robertminsk at yahoo.com>
1090267843Sdelphij0	string		SDPX	DPX image data, big-endian,
1091267843Sdelphij!:mime image/x-dpx
1092267843Sdelphij>768	beshort		<4
1093267843Sdelphij>>772	belong		x	%dx
1094267843Sdelphij>>776	belong		x	\b%d,
1095267843Sdelphij>768	beshort		>3
1096267843Sdelphij>>776	belong		x	%dx
1097267843Sdelphij>>772	belong		x	\b%d,
1098267843Sdelphij>768	beshort		0	left to right/top to bottom
1099267843Sdelphij>768	beshort		1	right to left/top to bottom
1100267843Sdelphij>768	beshort		2	left to right/bottom to top
1101267843Sdelphij>768	beshort		3	right to left/bottom to top
1102267843Sdelphij>768	beshort		4	top to bottom/left to right
1103267843Sdelphij>768	beshort		5	top to bottom/right to left
1104267843Sdelphij>768	leshort		6	bottom to top/left to right
1105267843Sdelphij>768	leshort		7	bottom to top/right to left
1106133359Sobrien
1107133359Sobrien# From: Tom Hilinski <tom.hilinski@comcast.net>
1108133359Sobrien# http://www.unidata.ucar.edu/packages/netcdf/
1109159764Sobrien0	string	CDF\001			NetCDF Data Format data
1110159764Sobrien
1111159764Sobrien#-----------------------------------------------------------------------
1112159764Sobrien# Hierarchical Data Format, used to facilitate scientific data exchange
1113159764Sobrien# specifications at http://hdf.ncsa.uiuc.edu/
1114159764Sobrien0	belong	0x0e031301	Hierarchical Data Format (version 4) data
1115186690Sobrien!:mime	application/x-hdf
1116226048Sobrien0	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) data
1117186690Sobrien!:mime	application/x-hdf
1118267843Sdelphij512	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 512 bytes user block
1119267843Sdelphij!:mime	application/x-hdf
1120267843Sdelphij1024	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 1k user block
1121267843Sdelphij!:mime	application/x-hdf
1122267843Sdelphij2048	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 2k user block
1123267843Sdelphij!:mime	application/x-hdf
1124267843Sdelphij4096	string	\211HDF\r\n\032\n	Hierarchical Data Format (version 5) with 4k user block
1125267843Sdelphij!:mime	application/x-hdf
1126169942Sobrien
1127267843Sdelphij
1128169942Sobrien# From: Tobias Burnus <burnus@net-b.de>
1129169942Sobrien# Xara (for a while: Corel Xara) is a graphic package, see
1130186690Sobrien# http://www.xara.com/ for Windows and as GPL application for Linux
1131169942Sobrien0	string	XARA\243\243	Xara graphics file
1132186690Sobrien
1133186690Sobrien# http://www.cartesianinc.com/Tech/
1134186690Sobrien0	string	CPC\262		Cartesian Perceptual Compression image
1135186690Sobrien!:mime	image/x-cpi
1136186690Sobrien
1137186690Sobrien# From Albert Cahalan <acahalan@gmail.com>
1138186690Sobrien# puredigital used it for the CVS disposable camcorder
1139186690Sobrien#8       lelong  4       ZBM bitmap image data
1140186690Sobrien#>4      leshort x       %u x
1141186690Sobrien#>6      leshort x       %u
1142186690Sobrien
1143186690Sobrien# From Albert Cahalan <acahalan@gmail.com>
1144186690Sobrien# uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
1145186690Sobrien0       string C565     OLPC firmware icon image data
1146186690Sobrien>4      leshort x       %u x
1147186690Sobrien>6      leshort x       %u
1148186690Sobrien
1149186690Sobrien# Applied Images - Image files from Cytovision
1150186690Sobrien# Gustavo Junior Alves <gjalves@gjalves.com.br>
1151186690Sobrien0	string	\xce\xda\xde\xfa	Cytovision Metaphases file
1152186690Sobrien0	string	\xed\xad\xef\xac	Cytovision Karyotype file
1153186690Sobrien0	string	\x0b\x00\x03\x00	Cytovision FISH Probe file
1154186690Sobrien0	string	\xed\xfe\xda\xbe	Cytovision FLEX file
1155186690Sobrien0	string	\xed\xab\xed\xfe	Cytovision FLEX file
1156186690Sobrien0	string	\xad\xfd\xea\xad	Cytovision RATS file
1157186690Sobrien
1158186690Sobrien# Wavelet Scalar Quantization format used in gray-scale fingerprint images
1159186690Sobrien# From Tano M Fotang <mfotang@quanteq.com>
1160186690Sobrien0	string	\xff\xa0\xff\xa8\x00	Wavelet Scalar Quantization image data
1161191736Sobrien
1162267843Sdelphij# Type:		PCO B16 image files
1163267843Sdelphij# URL:		http://www.pco.de/fileadmin/user_upload/db/download/MA_CWDCOPIE_0412b.pdf
1164267843Sdelphij# From:		Florian Philipp <florian.philipp@binarywings.net>
1165267843Sdelphij# Extension:	.b16
1166267843Sdelphij# Description:	Pixel image format produced by PCO Camware, typically used
1167267843Sdelphij#		together with PCO cameras.
1168267843Sdelphij# Note:		Different versions exist for e.g. 8 bit and 16 bit images.
1169267843Sdelphij#		Documentation is incomplete.
1170267843Sdelphij0	string/b	PCO-	PCO B16 image data
1171267843Sdelphij>12	lelong		x	\b, %dx
1172267843Sdelphij>16	lelong		x	\b%d
1173267843Sdelphij>20	lelong		0	\b, short header
1174267843Sdelphij>20	lelong		-1	\b, extended header
1175267843Sdelphij>>24	lelong		0	\b, grayscale
1176267843Sdelphij>>>36	lelong		0	linear LUT
1177267843Sdelphij>>>36	lelong		1	logarithmic LUT
1178267843Sdelphij>>>28	lelong		x	[%d
1179267843Sdelphij>>>32	lelong		x	\b,%d]
1180267843Sdelphij>>24	lelong		1	\b, color
1181267843Sdelphij>>>64	lelong		0	linear LUT
1182267843Sdelphij>>>64	lelong		1	logarithmic LUT
1183267843Sdelphij>>>40	lelong		x	r[%d
1184267843Sdelphij>>>44	lelong		x	\b,%d]
1185267843Sdelphij>>>48	lelong		x	g[%d
1186267843Sdelphij>>>52	lelong		x	\b,%d]
1187267843Sdelphij>>>56	lelong		x	b[%d
1188267843Sdelphij>>>60	lelong		x	\b,%d]
1189226048Sobrien
1190267843Sdelphij# Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
1191267843Sdelphij# From: Markus Heidelberg <markus.heidelberg at web.de>
1192267843Sdelphij0	string/t	[BitmapInfo2]	Polar Monitor Bitmap text
1193267843Sdelphij!:mime	image/x-polar-monitor-bitmap
1194267843Sdelphij
1195267843Sdelphij# From: Rick Richardson <rickrich@gmail.com>
1196330569Sgordon# updated by: Joerg Jenderek
1197330569Sgordon# URL: http://techmods.net/nuvi/
1198226048Sobrien0	string	GARMIN\ BITMAP\ 01	Garmin Bitmap file
1199330569Sgordon# extension is also used for
1200330569Sgordon# Sony SRF raw image (image/x-sony-srf)
1201330569Sgordon# SRF map
1202330569Sgordon# Terragen Surface Map (http://www.planetside.co.uk/terragen)
1203330569Sgordon# FileLocator Pro search criteria file (http://www.mythicsoft.com/filelocatorpro)
1204330569Sgordon!:ext srf
1205330569Sgordon#!:mime	image/x-garmin-srf
1206330569Sgordon# version 1.00,2.00,2.10,2.40,2.50
1207330569Sgordon>0x2f	string		>0		\b, version %4.4s
1208330569Sgordon# width (2880,2881,3240)
1209330569Sgordon>0x55	uleshort	>0		\b, %dx
1210330569Sgordon# height (80,90)
1211330569Sgordon>>0x53	uleshort	x		\b%d
1212226048Sobrien
1213226048Sobrien# Type:	Ulead Photo Explorer5 (.pe5)
1214226048Sobrien# URL:	http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
1215226048Sobrien# From:	Simon Horman <horms@debian.org>
1216226048Sobrien0	string	IIO2H			Ulead Photo Explorer5
1217226048Sobrien
1218226048Sobrien# Type:	X11 cursor
1219226048Sobrien# URL:	http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
1220226048Sobrien# From:	Mathias Brodala <info@noctus.net>
1221226048Sobrien0	string	Xcur			X11 cursor
1222226048Sobrien
1223226048Sobrien# Type:	Olympus ORF raw images.
1224226048Sobrien# URL:	http://libopenraw.freedesktop.org/wiki/Olympus_ORF
1225226048Sobrien# From:	Adam Buchbinder <adam.buchbinder@gmail.com>
1226226048Sobrien0	string		MMOR		Olympus ORF raw image data, big-endian
1227226048Sobrien!:mime	image/x-olympus-orf
1228226048Sobrien0	string		IIRO		Olympus ORF raw image data, little-endian
1229226048Sobrien!:mime	image/x-olympus-orf
1230226048Sobrien0	string		IIRS		Olympus ORF raw image data, little-endian
1231226048Sobrien!:mime	image/x-olympus-orf
1232226048Sobrien
1233226048Sobrien# Type: files used in modern AVCHD camcoders to store clip information
1234226048Sobrien# Extension: .cpi
1235226048Sobrien# From: Alexander Danilov <alexander.a.danilov@gmail.com>
1236226048Sobrien0	string	HDMV0100	AVCHD Clip Information
1237226048Sobrien
1238226048Sobrien# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1239226048Sobrien# URL: http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/
1240226048Sobrien# Radiance HDR; usually has .pic or .hdr extension.
1241226048Sobrien0	string	#?RADIANCE\n	Radiance HDR image data
1242226048Sobrien#!mime	image/vnd.radiance
1243226048Sobrien
1244226048Sobrien# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1245226048Sobrien# URL: http://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
1246226048Sobrien# Used by the pfstools packages. The regex matches for the image size could
1247226048Sobrien# probably use some work. The MIME type is made up; if there's one in
1248226048Sobrien# actual common use, it should replace the one below.
1249226048Sobrien0	string	PFS1\x0a	PFS HDR image data
1250226048Sobrien#!mime	image/x-pfs
1251226048Sobrien>1	regex	[0-9]*\ 		\b, %s
1252226048Sobrien>>1	regex	\ [0-9]{4}		\bx%s
1253226048Sobrien
1254226048Sobrien# Type: Foveon X3F
1255226048Sobrien# URL:  http://www.photofo.com/downloads/x3f-raw-format.pdf
1256226048Sobrien# From: Adam Buchbinder <adam.buchbinder@gmail.com>
1257226048Sobrien# Note that the MIME type isn't defined anywhere that I can find; if
1258226048Sobrien# there's a canonical type for this format, it should replace this one.
1259226048Sobrien0	string	FOVb	Foveon X3F raw image data
1260226048Sobrien!:mime	image/x-x3f
1261226048Sobrien>6	leshort	x	\b, version %d.
1262226048Sobrien>4	leshort	x	\b%d
1263226048Sobrien>28	lelong	x	\b, %dx
1264226048Sobrien>32	lelong	x	\b%d
1265226048Sobrien
1266226048Sobrien# Paint.NET file
1267226048Sobrien# From Adam Buchbinder <adam.buchbinder@gmail.com>
1268226048Sobrien0	string	PDN3	Paint.NET image data
1269226048Sobrien!:mime	image/x-paintnet
1270226048Sobrien
1271226048Sobrien# Not really an image.
1272226048Sobrien# From: "Tano M. Fotang" <mfotang@quanteq.com>
1273226048Sobrien0	string	\x46\x4d\x52\x00	ISO/IEC 19794-2 Format Minutiae Record (FMR)
1274267843Sdelphij
1275276415Sdelphij# doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
1276276415Sdelphij# example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
1277276415Sdelphij90	bequad		0x574D50484F544F00	JPEG-XR Image
1278276415Sdelphij>98	byte&0x08	=0x08			\b, hard tiling
1279276415Sdelphij>99	byte&0x80	=0x80			\b, tiling present
1280276415Sdelphij>99	byte&0x40	=0x40			\b, codestream present
1281276415Sdelphij>99	byte&0x38	x			\b, spatial xform=
1282276415Sdelphij>99	byte&0x38	0x00			\bTL
1283276415Sdelphij>99	byte&0x38	0x08			\bBL
1284276415Sdelphij>99	byte&0x38	0x10			\bTR
1285276415Sdelphij>99	byte&0x38	0x18			\bBR
1286276415Sdelphij>99	byte&0x38	0x20			\bBT
1287276415Sdelphij>99	byte&0x38	0x28			\bRB
1288276415Sdelphij>99	byte&0x38	0x30			\bLT
1289276415Sdelphij>99	byte&0x38	0x38			\bLB
1290276415Sdelphij>100	byte&0x80	=0x80			\b, short header
1291276415Sdelphij>>102	beshort+1	x			\b, %d
1292276415Sdelphij>>104	beshort+1	x			\bx%d
1293276415Sdelphij>100	byte&0x80	=0x00			\b, long header
1294276415Sdelphij>>102	belong+1	x			\b, %x
1295276415Sdelphij>>106	belong+1	x			\bx%x
1296276415Sdelphij>101	beshort&0xf	x			\b, bitdepth=
1297276415Sdelphij>>101	beshort&0xf	0x0			\b1-WHITE=1
1298276415Sdelphij>>101	beshort&0xf	0x1			\b8
1299276415Sdelphij>>101	beshort&0xf	0x2			\b16
1300276415Sdelphij>>101	beshort&0xf	0x3			\b16-SIGNED
1301276415Sdelphij>>101	beshort&0xf	0x4			\b16-FLOAT
1302276415Sdelphij>>101	beshort&0xf	0x5			\b(reserved 5)
1303276415Sdelphij>>101	beshort&0xf	0x6			\b32-SIGNED
1304276415Sdelphij>>101	beshort&0xf	0x7			\b32-FLOAT
1305276415Sdelphij>>101	beshort&0xf	0x8			\b5
1306276415Sdelphij>>101	beshort&0xf	0x9			\b10
1307276415Sdelphij>>101	beshort&0xf	0xa			\b5-6-5
1308276415Sdelphij>>101	beshort&0xf	0xb			\b(reserved %d)
1309276415Sdelphij>>101	beshort&0xf	0xc			\b(reserved %d)
1310276415Sdelphij>>101	beshort&0xf	0xd			\b(reserved %d)
1311276415Sdelphij>>101	beshort&0xf	0xe			\b(reserved %d)
1312276415Sdelphij>>101	beshort&0xf	0xf			\b1-BLACK=1
1313276415Sdelphij>101	beshort&0xf0	x			\b, colorfmt=
1314276415Sdelphij>>101	beshort&0xf0	0x00			\bYONLY
1315276415Sdelphij>>101	beshort&0xf0	0x10			\bYUV240
1316276415Sdelphij>>101	beshort&0xf0	0x20			\bYWV422
1317276415Sdelphij>>101	beshort&0xf0	0x30			\bYWV444
1318276415Sdelphij>>101	beshort&0xf0	0x40			\bCMYK
1319276415Sdelphij>>101	beshort&0xf0	0x50			\bCMYKDIRECT
1320276415Sdelphij>>101	beshort&0xf0	0x60			\bNCOMPONENT
1321276415Sdelphij>>101	beshort&0xf0	0x70			\bRGB
1322276415Sdelphij>>101	beshort&0xf0	0x80			\bRGBE
1323276415Sdelphij>>101	beshort&0xf0	>0x80			\b(reserved 0x%x)
1324276415Sdelphij
1325276415Sdelphij# From: Johan van der Knijff <johan.vanderknijff@kb.nl>
1326276415Sdelphij#
1327276415Sdelphij# BPG (Better Portable Graphics) format
1328276415Sdelphij# http://bellard.org/bpg/
1329276415Sdelphij# http://fileformats.archiveteam.org/wiki/BPG
1330276415Sdelphij#
1331276415Sdelphij0	string	\x42\x50\x47\xFB	BPG (Better Portable Graphics)
1332276415Sdelphij!:mime  image/bpg
1333330569Sgordon
1334330569Sgordon# From: Joerg Jenderek
1335330569Sgordon# URL: https://en.wikipedia.org/wiki/Apple_Icon_Image_format
1336330569Sgordon0	string		icns		Mac OS X icon
1337330569Sgordon!:mime	image/x-icns
1338330569Sgordon!:apple	????icns
1339330569Sgordon!:ext icns
1340330569Sgordon>4	ubelong		>0
1341330569Sgordon# file size
1342330569Sgordon>>4	ubelong		x		\b, %d bytes
1343330569Sgordon# icon type
1344330569Sgordon>>8	string		x		\b, "%4.4s" type
1345330569Sgordon
1346330569Sgordon# TIM images
1347330569Sgordon0		lelong		0x00000010	TIM image,
1348330569Sgordon>4		lelong  	0x8		4-Bit,
1349330569Sgordon>4		lelong  	0x9		8-Bit,
1350330569Sgordon>4		lelong  	0x2		15-Bit,
1351330569Sgordon>4		lelong  	0x3		24-Bit,
1352330569Sgordon>4		lelong 		&8
1353330569Sgordon>>(8.l+12)	leshort		x		Pixel at (%d,
1354330569Sgordon>>(8.l+14)	leshort		x		\b%d)
1355330569Sgordon>>(8.l+16)	leshort		x		Size=%dx
1356330569Sgordon>>(8.l+18)	leshort		x		\b%d,
1357330569Sgordon>>4		lelong 		0x8		16 CLUT Entries at
1358330569Sgordon>>4		lelong 		0x9		256 CLUT Entries at
1359330569Sgordon>>12		leshort		x		(%d,
1360330569Sgordon>>14		leshort		x		\b%d)
1361330569Sgordon>4		lelong		^8
1362330569Sgordon>>12		leshort		x		Pixel at (%d,
1363330569Sgordon>>14		leshort		x		\b%d)
1364330569Sgordon>>16		leshort		x		Size=%dx
1365330569Sgordon>>18		leshort		x		\b%d
1366330569Sgordon
1367330569Sgordon# MDEC streams
1368330569Sgordon0		lelong		0x80010160	MDEC video stream,
1369330569Sgordon>16		leshort		x		%dx
1370330569Sgordon>18		leshort		x		\b%d
1371330569Sgordon#>8		lelong		x		%d frames
1372330569Sgordon#>4		leshort		x		secCount=%d;
1373330569Sgordon#>6		leshort		x		nSectors=%d;
1374330569Sgordon#>12		lelong		x		frameSize=%d;
1375330569Sgordon
1376330569Sgordon# BS encoded bitstreams
1377330569Sgordon2		leshort		0x3800		BS image,
1378330569Sgordon>6		leshort		x		Version %d,
1379330569Sgordon>4		leshort		x		Quantization %d,
1380330569Sgordon>0		leshort		x		(Decompresses to %d words)
1381330569Sgordon
1382330569Sgordon# Type: farbfeld image.
1383330569Sgordon# Url: http://tools.suckless.org/farbfeld/
1384330569Sgordon# From: Ian D. Scott <ian@iandouglasscott.com>
1385330569Sgordon#
1386330569Sgordon0		string		farbfeld	farbfeld image data,
1387330569Sgordon>8		ubelong		x		%dx
1388330569Sgordon>12		ubelong		x		\b%d
1389330569Sgordon
1390330569Sgordon# Type: Sega PVR image.
1391330569Sgordon# From: David Korth <gerbilsoft@gerbilsoft.com>
1392330569Sgordon# References:
1393330569Sgordon# - http://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
1394330569Sgordon# - https://github.com/yazgoo/pvrx2png
1395330569Sgordon# - https://github.com/nickworonekin/puyotools
1396330569Sgordon
1397330569Sgordon# Sega PVR header.
1398330569Sgordon0	name	sega-pvr-image-header
1399330569Sgordon>0x0C	leshort	x	%d x
1400330569Sgordon>0x0E	leshort	x	%d
1401330569Sgordon# Image format.
1402330569Sgordon>0x08	byte	0	\b, ARGB1555
1403330569Sgordon>0x08	byte	1	\b, RGB565
1404330569Sgordon>0x08	byte	2	\b, ARGB4444
1405330569Sgordon>0x08	byte	3	\b, YUV442
1406330569Sgordon>0x08	byte	4	\b, Bump
1407330569Sgordon>0x08	byte	5	\b, 4bpp
1408330569Sgordon>0x08	byte	6	\b, 8bpp
1409330569Sgordon# Image data type.
1410330569Sgordon>0x09	byte	0x01	\b, square twiddled
1411330569Sgordon>0x09	byte	0x02	\b, square twiddled & mipmap
1412330569Sgordon>0x09	byte	0x03	\b, VQ
1413330569Sgordon>0x09	byte	0x04	\b, VQ & mipmap
1414330569Sgordon>0x09	byte	0x05	\b, 8-bit CLUT twiddled
1415330569Sgordon>0x09	byte	0x06	\b, 4-bit CLUT twiddled
1416330569Sgordon>0x09	byte	0x07	\b, 8-bit direct twiddled
1417330569Sgordon>0x09	byte	0x08	\b, 4-bit direct twiddled
1418330569Sgordon>0x09	byte	0x09	\b, rectangle
1419330569Sgordon>0x09	byte	0x0B	\b, rectangular stride
1420330569Sgordon>0x09	byte	0x0D	\b, rectangular twiddled
1421330569Sgordon>0x09	byte	0x10	\b, small VQ
1422330569Sgordon>0x09	byte	0x11	\b, small VQ & mipmap
1423330569Sgordon>0x09	byte	0x12	\b, square twiddled & mipmap
1424330569Sgordon
1425330569Sgordon# Sega PVR (Xbox) image header.
1426330569Sgordon# Contains an embedded DirectDraw surface instead of PVR data.
1427330569Sgordon0	name	sega-pvr-xbox-dds-header
1428330569Sgordon>16	lelong	x	%d x
1429330569Sgordon>12	lelong	x	%d,
1430330569Sgordon>84	string	x	%.4s
1431330569Sgordon
1432330569Sgordon# Sega PVR image.
1433330569Sgordon0	string	PVRT
1434330569Sgordon>0x10	string	DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1435330569Sgordon>>0x20	use	sega-pvr-xbox-dds-header
1436330569Sgordon>0x10	belong	!0x44445320		Sega PVR image:
1437330569Sgordon>>0	use	sega-pvr-image-header
1438330569Sgordon
1439330569Sgordon# Sega PVR image with GBIX.
1440330569Sgordon0	string	GBIX
1441330569Sgordon>0x10	string	PVRT
1442330569Sgordon>>0x10	string	DDS\040\174\000\000\000 Sega PVR (Xbox) image:
1443330569Sgordon>>>0x20	use	sega-pvr-xbox-dds-header
1444330569Sgordon>>0x10	belong	!0x44445320		Sega PVR image:
1445330569Sgordon>>>0x10	use	sega-pvr-image-header
1446330569Sgordon>>0x08	lelong	x	\b, global index = %u
1447330569Sgordon
1448330569Sgordon# Sega GVR header.
1449330569Sgordon0	name	sega-gvr-image-header
1450330569Sgordon>0x0C	beshort	x	%d x
1451330569Sgordon>0x0E	beshort	x	%d
1452330569Sgordon# Image data format.
1453330569Sgordon>0x0B	byte	0	\b, I4
1454330569Sgordon>0x0B	byte	1	\b, I8
1455330569Sgordon>0x0B	byte	2	\b, IA4
1456330569Sgordon>0x0B	byte	3	\b, IA8
1457330569Sgordon>0x0B	byte	4	\b, RGB565
1458330569Sgordon>0x0B	byte	5	\b, RGB5A3
1459330569Sgordon>0x0B	byte	6	\b, ARGB8888
1460330569Sgordon>0x0B	byte	8	\b, CI4
1461330569Sgordon>0x0B	byte	9	\b, CI8
1462330569Sgordon>0x0B	byte	14	\b, DXT1
1463330569Sgordon
1464330569Sgordon# Sega GVR image.
1465330569Sgordon0	string	GVRT	Sega GVR image:
1466330569Sgordon>0x10	use	sega-gvr-image-header
1467330569Sgordon
1468330569Sgordon# Sega GVR image with GBIX.
1469330569Sgordon0	string	GBIX
1470330569Sgordon>0x10	string	GVRT	Sega GVR image:
1471330569Sgordon>>0x10	use	sega-gvr-image-header
1472330569Sgordon>>0x08	belong	x	\b, global index = %u
1473330569Sgordon
1474330569Sgordon# Light Field Picture
1475330569Sgordon# Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
1476330569Sgordon# Typical file extensions: .lfp .lfr .lfx
1477330569Sgordon
1478330569Sgordon0	belong	0x894C4650
1479330569Sgordon>4	belong	0x0D0A1A0A
1480330569Sgordon>12	belong	0x00000000	Lytro Light Field Picture
1481330569Sgordon>8	belong	x		\b, version %d
1482