Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
GIF (.gif)
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • JPEG
    • PNG
    • TIFF
    • WebP
  • Related Guides
    • Creating Web Pages
    • Graphics Importing & Exporting
    • Image Processing
    • Importing & Exporting
    • Listing of All Formats
    • Multimedia Formats
    • Numerical Data
    • Raster Image Formats
    • Web Formats
    • Web Operations
  • Tech Notes
    • Importing Graphics and Sounds
    • Exporting Graphics and Sounds
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • JPEG
      • PNG
      • TIFF
      • WebP
    • Related Guides
      • Creating Web Pages
      • Graphics Importing & Exporting
      • Image Processing
      • Importing & Exporting
      • Listing of All Formats
      • Multimedia Formats
      • Numerical Data
      • Raster Image Formats
      • Web Formats
      • Web Operations
    • Tech Notes
      • Importing Graphics and Sounds
      • Exporting Graphics and Sounds
IMPORT/EXPORT FORMAT
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • JPEG
    • PNG
    • TIFF
    • WebP
  • Related Guides
    • Creating Web Pages
    • Graphics Importing & Exporting
    • Image Processing
    • Importing & Exporting
    • Listing of All Formats
    • Multimedia Formats
    • Numerical Data
    • Raster Image Formats
    • Web Formats
    • Web Operations
  • Tech Notes
    • Importing Graphics and Sounds
    • Exporting Graphics and Sounds
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • JPEG
      • PNG
      • TIFF
      • WebP
    • Related Guides
      • Creating Web Pages
      • Graphics Importing & Exporting
      • Image Processing
      • Importing & Exporting
      • Listing of All Formats
      • Multimedia Formats
      • Numerical Data
      • Raster Image Formats
      • Web Formats
      • Web Operations
    • Tech Notes
      • Importing Graphics and Sounds
      • Exporting Graphics and Sounds

GIF (.gif)

  • Import and Export fully support the GIF89a standard for both static and animated GIF images.

Background & Context

    • Registered MIME type: image/gif
    • GIF raster image format.
    • Commonly used for static and animated graphics on the web.
    • GIF is an acronym for Graphics Interchange Format.
    • Binary format.
    • Uses LZW lossless compression after restriction to an 8‐bit color palette.
    • Supports transparency.
    • Developed in 1987 by CompuServe.

Import & Export

  • Import["file.gif"] imports a GIF file, returning a single Image object or a list of images.
  • Import["file.gif",elem] imports the specified element from a GIF file.
  • The import format can be specified with Import["file","GIF"] or Import["file",{"GIF",elem,…}].
  • Export["file.gif",expr] exports graphics, images, or any other expression to GIF.
  • Export["file.gif",{expr1,expr2,…}] exports a list of graphics or images as an animation.
  • Export["file.gif",Manipulate[…]] exports an animated demonstration of a Manipulate object.
  • When exporting Wolfram Language graphics or arbitrary expressions to GIF, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their raster size.
  • Because GIF is a raster image format, all fonts are rasterized on export.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Notebook Interface

  • In the notebook front end, Insert ▶ Picture and the Open menu allow import of a GIF file into a cell.
  • Save Selection As exports the selected part of a notebook as a GIF file.

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:
  • "Data"array of RGB color values
    "Graphics"first frame of a GIF file, given as a Graphics object
    "Image"first frame of a GIF file, given as an Image object
    "RawData"array of color map indices
    "Thumbnail"thumbnail of the first image
  • Data representation elements for animated GIF files:
  • "Animation"animated GIF represented as an animation object
    {"GraphicsList",frames}frames of an animated GIF as a list of Graphics objects (default frames=All)
    {"ImageList",frames}frames of an animated GIF as a list of Image objects (default frames=All)
    {"ThumbnailList",frames}a list of thumbnails (default frames=All)
  • Import by default uses the "Image" element for a static GIF and "ImageList" for an animated GIF.
  • Import of an animated GIF with element "Image" gives the first frame of the animation.
  • Export by default generates an animated GIF if the expression supplied is a list of images or a Manipulate, and a static GIF otherwise.
  • Export with element "Graphics" or "Image" always generates a static GIF.
  • Advanced Import elements:
  • "AnimationRepetitions"how many times the animation is played before stopping
    "Background"background color shown in transparent image regions
    "BitDepth"bits used to represent each color channel in the file
    "Channels"the number of color channels used in the file
    "ColorMap"color reduction palette, given as a list of color values
    "ColorSpace"color encoding used in the file
    "Comments"user comments stored in the file
    "DisplayDurations"display durations of animation frames, given in seconds
    "DisposalOperation"disposal operation before creating the next frame
    "GlobalColorMap"color palette used by default for individual animation frames
    "ImageCount"number of frames in an animated GIF
    "RasterSize"raster dimensions
    "Summary"summary of the file
    "SummarySlideView"slide-view summary of all frames
    "TransparentColor"color to be interpreted as transparent
  • Importing the "ColorMap" element from an animated GIF will return the color maps of all frames as a list.
  • GIF supports color palettes of at most 256 colors, always storing colors at a resolution of 8 bits per color channel.
  • "DisposalOperation" specifies how to dispose the current frame before creating the next frame. Possible values are:
  • "None"no disposal
    "Background"replace with a background color
    "Previous"replace with the previous frame
    Missing["NotAvailable"]missing disposal operation

