ImageFormat
Description
- Derived from
-
FileFormat abstract
- Extended by
-
GdalImageFormat sealed
The supported image file formats.
Each built-in image file format has a short text block that indicates which features are supported:
-
Write supported: …
See IFileFormat.CanWrite and WriteImage. -
IANA media type: …
See FileFormat.ForMime -
File extensions: …
See IFileFormat.CanRead3 -
Prefix sequence: …
See IFileFormat.CanRead1 -
Raw value range: …
See IImageInfo.Values
Public / Constants
Any
The file format is unknown and will be determined automatically.
Use IFileFormat.Next to walk through all registered formats.
BMP
The BMP image file format.
Write supported: yes
IANA media type: image/bmp
File extensions: .bmp
Prefix sequence: yes
Raw value range: no
When writing *.bmp files, the following information will be lost:
-
IImageInfo.Coverage, will become PixelCoverage.PixelIsArea.
-
IImageInfo.Gamma, will become
-2.2(sRGB). -
IGeorefInfo.Georef, will become
null. -
IImageInfo.Layer, will become HeightmapLayer.None.
-
IImageInfo.NoData, will become Maths.NanD.
-
PixelFormat.Grayscale, PixelFormat.SixteenBits, PixelFormat.Precision of IImageInfo.PixelFormat, will become PixelFormat.Truecolor / PixelFormat.Alpha.
-
IImageInfo.Range, will become PixelRange.DefaultUInt8.
DDS
The DDS image file format.
Write supported: no
IANA media type: none
File extensions: .dds
Prefix sequence: yes
Raw value range: no
GIF
The GIF image file format.
Write supported: no
IANA media type: image/gif
File extensions: .gif
Prefix sequence: yes
Raw value range: no
HDR
The HDR image file format.
Write supported: no
IANA media type: image/vnd.radiance
File extensions: .hdr
Prefix sequence: yes
Raw value range: no
JPEG
The JPEG image file format.
Write supported: no
IANA media type: image/jpeg
File extensions: .jpeg .jpg
Prefix sequence: yes
Raw value range: no
PNG
The PNG image file format.
Write supported: yes
IANA media type: image/png
File extensions: .png
Prefix sequence: yes
Raw value range: no
When writing *.png files, the following information will be lost:
-
IImageInfo.Coverage, will become PixelCoverage.PixelIsArea.
-
IImageInfo.Gamma, will become
0(linear sRGB). -
IGeorefInfo.Georef, will become
null. -
IImageInfo.Layer, will become HeightmapLayer.None.
-
IImageInfo.NoData, will become Maths.NanD.
-
PixelFormat.Precision of IImageInfo.PixelFormat will become PixelFormat.SixteenBits.
-
IImageInfo.Range, will become PixelRange.Identity.
PXB
The PXB image file format ('PiXel Buffer', proprietary).
Write supported: yes
IANA media type: none
File extensions: .pxb
Prefix sequence: yes
Raw value range: no
When writing *.pxb files, the following information will be lost:
-
IImageInfo.Coverage, will become PixelCoverage.PixelIsArea.
-
IImageInfo.Gamma, will become
0(linear sRGB). -
IGeorefInfo.Georef, will become
null. -
IImageInfo.Layer, will become HeightmapLayer.None.
-
IImageInfo.NoData, will become Maths.NanD.
-
IImageInfo.Range, will become PixelRange.Identity.
- See also
SimpleHttp
A ISimpleHttpImage object that uses Any to decode image data.
The image format is determined from the binary file format prefix (see IFileFormat.CanRead1), falling back to the content type (see FileFormat.ForMime), as returned by the web server.
TGA
The TGA image file format.
Write supported: yes
IANA media type: none
File extensions: .tga
Prefix sequence: no
Raw value range: no
When writing *.bmp files, the following information will be lost:
-
IImageInfo.Coverage, will become PixelCoverage.PixelIsArea.
-
IImageInfo.Gamma, will become
-2.2(sRGB). -
IGeorefInfo.Georef, will become
null. -
IImageInfo.Layer, will become HeightmapLayer.None.
-
IImageInfo.NoData, will become Maths.NanD.
-
PixelFormat.SixteenBits, PixelFormat.Precision of IImageInfo.PixelFormat, will become PixelFormat.Grayscale / PixelFormat.Truecolor / PixelFormat.Alpha.
-
IImageInfo.Range, will become PixelRange.DefaultUInt8.
TIFF
The TIFF image file format.
Write supported: no
IANA media type: image/tiff
File extensions: .tif .tiff
Prefix sequence: yes
Raw value range: yes
TIFF 6.0 Specifications
https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.html
-
BitsPerSample H.102
may be 8, 16, 32, or 64
must be the same for all samples
must not be 8 if SampleFormat is 3 -
Compression H.103
may be 1, 5, 8, or 32773 -
PhotometricInterpretation H.106
may be 0, 1, or 2 -
PlanarConfiguration H.11C
may be 1 or 2 -
Differencing Predictor H.13D
may be 1, 2 or 3 -
SampleFormat H.153
may be 1, 2, 3, or 4
must be the same for all samples
BigTIFF Extension
https://libtiff.gitlab.io/libtiff/specification/bigtiff.html
OGC GeoTIFF standard 1.1
https://docs.ogc.org/is/19-008r4/19-008r4.html
TIFFTAG_GDAL_METADATA
https://gdal.org/en/stable/drivers/raster/gtiff.html#metadata
-
SCALE,OFFSET
If defined, the scale and offset are applied to the values that are read from the image file, while PixelRange.DefaultFloat is used as the default pixel range.
TIFFTAG_GDAL_NODATA
https://gdal.org/en/stable/drivers/raster/gtiff.html#nodata-value
Public / Methods
ReadImage
Reads the given image.
- IOException
-
If an I/O error has occurred while opening the image data.
- GeorefException
-
If the image contains unsupported geo-referencing metadata.
- ValidatingException
-
If a validation error has occurred on data in or the returned image reader.
ReadTexture
Tries to read the given image data as a texture.
- IOException
-
If an I/O error has occurred.
- ValidatingException
-
If a validation error has occurred on data in or the returned image reader.
WriteImage
Writes an image to the given file.
- IOException
-
If this image format does not support writing (i.e. IFileFormat.CanWrite would return
false).
- See also
Protected / Methods
DoReadImage
Reads the given image.
- IOException
-
If an I/O error has occurred while opening the image.
- GeorefException
-
If the image contains unsupported geo-referencing metadata.