Render & View GIF File in Java

Native and high performance GIF file viewer API for Java, J2EE and J2SE based applications, supporting a wide range of additional features to customize the appearance of the output document format.

Download Free Trial

About GroupDocs.Viewer for Java API

Enable your Java applications to display over 150+ file formats in HTML, PDF or image modes using GroupDocs.Viewer for Java APIs without any additional software installed; such as Microsoft Office, Apache Open Office, Adobe Acrobat Reader etc. Developers can easily view all popular images and document types including Microsoft Office, OpenDocument, HTML, PDF, Archive, Diagrams, Photoshop, AutoCAD and programming language formats inside the Java applications with fast and highest quality rendering.

Steps for Viewing GIF File in Java

GroupDocs.Viewer makes it easy for Java developers to add GIF file viewing feature in their applications using a few lines of code.

  • Create an instance of Viewer class and load the GIF file with full path.
  • Set view options to convert GIF file into PNG format.
  • Convert file and check the output in the current directory.

System Requirements

GroupDocs.Viewer for Java APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environment: NetBeans, IntelliJ IDEA, Eclipse etc.
  • Java Runtime Environment: Java 7 (1.7) and above
  • Get the latest version of GroupDocs.Viewer for Java from GroupDocs Artifact Repository

// Instantiate viewer
try (Viewer viewer = new Viewer("sample.gif"))
	// Set view options
	PngViewOptions viewOptions = new PngViewOptions();
	// Convert file to PNG and check the output in the current directory

GIF Viewer Live Demos

Display GIF file right now by visiting GroupDocs.Viewer Live Demos website.
The live demo has the following benefits

No need to download GroupDocs API.

No need to write any code

Just upload the source file to have an instant display.

Get the download link to save the file on your machine.

About GIF File Format

A GIF or Graphical Interchange Format is a type of highly compressed image. Owned by Unisys, GIF uses the LZW compression algorithm that does not degrade the image quality. For each image GIF typically allow up to 8 bits per pixel and up to 256 colours are allowed across the image. In contrast to a JPEG image, which can display up to 16 million colours and fairly touches the limits of the human eye. Back when the internet emerged, GIFs remained the best choice because they required low bandwidth and compatible for the graphics that consume solid areas of colour. An animated GIF combines numerous images or frames into a single file and displays them in a sequence to generate an animated clip or a short video. The colour limitations are up to 256 for each frame and are likely to be the least suitable for reproducing other images and photographs with colour gradient.

Read More

Other File Formats Rendering & Viewing

Multi format documents and images viewer API for Java. View some of the popular file formats below without any external viewers.

Java DOC Viewer

(Microsoft Word Document)

Java DOCM Viewer

(Microsoft Word Macro-Enabled Document)

Java DOCX Viewer

(Microsoft Word Open XML Document)

Java DOT Viewer

(Microsoft Word Document Template)

Java DOTM Viewer

(Microsoft Word Macro-Enabled Template)

Java DOTX Viewer

(Word Open XML Document Template)

Java RTF Viewer

(Rich Text File Format)

Java TXT Viewer

(Plain Text File Format)

Java XLS Viewer

(Microsoft Excel Binary File Format)

Java XLSX Viewer

(Microsoft Excel Open XML Spreadsheet)

Java XLSM Viewer

(Microsoft Excel Macro-Enabled Spreadsheet)

Java XLSB Viewer

(Microsoft Excel Binary Spreadsheet File)

Java XLTX Viewer

(Microsoft Excel Open XML Template)

Java TSV Viewer

(Tab Separated Values File)

Java XLAM Viewer

(Microsoft Excel Macro-Enabled Add-In)

Java CSV Viewer

(Comma Separated Values File)

Java PPT Viewer

(PowerPoint Presentation)

Java PPS Viewer

(Microsoft PowerPoint Slide Show)

Java PPTX Viewer

(PowerPoint Open XML Presentation)

Java PPSX Viewer

(PowerPoint Open XML Slide Show)

Java POTX Viewer

(Microsoft PowerPoint Open XML Template)

Java POTM Viewer

(Microsoft PowerPoint Template)

Java PPTM Viewer

(Microsoft PowerPoint Presentation)

Java PPSM Viewer

(Microsoft PowerPoint Slide Show)

Java PDF Viewer

(Adobe Portable Document Format)

Java XPS Viewer

(Open XML Paper Specification)

Java TEX Viewer

(LaTeX Source Document)

Java ODS Viewer

(Open Document Spreadsheet)

Java ODP Viewer

(OpenDocument Presentation File Format)

Java OTP Viewer

(Origin Graph Template)

Java ODT Viewer

(Open Document Text)

Java OTT Viewer

(Open Document Template)

Java VST Viewer

(Microsoft Visio 2003-2010 XML Drawing)

Java TIFF Viewer

(Tagged Image File Format)

Java JPEG Viewer

(JPEG Image)

Java PNG Viewer

(Portable Network Graphic)

Java GIF Viewer

(Graphical Interchange Format File)

Java BMP Viewer

(Bitmap File Format)

Java ICO Viewer

(Microsoft Icon File)

Java PSD Viewer

(Adobe Photoshop Document)

Java WMF Viewer

(Windows Metafile)

Java EMF Viewer

(Enhanced Metafile Format)

Java WEBP Viewer

(Raster Web Image File Format)

Java SVG Viewer

(Scalable Vector Graphics File)

Java JP2 Viewer

(JPEG 2000 Core Image File)

Java MPP Viewer

(Microsoft Project Document)

Java MPT Viewer

(Microsoft Project Template)

Java HTML Viewer

(Hyper Text Markup Language)

Java MHT Viewer

(MIME Encapsulation of Aggregate HTML)

Java MHTML Viewer

(MIME Encapsulation of Aggregate HTML)

Java MSG Viewer

(Microsoft Outlook E-mail Message)

Java EML Viewer

(E-mail Message)

Java ONE Viewer

(Microsoft OneNote)

Java WMF Viewer

(Windows Metafile)

Java EMF Viewer

(Windows Enhanced Metafile)

Java PSD Viewer

(Adobe Photoshop Document)

Java VSD Viewer

(Microsoft Visio 2003-2010 Drawing)

Java VSDX Viewer

(Microsoft Visio Drawing)

Java VSS Viewer

(Microsoft Visio 2003-2010 Stencil)

Java VDX Viewer

(Microsoft Visio 2003-2010 XML Drawing)

Java VDW Viewer

(Microsoft Visio 2010 Web Drawing)

Java EPUB Viewer

(Digital E-Book File Format)