GifOptions

Inheritance: java.lang.Object, com.aspose.psd.DisposableObject, com.aspose.psd.ImageOptionsBase

public class GifOptions extends ImageOptionsBase

The gif file format creation options.

Constructors

ConstructorDescription
GifOptions()Initializes a new instance of the GifOptions class.
GifOptions(GifOptions gifOptions)Initializes a new instance of the GifOptions class.

Methods

MethodDescription
clone()
close()Implements the Closable interface and can be used in the try-with-resources statement since JDK 1.7.
deepClone()Clones this instance.
deepClone_internalized()Clones this instance.
dispose()Disposes the current instance.
equals(Object arg0)
getBackgroundColorIndex()Gets or sets the GIF background color index.
getBufferSizeHint()Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
getClass()
getColorResolution()Gets or sets the GIF color resolution.
getDefaultReplacementFont()Gets or sets the default replacement font (font that will be used to draw text when exporting to raster, if existing layer font in PSD file is not presented in system).
getDisposed()Gets a value indicating whether this instance is disposed.
getDoPaletteCorrection()Gets or sets a value indicating whether palette correction is applied.
getFullFrame()Gets a value indicating whether [full frame].
getInterlaced()True if image should be interlaced.
getMaxDiff()Gets or sets the maximum allowed pixel difference.
getMultiPageOptions()The multipage options
getPalette()Gets or sets the color palette.
getPixelAspectRatio()Gets or sets the GIF pixel aspect ratio.
getProgressEventHandler()Gets or sets the progress event handler.
getResolutionSettings()Gets or sets the resolution settings.
getSource()Gets or sets the source to create image in.
getVectorRasterizationOptions()Gets or sets the vector rasterization options.
getXmpData()Gets or sets the XMP metadata container.
hasTrailer()Gets or sets a value indicating whether GIF has trailer.
hashCode()
isPaletteSorted()Gets or sets a value indicating whether palette entries are sorted.
notify()
notifyAll()
setBackgroundColorIndex(byte value)Gets or sets the GIF background color index.
setBufferSizeHint(int value)Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
setColorResolution(byte value)Gets or sets the GIF color resolution.
setDefaultReplacementFont(String value)Gets or sets the default replacement font (font that will be used to draw text when exporting to raster, if existing layer font in PSD file is not presented in system).
setDoPaletteCorrection(boolean value)Gets or sets a value indicating whether palette correction is applied.
setFullFrame(boolean value)Sets a value indicating whether [full frame].
setIgnoreAfterCreate_internalized(boolean value)Gets or sets a value indicating whether ignore after create event.
setInterlaced(boolean value)True if image should be interlaced.
setMaxDiff(int value)Gets or sets the maximum allowed pixel difference.
setMultiPageOptions(MultiPageOptions value)The multipage options
setPalette(IColorPalette value)Gets or sets the color palette.
setPaletteSorted(boolean value)Gets or sets a value indicating whether palette entries are sorted.
setPixelAspectRatio(byte value)Gets or sets the GIF pixel aspect ratio.
setProgressEventHandler(ProgressEventHandler value)Gets or sets the progress event handler.
setResolutionSettings(ResolutionSetting value)Gets or sets the resolution settings.
setSource(Source value)Gets or sets the source to create image in.
setTrailer(boolean value)Gets or sets a value indicating whether GIF has trailer.
setVectorRasterizationOptions(VectorRasterizationOptions value)Gets or sets the vector rasterization options.
setXmpData(XmpPacketWrapper value)Gets or sets the XMP metadata container.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

GifOptions()

public GifOptions()

Initializes a new instance of the GifOptions class.

GifOptions(GifOptions gifOptions)

public GifOptions(GifOptions gifOptions)

Initializes a new instance of the GifOptions class.

Parameters:

ParameterTypeDescription
gifOptionsGifOptionsThe GIF Options.

clone()

public ImageOptionsBase clone()

Returns: ImageOptionsBase

close()

public void close()

Implements the Closable interface and can be used in the try-with-resources statement since JDK 1.7. This method simply call dispose method.

deepClone()

public ImageOptionsBase deepClone()

Clones this instance.

Returns: ImageOptionsBase - Returns shallow copy of this instance

deepClone_internalized()

public ImageOptionsBase deepClone_internalized()

Clones this instance.

Returns: ImageOptionsBase - Returns shallow copy of this instance

dispose()

public final void dispose()

Disposes the current instance.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getBackgroundColorIndex()

public byte getBackgroundColorIndex()

Gets or sets the GIF background color index.

Returns: byte - The GIF background color index.

getBufferSizeHint()

public final int getBufferSizeHint()

Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.

Value: The buffer size hint, in megabytes. Non-positive value means no memory limitation for internal buffers

Returns: int

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColorResolution()

public byte getColorResolution()

Gets or sets the GIF color resolution.

Returns: byte - The color resolution.

Color Resolution - Number of bits per primary color available to the original image, minus 1. This value represents the size of the entire palette from which the colors in the graphic were selected, not the number of colors actually used in the graphic. For example, if the value in this field is 3, then the palette of the original image had 4 bits per primary color available to create the image. This value should be set to indicate the richness of the original palette, even if not every color from the whole palette is available on the source machine.

