AVIF—Wolfram Documentation

  • Import fully supports the AVIF format.
  • Import also supports Exif 2.3 and IPTC 4.2 metadata standards.

Background & Context

    • MIME type: image/avif
    • AVIF raster image and compression format.
    • Commonly used for storing still or animated images.
    • AVIF is an acronym for AV1 Image File Format.
    • Binary format.
    • Supports RGB color space.
    • Supports up to 12 bits per color channel.
    • AVIF support is available in all major web browsers.
    • Developed by Alliance for Open Media.

Import & Export

  • Import["fte"] imports an AVIF file, returning a single Image object or a list of images.
  • Import["fte",elem] imports the specified element from an AVIF file.
  • The import format can be specified with Import["fte","AVIF"] or Import["fte",{"AVIF",elem,}].
  • See the following reference pages for full general information:
  • Importimport from a file
    CloudImportimport from a cloud object
    ImportStringimport from a string
    ImportByteArrayimport from a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "AnimatedImage"animated AVIF represented as an AnimatedImage object
    "Data"array of pixel values
    "Graphics"raster image, given as a Graphics object
    "Image"raster image, given as an Image object
    "Thumbnail"small thumbnail version of the image
    {"Thumbnail",size}thumbnail using the specified size
  • For multiframe AVIF files, the following elements can access different frames and their properties:
  • "GraphicsList"a list of graphics
    "ImageCount"number of stored frames
    "ImageList"a list of images
    "ThumbnailList"a list of thumbnail images
  • Import by default uses the "Image" element for a static AVIF and "ImageList" for an animated AVIF.
  • Advanced Import elements:
  • "BitDepth"bits used to represent each color channel in the file
    "CameraTopOrientation"orientation of the camera when the picture was taken
    "Channels"
  • the number of color channels used in the file
  • "ColorProfileData"embedded color profile, given as a ColorProfileData object
    "ColorSpace"color encoding used in the file
    "FlashUsed"
  • whether the flash was fired
  • "GeoPosition"latitude and longitude represented as a GeoPosition object
    "GPSDateTime"
  • image creation date and time registered by GPS
  • "ImageKeyframeInfo"keyframe information
    "RasterSize"raster dimensions
    "RedEyeCorrection"whether a red-eye correction was performed
    "Summary"
  • summary of the file
  • "SummarySlideView"slide view summary of all frames
  • Metadata elements:
  • "Exif"formatted Exif (Exchange image file format)
    "XMP"formatted XMP (Extensible metadata platform)
    "MetaInformation"combination of all formatted metadata present in the file
  • Raw metadata, as stored in the file, can be imported using "RawExif" and "RawXMP", which is returned as an association.
  • All Exif and XMP tags can be imported individually. Common tags include:
  • "ApertureValue"lens aperture
    "DateTime"image creation date and time
    "ExposureTime"exposure time, given in seconds
    "FlashInfo"
  • flash information: flash fired, red-eye correction, etc.
  • "FNumber"F number
    "FocalLength"actual focal length of the lens, given in millimeters
    "GPSAltitude"altitude of the GPS position
    "GPSLatitude"latitude of the GPS position
    "GPSLongitude"longitude of the GPS position

Import Options

Export Options

  • Details of options...

Examples

open all close all

Basic Examples  (2)

Import an AVIF image as an image:

Summary of an image:

Scope  (3)

Import  (3)

Import the image as graphics:

Import the raster size:

Import metadata elements:

Import Elements  (33)

Available Elements  (2)

List of available elements:

Get image-related information as a list of rules:

Data Representation  (9)

"AnimatedImage"  (1)

"Data"  (1)

Import the image data:

Create an image from imported data:

"Graphics"  (1)

"GraphicsList"  (1)

Import the data as a list of Graphics objects:

"Image"  (1)

Import as an Image object:

This is the default import element for static AVIF:

"ImageList"  (2)

Import the data as a list of Image objects:

This is the default import element for animated AVIF:

Specify the frames to import:

"Thumbnail"  (1)

Import a thumbnail of an image:

"ThumbnailList"  (1)

Import thumbnails of all the frames in an image:

Metadata  (22)

"BitDepth"  (1)

Get the bit count for the representation of each color channel:

"CameraTopOrientation"  (1)

Get the camera orientation at the capture time:

"Channels"  (1)

Get the number of image channels:

"ColorProfileData"  (1)

Get the embedded color profile, given as a ColorProfileData object:

The color profile is stored in the ColorSpace option of the imported image:

"ColorSpace"  (1)

Get the color encoding used on export:

Use ImageColorSpace to get the color space of an imported image:

"Exif"  (3)

Get Exif metadata:

Extract an individual tag from the association:

Individual Exif tags can also be imported directly:

Some Exif tags are processed to give more detailed information:

Compare with the raw "Orientation" tag:

"FlashUsed"  (1)

Import a tag that shows whether the flash fired:

"GPSDateTime"  (1)

Get the image creation date and time registered by GPS:

"ImageCount"  (1)

Get the number of frames stored in the file:

"ImageKeyframeInfo"  (2)

Get the keyframe information for a single frame file:

Keyframe information for an animated image:

"MetaInformation"  (1)

Get all the metainformation:

"RasterSize"  (2)

Get the dimensions of the image stored in the file:

Using ImageDimensions on an imported image gives the same result:

Specify the raster size of the imported image with the RasterSize option:

"RawExif"  (1)

Import raw Exif data:

Raw Exif tags return the actual values stored in the file:

When importing "Exif", most tags are processed:

"RawXMP"  (1)

Import unprocessed XMP metadata:

When importing processed XMP, missing tags are automatically removed:

"RedEyeCorrection"  (1)

Whether a red-eye correction was performed:

"Summary"  (1)

"SummarySlideView"  (1)

Get the image frames' summary:

"XMP"  (1)

Get XMP metadata:

Extract the XMP "XMPBasicSchema" metadata:

Import Options  (4)

"ImageTopOrientation"  (1)

By default, images are imported with the native orientation stored in the file:

Specify the side that is supposed to be on the top:

IncludeMetaInformation  (2)

By default, all available metadata is imported:

Possible classes of metadata for AVIF files are "Exif" and "XMP":

Import the image with no metadata:

RasterSize  (1)

By default, images are imported in their full resolution:

Specify the raster size of the imported AVIF image: