public class GIFTweaker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
APPLICATION_EXTENSION_LABEL |
static byte |
COMMENT_EXTENSION_LABEL |
static byte |
EXTENSION_INTRODUCER |
static byte |
GRAPHIC_CONTROL_LABEL |
static byte |
IMAGE_SEPARATOR |
static byte |
IMAGE_TRAILER |
static byte |
TEXT_EXTENSION_LABEL |
Modifier and Type | Method and Description |
---|---|
static void |
finishWrite(java.io.OutputStream os)
This is intended to be called after writing all the frames if we write
an animated GIF frame by frame.
|
static void |
insertComments(java.io.InputStream is,
java.io.OutputStream os,
java.util.List<java.lang.String> comments) |
static void |
insertXMPApplicationBlock(java.io.InputStream is,
java.io.OutputStream os,
byte[] xmp) |
static void |
insertXMPApplicationBlock(java.io.InputStream is,
java.io.OutputStream os,
java.lang.String xmp) |
static void |
insertXMPApplicationBlock(java.io.InputStream is,
java.io.OutputStream os,
XMP xmp) |
static void |
prepareForWrite(GIFWriter writer,
java.io.OutputStream os,
int logicalScreenWidth,
int logicalScreenHeight)
This is intended to be called first when writing an animated GIF
frame by frame.
|
static java.util.Map<MetadataType,Metadata> |
readMetadata(java.io.InputStream is) |
static void |
splitAnimatedGIF(java.io.InputStream animatedGIF,
ImageWriter writer,
java.lang.String outputFilePrefix)
Split animated GIF to individual frames.
|
static void |
splitAnimatedGIF(java.io.InputStream animatedGIF,
java.lang.String outputFilePrefix)
Split animated GIF to individual GIF images.
|
static void |
splitFrames(java.io.InputStream is,
java.lang.String outputFilePrefix)
Split an animated GIF into individual frames and save them as GIF images.
|
static void |
splitFrames2(java.io.InputStream animatedGIF,
ImageWriter writer,
java.lang.String outputFilePrefix)
Deprecated.
Use
splitAnimagedGIF instead. |
static void |
writeAnimatedGIF(java.awt.image.BufferedImage[] images,
int[] delays,
int loopCount,
ImageParam param,
java.io.OutputStream os)
Create animated GIFs from a series of BufferedImage
|
static void |
writeAnimatedGIF(java.awt.image.BufferedImage[] images,
int[] delays,
int loopCount,
java.io.OutputStream os)
Create animated GIFs from a series of BufferedImage
|
static void |
writeAnimatedGIF(java.awt.image.BufferedImage[] images,
int[] delays,
java.io.OutputStream os) |
static void |
writeAnimatedGIF(GIFFrame[] frames,
int loopCount,
ImageParam param,
java.io.OutputStream os)
Write an array of GIFFrame as an animated GIF.
|
static void |
writeAnimatedGIF(GIFFrame[] frames,
int loopCount,
java.io.OutputStream os)
Write an array of GIFFrame as an animated GIF.
|
static void |
writeAnimatedGIF(GIFFrame[] frames,
java.io.OutputStream os) |
static void |
writeAnimatedGIF(java.util.List<GIFFrame> frames,
int loopCount,
java.io.OutputStream os) |
static void |
writeAnimatedGIF(java.util.List<GIFFrame> frames,
java.io.OutputStream os) |
static void |
writeFrame(GIFWriter writer,
java.io.OutputStream os,
java.awt.image.BufferedImage frame) |
static void |
writeFrame(GIFWriter writer,
java.io.OutputStream os,
java.awt.image.BufferedImage frame,
int delay) |
static void |
writeFrame(GIFWriter writer,
java.io.OutputStream os,
GIFFrame frame) |
public static final byte IMAGE_SEPARATOR
public static final byte IMAGE_TRAILER
public static final byte EXTENSION_INTRODUCER
public static final byte GRAPHIC_CONTROL_LABEL
public static final byte APPLICATION_EXTENSION_LABEL
public static final byte COMMENT_EXTENSION_LABEL
public static final byte TEXT_EXTENSION_LABEL
public static void finishWrite(java.io.OutputStream os) throws java.lang.Exception
os
- OutputStream for the animated GIFjava.lang.Exception
public static void insertComments(java.io.InputStream is, java.io.OutputStream os, java.util.List<java.lang.String> comments) throws java.io.IOException
java.io.IOException
public static void insertXMPApplicationBlock(java.io.InputStream is, java.io.OutputStream os, XMP xmp) throws java.io.IOException
java.io.IOException
public static void insertXMPApplicationBlock(java.io.InputStream is, java.io.OutputStream os, byte[] xmp) throws java.io.IOException
java.io.IOException
public static void prepareForWrite(GIFWriter writer, java.io.OutputStream os, int logicalScreenWidth, int logicalScreenHeight) throws java.lang.Exception
writer
- GIFWriter to write the animated GIFos
- OutputStream for the animated GIFlogicalScreenWidth
- width of the logical screen. If it is less than
or equal zero, it will be determined from the first framelogicalScreenHeight
- height of the logical screen. If it is less than
or equal zero, it will be determined from the first framejava.lang.Exception
public static void insertXMPApplicationBlock(java.io.InputStream is, java.io.OutputStream os, java.lang.String xmp) throws java.io.IOException
java.io.IOException
public static java.util.Map<MetadataType,Metadata> readMetadata(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void splitFrames(java.io.InputStream is, java.lang.String outputFilePrefix) throws java.lang.Exception
is
- input GIF image streamoutputFilePrefix
- optional output file name prefixjava.lang.Exception
@Deprecated public static void splitFrames2(java.io.InputStream animatedGIF, ImageWriter writer, java.lang.String outputFilePrefix) throws java.lang.Exception
splitAnimagedGIF
instead.animatedGIF
- input animated GIF streamwriter
- ImageWriter for the output frameoutputFilePrefix
- optional prefix for the output imagejava.lang.Exception
public static void splitAnimatedGIF(java.io.InputStream animatedGIF, java.lang.String outputFilePrefix) throws java.lang.Exception
animatedGIF
- input animated GIF streamoutputFilePrefix
- optional path prefix for the output imagejava.lang.Exception
public static void splitAnimatedGIF(java.io.InputStream animatedGIF, ImageWriter writer, java.lang.String outputFilePrefix) throws java.lang.Exception
animatedGIF
- input animated GIF streamwriter
- ImageWriter for the output frameoutputFilePrefix
- optional path prefix for the output imagejava.lang.Exception
public static void writeAnimatedGIF(java.awt.image.BufferedImage[] images, int[] delays, int loopCount, java.io.OutputStream os) throws java.lang.Exception
images
- an array of BufferedImagedelays
- delay times in millisecond between the framesloopCount
- loop count for the animated GIFos
- OutputStream to write the imagejava.lang.Exception
public static void writeAnimatedGIF(java.awt.image.BufferedImage[] images, int[] delays, int loopCount, ImageParam param, java.io.OutputStream os) throws java.lang.Exception
images
- an array of BufferedImagedelays
- delay times in millisecond between the framesloopCount
- loop count for the animated GIFparam
- internal GIFWriter write parametersos
- OutputStream to write the imagejava.lang.Exception
public static void writeAnimatedGIF(java.awt.image.BufferedImage[] images, int[] delays, java.io.OutputStream os) throws java.lang.Exception
java.lang.Exception
public static void writeAnimatedGIF(GIFFrame[] frames, int loopCount, java.io.OutputStream os) throws java.lang.Exception
frames
- array of GIFFrameloopCount
- loopCount for the animated GIFos
- OutputStream to write the imagejava.lang.Exception
public static void writeAnimatedGIF(GIFFrame[] frames, int loopCount, ImageParam param, java.io.OutputStream os) throws java.lang.Exception
frames
- array of GIFFrameloopCount
- loopCount for the animated GIFos
- OutputStream to write the imageparam
- internal GIFWriter write parametersjava.lang.Exception
public static void writeAnimatedGIF(GIFFrame[] frames, java.io.OutputStream os) throws java.lang.Exception
java.lang.Exception
public static void writeAnimatedGIF(java.util.List<GIFFrame> frames, int loopCount, java.io.OutputStream os) throws java.lang.Exception
java.lang.Exception
public static void writeAnimatedGIF(java.util.List<GIFFrame> frames, java.io.OutputStream os) throws java.lang.Exception
java.lang.Exception
public static void writeFrame(GIFWriter writer, java.io.OutputStream os, java.awt.image.BufferedImage frame) throws java.lang.Exception
java.lang.Exception
public static void writeFrame(GIFWriter writer, java.io.OutputStream os, java.awt.image.BufferedImage frame, int delay) throws java.lang.Exception
java.lang.Exception