getDefaultReplacementFont()

public String getDefaultReplacementFont()

Gets or sets the default replacement font (font that will be used to draw text when exporting to raster, if existing layer font in PSD file is not presented in system). To take proper name of default font can be used next code snippet: System.Drawing.Text.InstalledFontCollection col = new System.Drawing.Text.InstalledFontCollection(); System.Drawing.FontFamily[] families = col.Families; string defaultFontName = families[0].Name; PsdLoadOptions psdLoadOptions = new PsdLoadOptions() { DefaultReplacementFont = defaultFontName });

Value: The default replacement font.

Returns: java.lang.String

getDisposed()

public final boolean getDisposed()

Gets a value indicating whether this instance is disposed.

Returns: boolean - true if disposed; otherwise, false .

getDoPaletteCorrection()

public boolean getDoPaletteCorrection()

Gets or sets a value indicating whether palette correction is applied.

Returns: boolean - true if palette correction is applied; otherwise, false .

Palette correction means that whenever image is exported to GIF the source image colors will be analyzed in order to build the best matching palette (in case image Palette does not exist or not specified in the options). The analyze process takes some time however the output image will have the best matching color palette and result is visually better.

getFullFrame()

public final boolean getFullFrame()

Gets a value indicating whether [full frame].

Value: true if [full frame]; otherwise, false .

Returns: boolean - a value indicating whether [full frame].

getInterlaced()

public boolean getInterlaced()

True if image should be interlaced.

Returns: boolean

getMaxDiff()

public int getMaxDiff()

Gets or sets the maximum allowed pixel difference. If greater than zero, lossy compression will be used. Recommended value for optimal lossy compression is 80. 30 is very light compression, 200 is heavy. It works best when only little loss is introduced, and due to limitation of the compression algorithm very high loss levels won’t give as much gain. The range of allowed values is [0, 1000].

Returns: int - The range of allowed values.

getMultiPageOptions()

public final MultiPageOptions getMultiPageOptions()

The multipage options

Returns: MultiPageOptions

getPalette()

public IColorPalette getPalette()

Gets or sets the color palette.

Value: The color palette.

Returns: IColorPalette

getPixelAspectRatio()

public byte getPixelAspectRatio()

Gets or sets the GIF pixel aspect ratio.

Pixel Aspect Ratio - Factor used to compute an approximation of the aspect ratio of the pixel in the original image. If the value of the field is not 0, this approximation of the aspect ratio is computed based on the formula: Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 The Pixel Aspect Ratio is defined to be the quotient of the pixel’s width over its height. The value range in this field allows specification of the widest pixel of 4:1 to the tallest pixel of 1:4 in increments of 1/64th. Values : 0 - No aspect ratio information is given. 1..255 - Value used in the computation.

Returns: byte - The GIF pixel aspect ratio.

getProgressEventHandler()

public final ProgressEventHandler getProgressEventHandler()

Gets or sets the progress event handler.

Value: The progress event handler.

Returns: ProgressEventHandler

getResolutionSettings()

public ResolutionSetting getResolutionSettings()

Gets or sets the resolution settings.

Returns: ResolutionSetting

getSource()

public final Source getSource()

Gets or sets the source to create image in.

Value: The source to create image in.

Returns: Source

getVectorRasterizationOptions()

public final VectorRasterizationOptions getVectorRasterizationOptions()

Gets or sets the vector rasterization options.

Value: The vector rasterization options.

Returns: VectorRasterizationOptions

getXmpData()

public XmpPacketWrapper getXmpData()

Gets or sets the XMP metadata container.

Returns: XmpPacketWrapper - The XMP data container.

hasTrailer()

public boolean hasTrailer()

Gets or sets a value indicating whether GIF has trailer.

Returns: boolean - true if GIF has trailer; otherwise, false .

hashCode()

public native int hashCode()

Returns: int

isPaletteSorted()

public boolean isPaletteSorted()

Gets or sets a value indicating whether palette entries are sorted.

Returns: boolean - true if palette entries are sorted; otherwise, false .

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setBackgroundColorIndex(byte value)

public void setBackgroundColorIndex(byte value)

Gets or sets the GIF background color index.

Parameters:

ParameterTypeDescription
valuebyteThe GIF background color index.

setBufferSizeHint(int value)

public final void setBufferSizeHint(int value)

Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.

Value: The buffer size hint, in megabytes. Non-positive value means no memory limitation for internal buffers

Parameters:

ParameterTypeDescription
valueint

setColorResolution(byte value)

public void setColorResolution(byte value)

Gets or sets the GIF color resolution.

Parameters:

ParameterTypeDescription
valuebyteThe color resolution.

Color Resolution - Number of bits per primary color available to the original image, minus 1. This value represents the size of the entire palette from which the colors in the graphic were selected, not the number of colors actually used in the graphic. For example, if the value in this field is 3, then the palette of the original image had 4 bits per primary color available to create the image. This value should be set to indicate the richness of the original palette, even if not every color from the whole palette is available on the source machine. |

