File: frmt_jpeg.html

package info (click to toggle)
gdal 1.10.1+dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (109 lines) | stat: -rw-r--r-- 5,047 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<html>
<head>
<title>JPEG -- JPEG JFIF File Format</title>
</head>

<body bgcolor="#ffffff">

<h1>JPEG -- JPEG JFIF File Format</h1>

The JPEG JFIF format is supported for reading, and batch writing, but not
update in place.  JPEG files are represented as one band (greyscale) or three 
band (RGB) datasets with Byte valued bands.<p>

The driver will automatically convert images whose color space is YCbCr, CMYK or
YCbCrK to RGB, unless GDAL_JPEG_TO_RGB is set to NO (YES is the default). When
color space translation to RGB is done, the source color space is indicated in the
SOURCE_COLOR_SPACE metedata of the IMAGE_STRUCTURE domain.<p>

There is currently no support for georeferencing information or metadata for
JPEG files. But if an ESRI world file exists with the .jgw, .jpgw/.jpegw or 
.wld suffixes, it will be read and used to establish the geotransform for 
the image. If available a MapInfo .tab file will also be used for 
georeferencing.  Overviews can be built for JPEG files as an external 
.ovr file.<p>

The driver also supports the "zlib compressed mask appended to the file" 
approach used by a few data providers to add a bitmask to identify pixels that 
are not valid data.
See <a href="http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask">RFC 15</a> for further details.<p>

Starting with GDAL 1.10.1, the driver can deal with bitmask where the bits are
ordered with most significant bit first (whereas the usual convention is least significant
bit first). The driver will try to autodetect that situation, but the heuristics
may fail. In that circumstance, you can set the JPEG_MASK_BIT_ORDER configuration option to
MSB. Bitmask can also be completely ignored by specifying JPEG_READ_MASK to NO.<p>

The GDAL JPEG Driver is built using the Independent JPEG Group's jpeg
library.  Also note that the GeoTIFF driver supports tiled TIFF with JPEG
compressed tiles.<p>

To be able to read and write JPEG images with 12-bit sample, you can build GDAL
with its internal libjpeg (based on IJG libjpeg-6b, with additional changes for 12-bit
sample support), or explicitly pass --with-jpeg12=yes to configure script when building
with external libjpeg. See <a href="http://trac.osgeo.org/gdal/wiki/TIFF12BitJPEG">
"8 and 12 bit JPEG in TIFF"</a> wiki page for more details.<p>

It is also possible to use the JPEG driver with the libjpeg-turbo, a
version of libjpeg, API and ABI compatible with IJG libjpeg-6b, which uses MMX, SSE,
and SSE2 SIMD instructions to accelerate baseline JPEG compression/decompression.<p>

Starting with GDAL 1.9.0, XMP metadata can be extracted from the file, and will be
stored as XML raw content in the xml:XMP metadata domain.<p>

<h2>Creation Options</h2>

JPEG files are created using the "JPEG" driver code.  Only Byte band types
are supported, and only 1 and 3 band (RGB) configurations.  JPEG file creation
is implemented by the batch (CreateCopy) method. YCbCr, CMYK or YCbCrK colorspaces
are not supported in creation. If the source dataset has a nodata mask, it will be
appended as a zlib compressed mask to the JPEG file.<p>

<ul>

<li> <b>WORLDFILE=YES</b>: Force the generation of an associated ESRI world
file (with the extension .wld).
  <p>

<li> <b>QUALITY=n</b>: By default the quality flag is set to 75, but this
option can be used to select other values.  Values must be in the
range 10-100.  Low values result in higher compression ratios, but poorer
image quality.  Values above 95 are not meaningfully better quality but
can but substantially larger.<p>

<li> <b>PROGRESSIVE=ON</b>: Enabled generation of progressive JPEGs.  In some
cases these will display a reduced resolution image in viewers such as
Netscape, and Internet Explorer, before the full file has been downloaded.
However, some applications cannot read progressive JPEGs at all. GDAL can
read progressive JPEGs, but takes no advantage of their progressive nature.<p>

<li> <b>INTERNAL_MASK=YES/NO</b>: By default, if needed, an internal mask
in the "zlib compressed mask appended to the file" approach is written
to identify pixels that are not valid data. Starting with GDAL 1.10, this
can be disabled by setting this option to NO.<p>

<li> <b>ARITHMETIC=YES/NO</b>: (Starting with GDAL 1.10) To enable arithmetic coding.
Not enabled in all libjpeg builds, because of possible legal restrictions.<p>

<li> <b>BLOCK=1...16</b>: (Starting with GDAL 1.10 and libjpeg 8c) DCT block size.
All values from 1 to 16 are possible. Default is 8 (baseline format). A value other
than 8 will produce files incompatible with versions prior to libjpeg 8c.<p>

<li> <b>COLOR_TRANSFORM=RGB or RGB1</b>: (Starting with GDAL 1.10 and libjpeg 9).
Set to RGB1 for lossless RGB. Note: this will produce files incompatible with
versions prior to libjpeg 9.<p>

</ul>

<h3>See Also:</h3>
<p>

<ul>
<li> <a href="http://www.ijg.org/">Independent JPEG Group</a></li>
<li> <a href="http://sourceforge.net/projects/libjpeg-turbo/">libjpeg-turbo</a></li>
<li> <a href="frmt_gtiff.html">GDAL GeoTIFF driver</a></li>
</ul>

</body>
</html>