Import Options

  • Import options include:
  • ImageSizeAutomaticoverall image size
    "ImageTopOrientation"Toporientation of the image as stored in the file
    RasterSizeAutomaticdimensions of the image
  • Possible settings for "ImageTopOrientation" are Automatic, Top, Bottom, Left or Right.

Export Options

  • Export options include:
  • "ColorMapLength"Automaticnumber of colors to use for quantization
    "ColorMapMode""Local"whether to create a local or global color map
    Dithering"FloydSteinberg"dithering algorithm used for generating the color-reduction table
    ImageFormattingWidth$ImageFormattingWidthtarget width when formatting an object
    ImageSizeAutomaticoverall image size
    "ImageTopOrientation"Toporientation of the image as stored in the file
    "QuantizationMethod"Automatica method to use for quantization
    RasterSizeAutomaticdimensions of the image
    "TransparentColor"Automaticcolor to be interpreted as transparent
  • Images are by default exported at full size, typically with some automatic quantization.
  • The value of "ColorMapLength" can be a positive integer not greater than 256.
  • Possible settings for "ColorMapMode" are "Local" or "Global".
  • Possible settings for Dithering are "FloydSteinberg" or None.
  • Possible settings for "ImageTopOrientation" are Automatic, Top, Bottom, Left or Right.
  • Possible settings for "QuantizationMethod" are Automatic, "MedianCut", "MinVariance" or "Octree".
  • Export options for animated GIFs:
  • AnimationRepetitionsInfinityhow many times the animation plays before stopping
    "ControlAppearance"Automatichow Manipulate control elements are rendered in the exported file
    "DisplayDurations"Automaticdisplay duration for each frame in seconds
    "DisposalOperation"Automaticdisposal operation before creating the next frame
    "Interlaced"Falsewhether to store graphics in interlaced form to allow progressive rendering
    "RemoveDuplicatedFrames"Falsewhether to remove duplicated frames
  • The following settings can be given for "ControlAppearance":
  • Automaticcaptures user controls exactly as seen in the notebook interface, using the style elements of the local computer system
    "Generic"renders graphical controls in a generic style
    Noneexcludes control elements when exporting an animation
  • "DisplayDurations"->{d1,d2,…} specifies the display durations for each frame in an animated GIF.
  • Possible values for "DisposalOperation" are:
  • Automatic or Noneno disposal
    "Background"replace with a background color
    "Previous"replace with the previous frame

Examples

open all close all

Basic Examples  (4)

Import a GIF file:

Summary of the image:

Read an animated GIF as a list of images:

Import this file as an animation:

Export an image object to GIF:

Scope  (3)

This rasterizes an arbitrary expression and converts the result to a GIF file:

Import the resulting file:

Read an animated GIF as a list of images:

Import this file as an animation:

Create an animated GIF by exporting a list of Graphics expressions:

Import the resulting file as an animation:

Import Elements  (26)

Available Elements  (3)

List of all available elements:

Get image-related information as a list of rules:

Import some image options:

The "Options" element is different from the options stored in the imported image:

Data Representation  (11)

"Animation"  (1)

Import frames into an animation:

"ColorMap"  (1)

Get the color-reduction palette from the first frame of an animated GIF image:

Visualize the color-reduction palette:

