GIF
JPG
PDF
XML
AI
GIF
Convert AI to GIF via Java
Native Java Library to Read, Write & Export AI to GIF without needing Adobe.
How to Convert AI to GIF Using Java
In order to render AI to GIF, we’ll use Aspose.PSD for Java API which is a feature-rich, powerful and easy to use conversion API for Java platform. You can download its latest version directly from Maven and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-psd</artifactId>
<version>version of aspose-psd API</version>
<classifier>jdk17</classifier>
</dependency>
Steps to Convert AI to GIF via Java
Aspose.PSD API makes it easy for the developers to convert AI file to GIF in just a few lines of code.
- Load input AI image
- Initialize GifOptions class object
- Specify image properties
- Save output GIF image
System Requirements
Aspose.PSD for Java supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.PSD for Java directly from Aspose Maven Repository .
Convert AI to GIF - Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String sourceFile = dataDir + "sourcefile.ai"; | |
String outFile = dataDir + "aitoimage.gif"; | |
// Load input AI file | |
AiImage aiimage = (AiImage)Image.load(sourceFileName); | |
// Initialize GifOptions class instance | |
GifOptions opts = new GifOptions(); | |
// Save output GIF image | |
image.save(outFile, opts); |