GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - square/gifencoder: A pure Java library implementing the GIF89a specification. Suitable for use on Android.

BranchesTags
Open more actions menu

Latest commit

 

History

69 Commits
69 Commits

Folders and files

NameName
Last commit message
Last commit date
.buildscript
.buildscript
 
 
gallery
gallery
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
checkstyle.xml
checkstyle.xml
 
 
pom.xml
pom.xml
 
 

Repository files navigation

gifencoder

gifencoder is a pure Java library implementing the GIF89a specification. It does not use AWT's BufferedImage, so it can be used on Android and other platforms lacking AWT.

There is currently no support for transparency.

Quantization and dithering

GIF images are limited to 256 colors. If you supply an image with more colors, gifencoder's default behavior is to perform median-cut quantization with Floyd-Steinberg dithering. You can configure this behavior through ImageOptions. A handful of quantizers and ditherers are provided, but you can also plug in your own implementation.

Basic usage

int[][] rgbDataFrame1 = ...;
int[][] rgbDataFrame2 = ...;
int[][] rgbDataFrame3 = ...;

OutputStream outputStream = new FileOutputStream("test.gif");
ImageOptions options = new ImageOptions();
new GifEncoder(outputStream, width, height, 0)
        .addImage(rgbDataFrame1, options)
        .addImage(rgbDataFrame2, options)
        .addImage(rgbDataFrame3, options)
        .finishEncoding();
outputStream.close();

Download

Gradle:

compile 'com.squareup:gifencoder:0.10.1'

Maven:

<dependency>
  <groupId>com.squareup</groupId>
  <artifactId>gifencoder</artifactId>
  <version>0.10.1</version>
</dependency>

Or download the latest JAR.

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2015 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A pure Java library implementing the GIF89a specification. Suitable for use on Android.

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

675 stars

Watchers

16 watching

Forks

77 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.