Apply the color map to the raw data to create the stored image:

"Data"  (1)

Get the array of color values for each icon:

Construct images of the proper type:

"Graphics"  (1)

Import as a Graphics object:

"GraphicsList"  (1)

Get the list of graphics objects:

"GlobalColorMap"  (1)

Get the global color-reduction palette from a GIF image:

Apply the color map to the raw data to create the stored image:

"Image"  (1)

Import the file as an Image object:

This is the default import element for a GIF file containing only one frame:

"ImageList"  (1)

This is the default import element for a multiframe GIF.

Get the data as a list of Image objects:

"RawData"  (1)

Get the raw data from a GIF file:

Plot the array of raw data:

Use the color map to create the stored image:

"Thumbnail"  (1)

Import a thumbnail of the image:

"ThumbnailList"  (1)

Import a list of thumbnails from an animated GIF file:

Metadata  (12)

"AnimationRepetitions"  (1)

Get the number of repetitions of the animation that are played before stopping:

"Background"  (1)

Background color used when "DisposalOperation" for a frame is "Background":

"BitDepth"  (1)

Get the number of bits used for representing each color channel:

"Channels"  (1)

Get the number of image channels:

"ColorSpace"  (1)

Get the color encoding used on export:

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

"Comments"  (1)

Get the user comments stored in the file:

"DisplayDurations"  (1)

Get the display durations of the frames of the file given in seconds:

"DisposalOperation"  (1)

Get the disposal operations:

"ImageCount"  (1)

Get the number of images stored in the file:

"RasterSize"  (1)

Get the dimensions of the images stored in the file:

Using ImageDimensions on an imported image gives the same result:

"Summary"  (1)

Get the image summary:

"SummarySlideView"  (1)

Get the summary of all images stored in the file:

Import Options  (2)

"ImageTopOrientation"  (1)

By default, the upright image is imported:

Specify the orientation of the imported image:

RasterSize  (1)

By default, images are imported in their full resolution:

Specify the raster size of the imported BMP image:

Export Options  (12)

"AnimationRepetitions"  (1)

Specify how many times the animation plays before stopping:

"ColorMapLength"  (1)

Decrease the file size by specifying a smaller length of a color map:

"ControlAppearance"  (1)

Specify whether the control menus in Manipulate should be exported as well:

Export no controls:

Export with graphical controls:

"DisplayDurations"  (1)

Specify display duration (in seconds) for each frame of animation:

Dithering  (1)

Show the effect of dithering:

Show the areas with significant difference:

"Interlaced"  (1)

Store a graphic in interlaced form to allow progressive rendering:

"QuantizationMethod"  (1)

Show the effects of various quantization methods:

Show the areas with significant difference:

RasterSize  (1)

By default, images are exported in their full resolution:

Specify the raster size of the imported image:

"TransparentColor"  (1)

Specify the color to be interpreted as transparent:

The transparent color is replaced with Transparent:

"DisposalOperation"  (3)

Export an animated GIF with a transparent background and default "DisposalOperation":

Each frame is drawn on top of the previous one:

To get frames drawn always on the clear canvas (filled with a background color), use "DisposalOperation"->"Background":

Specify disposal operations for each frame separately:

Specify None as a disposal operation for the first frame to see the difference between the "Previous" and "Background" operations:

Possible Issues  (1)

When an animated GIF has different display durations, importing as "Animation" uses the average display duration for all frames:

Create a viewer that respects different timings:

See Also

Import  Export  CloudExport  CloudImport

Formats: JPEG  PNG  TIFF  WebP

Tech Notes

    ▪
  • Importing Graphics and Sounds
  • ▪
  • Exporting Graphics and Sounds

Related Guides

    ▪
  • Creating Web Pages
  • ▪
  • Graphics Importing & Exporting
  • ▪
  • Image Processing
  • ▪
  • Importing & Exporting
  • ▪
  • Listing of All Formats
  • ▪
  • Multimedia Formats
  • ▪
  • Numerical Data
  • ▪
  • Raster Image Formats
  • ▪
  • Web Formats
  • ▪
  • Web Operations

History

Introduced in 1999 (4.0) | Updated in 2019 (12.0) ▪ 2021 (12.3) ▪ 2022 (13.1) ▪ 2022 (13.2) ▪ 2024 (14.1)

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English