setDefaultReplacementFont(String value)

public void setDefaultReplacementFont(String value)

Gets or sets the default replacement font (font that will be used to draw text when exporting to raster, if existing layer font in PSD file is not presented in system). To take proper name of default font can be used next code snippet: System.Drawing.Text.InstalledFontCollection col = new System.Drawing.Text.InstalledFontCollection(); System.Drawing.FontFamily[] families = col.Families; string defaultFontName = families[0].Name; PsdLoadOptions psdLoadOptions = new PsdLoadOptions() { DefaultReplacementFont = defaultFontName });

Value: The default replacement font.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setDoPaletteCorrection(boolean value)

public void setDoPaletteCorrection(boolean value)

Gets or sets a value indicating whether palette correction is applied.

Parameters:

ParameterTypeDescription
valuebooleantrue if palette correction is applied; otherwise, false .

Palette correction means that whenever image is exported to GIF the source image colors will be analyzed in order to build the best matching palette (in case image Palette does not exist or not specified in the options). The analyze process takes some time however the output image will have the best matching color palette and result is visually better. |

setFullFrame(boolean value)

public final void setFullFrame(boolean value)

Sets a value indicating whether [full frame].

Value: true if [full frame]; otherwise, false .

Parameters:

ParameterTypeDescription
valuebooleana value indicating whether [full frame].

setIgnoreAfterCreate_internalized(boolean value)

public final void setIgnoreAfterCreate_internalized(boolean value)

Gets or sets a value indicating whether ignore after create event.

Value: true if ignore after create event; otherwise, false .

Parameters:

ParameterTypeDescription
valueboolean

setInterlaced(boolean value)

public void setInterlaced(boolean value)

True if image should be interlaced.

Parameters:

ParameterTypeDescription
valueboolean

setMaxDiff(int value)

public void setMaxDiff(int value)

Gets or sets the maximum allowed pixel difference. If greater than zero, lossy compression will be used. Recommended value for optimal lossy compression is 80. 30 is very light compression, 200 is heavy. It works best when only little loss is introduced, and due to limitation of the compression algorithm very high loss levels won’t give as much gain. The range of allowed values is [0, 1000].

Parameters:

ParameterTypeDescription
valueintThe range of allowed values.

setMultiPageOptions(MultiPageOptions value)

public final void setMultiPageOptions(MultiPageOptions value)

The multipage options

Parameters:

ParameterTypeDescription
valueMultiPageOptions

setPalette(IColorPalette value)

public void setPalette(IColorPalette value)

Gets or sets the color palette.

Value: The color palette.

Parameters:

ParameterTypeDescription
valueIColorPalette

setPaletteSorted(boolean value)

public void setPaletteSorted(boolean value)

Gets or sets a value indicating whether palette entries are sorted.

Parameters:

ParameterTypeDescription
valuebooleantrue if palette entries are sorted; otherwise, false .

setPixelAspectRatio(byte value)

public void setPixelAspectRatio(byte value)

Gets or sets the GIF pixel aspect ratio.

Pixel Aspect Ratio - Factor used to compute an approximation of the aspect ratio of the pixel in the original image. If the value of the field is not 0, this approximation of the aspect ratio is computed based on the formula: Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 The Pixel Aspect Ratio is defined to be the quotient of the pixel’s width over its height. The value range in this field allows specification of the widest pixel of 4:1 to the tallest pixel of 1:4 in increments of 1/64th. Values : 0 - No aspect ratio information is given. 1..255 - Value used in the computation.

Parameters:

ParameterTypeDescription
valuebyteThe GIF pixel aspect ratio.

setProgressEventHandler(ProgressEventHandler value)

public final void setProgressEventHandler(ProgressEventHandler value)

Gets or sets the progress event handler.

Value: The progress event handler.

Parameters:

ParameterTypeDescription
valueProgressEventHandler

setResolutionSettings(ResolutionSetting value)

public void setResolutionSettings(ResolutionSetting value)

Gets or sets the resolution settings.

Parameters:

ParameterTypeDescription
valueResolutionSetting

setSource(Source value)

public final void setSource(Source value)

Gets or sets the source to create image in.

Value: The source to create image in.

Parameters:

ParameterTypeDescription
valueSource

setTrailer(boolean value)

public void setTrailer(boolean value)

Gets or sets a value indicating whether GIF has trailer.

Parameters:

ParameterTypeDescription
valuebooleantrue if GIF has trailer; otherwise, false .

setVectorRasterizationOptions(VectorRasterizationOptions value)

public final void setVectorRasterizationOptions(VectorRasterizationOptions value)

Gets or sets the vector rasterization options.

Value: The vector rasterization options.

Parameters:

ParameterTypeDescription
valueVectorRasterizationOptions

setXmpData(XmpPacketWrapper value)

public void setXmpData(XmpPacketWrapper value)

Gets or sets the XMP metadata container.

Parameters:

ParameterTypeDescription
valueXmpPacketWrapperThe XMP data container.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int