JPEG—JPEG JFIF文件格式
司机简称
JPEG
生成依赖项
(提供内部libjpeg)
JPEG JFIF格式支持读取和批处理写入,但不支持就地更新。JPEG文件表示为一个带(灰度)或三个带(RGB)的数据集,这些数据集具有字节值带。
驱动程序将自动将颜色空间为YCbCr、CMYK或YCbCrK的图像转换为RGB,除非将GDAL_JPEG_to_RGB设置为“否”(默认为“是”)。当颜色空间转换为RGB时,源颜色空间在图像结构域的源颜色空间元数据中指示。
EXIF元数据可以从JPEG文件中读取(但即使设置了EXIF_GPSLatitude和EXIF_GPSLongitude标记,也不会导致地理参考图像)。但是,如果存在后缀为.jgw、.jpgw/.jpegw或.wld的ESRI world文件,则将读取该文件并用于建立图像的地理变换。如果可用,MapInfo.tab文件也将用于地理参考。概述可以作为外部.ovr文件为JPEG文件构建。
驱动程序还支持“附加到文件的zlib压缩掩码”方法,少数数据提供程序使用该方法添加位掩码来标识无效数据的像素。见 RFC 15:带屏蔽 更多详情。
驱动程序可以处理位掩码,其中位以最高有效位优先(而通常的约定是最低有效位优先)。驱动程序将尝试自动检测这种情况,但启发式可能会失败。在这种情况下,可以将JPEGu MASKu BITu ORDER配置选项设置为MSB。指定不可完全忽略bitu的掩码。
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. This can be used to apply JPEG compression to datasets that exceed the maximum dimensions of 65,535x65,535 pixels for a single JPEG image.
还可以将JPEG驱动程序与libjpeg turbo一起使用,libjpeg、API和ABI的版本与IJG libjpeg-6b兼容,IJG libjpeg-6b使用MMX、SSE和SSE2 SIMD指令来加速基准JPEG压缩/解压缩。
Starting with GDAL 3.4, read and write support for JPEG images with 12-bit sample is enabled by default (if JPEG support is also enabled), using GDAL internal libjpeg (based on IJG libjpeg-6b, with additional changes for 12-bit sample support). Support for JPEG with 12-bit sample is independent of whether 8-bit JPEG support is enabled through internal IJG libjpeg-6b or external libjpeg (like libjpeg-turbo)
XMP元数据可以从文件中提取,并作为XML原始内容存储在XML:XMP元数据域中。
嵌入的EXIF缩略图(使用JPEG压缩)可以用作概述,并由GDAL生成。
驱动程序功能
Supports CreateCopy()
This driver supports the GDALDriver::CreateCopy()
operation
Supports Georeferencing
This driver supports georeferencing
Supports VirtualIO
This driver supports virtual I/O operations (/vsimem/, etc.)
颜色配置文件元数据
GDAL可以处理颜色配置文件域中的以下颜色配置文件元数据:
源ICC配置文件(文件中嵌入Base64编码的ICC配置文件。)
请注意,此元数据属性只能用于原始像素数据。如果已自动转换为RGB,则无法使用颜色配置文件信息。
此元数据标记可以用作创建选项。
错误管理
在解码时,libjpeg对JPEG数据流中的一些错误具有弹性,并将尽可能地从中恢复。此类错误将报告为GDAL警告,但也可以通过将GDALu ERRORu ON u LIBJPEGu WARNING configuration选项设置为true,将其视为true错误。
创建选项
JPEG files are created using the "JPEG" driver code. Only Byte band types are supported.
Only 1 (greyscale), 3 band (input should be in RGB colorspace.
the driver will convert it automatically to YCbCr colorspace for storage, and
will expose it back as RGB on reading) or 4 band
(input should already by in CMYK colorspace. It will be exposed as RGB on reading
by default, unless the GDAL_JPEG_TO_RGB
configuration option
is set to NO) configurations.
JPEG file creation is implemented by the batch (CreateCopy) method. YCbCrK colorspace is 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.
WORLDFILE=YES :强制生成关联的ESRI world文件(扩展名为.wld)。
QUALITY=n :默认情况下,质量标志设置为75,但此选项可用于选择其他值。值必须在10-100之间。值越低,压缩比越高,但图像质量越差。95以上的值并不是意味着更好的质量,但可以大得多。
PROGRESSIVE=ON :已启用生成渐进式JPEG。在某些情况下,在下载完整文件之前,这些文件将在Netscape和Internet Explorer等查看器中显示分辨率降低的图像。但是,有些应用程序根本无法读取渐进式jpeg。GDAL可以读取渐进式jpeg,但不利用其渐进性。
INTERNAL_MASK=YES/NO :默认情况下,如果需要,将写入“zlib压缩掩码附加到文件”方法中的内部掩码,以标识不是有效数据的像素。通过将此选项设置为“否”,可以禁用此选项。
ARITHMETIC=YES/NO :启用算术编码。由于可能的法律限制,未在所有libjpeg版本中启用。
BLOCK=1...16 :(libjpeg>=8c)DCT块大小。1到16之间的所有值都是可能的。默认值为8(基线格式)。8以外的值将生成与libjpeg 8c之前的版本不兼容的文件。
COLOR_TRANSFORM=RGB or RGB1 :(libjpeg>=9)。为无损RGB设置为RGB1。注意:这将产生与libjpeg 9之前的版本不兼容的文件。
SOURCE_ICC_PROFILE=value :用Base64编码的ICC配置文件。
COMMENT=string :要嵌入注释JPEG标记的字符串。读取时,这些字符串将在注释元数据项中公开。
EXIF_THUMBNAIL=YES/NO :是否生成EXIF缩略图(概述),它本身是JPEG压缩的。默认为“否”。如果启用,则缩略图的最大尺寸将为128(如果未指定缩略图宽度和缩略图高度)。
THUMBNAIL_WIDTH=n :缩略图的宽度。仅当EXIFu THUMBNAIL=YES时才考虑。
THUMBNAIL_HEIGHT=n :缩略图的高度。仅当EXIFu THUMBNAIL=YES时才考虑。
WRITE_EXIF_METADATA=YES/NO :(从GDAL 2.3开始)。是否在EXIF段中写入EXIF_xxxx元数据项。默认为“是”。
FLIR metadata
3.3 新版功能.
Metadata encoded according to the FLIR convention (infrared images) is available
in the FLIR
metadata domain.
Metadata from the following sections is supported:
Header
RawData
CameraInfo
PaletteInfo
GPSInfo
Consult https://exiftool.org/TagNames/FLIR.html for details.
The thermal image data, stored either as raw data or in PNG, is exposed as a
GDAL subdataset whose name is JPEG:"filename.jpg":FLIR_RAW_THERMAL_IMAGE