Vcl.Imaging.GIFImg.TGIFImage.Optimize

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Optimize(Options: TGIFOptimizeOptions;
ColorReduction: TColorReduction = rmNone; DitherMode: TDitherMode = dmNearest;
ReductionBits: integer = 8);

C++

void __fastcall Optimize(TGIFOptimizeOptions Options, TColorReduction ColorReduction = (TColorReduction)(0x0), TDitherMode DitherMode = (TDitherMode)(0x0), int ReductionBits = 0x8);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Imaging.GIFImg.pas
Vcl.Imaging.GIFImg.hpp
Vcl.Imaging.GIFImg TGIFImage

Description

Optimizes the GIF images using the given optimization options.

Call Optimize to optimize the GIF images stored inside the TGIFImage instance. The optimization process refers to various optimization methods like reducing the global color map, using a specific dithering algorithm, merging pixels of the same color, or removing comments and unnecessary application extensions.

The Options parameter specifies global optimization options, also listed in the following table, together with their meanings.


Value Meaning

ooCrop

Crop the animated GIF frames.

ooMerge

Merge pixels of the same color.

ooCleanup

Remove comments and application extensions.

ooColorMap

Sort color map by usage and remove unused entries.



The ColorReduction parameter specifies the color reduction method to use when optimizing the global GIF color map. The possible values for this parameter are given in the following table, together with their meanings.


Value Meaning

rmNone

Do not perform any color reduction.

rmWindows20

Reduce to the Windows 20 color system palette.

rmWindows256

Reduce to the Windows 256 color halftone palette. This only works in 256 color display mode.

rmWindowsGray

Reduce to the Windows 4 grayscale colors.

rmMonochrome

Reduce to a black/white monochrome palette.

rmGrayScale

Reduce to a uniform 256 shade grayscale palette.

rmNetscape

Reduce to the Netscape 216 color palette.

rmQuantize

Reduce to an optimal 2^n color palette.

rmQuantizeWindows

Reduce to an optimal 256 color windows palette.

rmPalette

Reduce to a custom palette.



The DitherMode parameter specifies the dithering algorithm to use. The possible values for this parameter are given in the following table, together with their meanings.


Value Meaning

dmNearest

Use the nearest color matching algorithm, without error correction.

dmFloydSteinberg

Use the Floyd-Steinberg error diffusion dithering algorithm.

dmStucki

Use the Stucki error diffusion dithering algorithm.

dmSierra

Use the Sierra error diffusion dithering algorithm.

dmJaJuNI

Use the Jarvis, Judice, and Ninke error diffusion dithering algorithm.

dmSteveArche

Use the Stevenson and Arche error diffusion dithering algorithm.

dmBurkes

Use the Burkes error diffusion dithering algorithm.



The ReductionBits parameters specifies the number of bits per pixel to use when the reduction method is rmQuantize.

See Also