ImageGear Professional for Windows ActiveX
ReduceWithOctree Method

Description:

This method reduces a 24-bit or 8-bit image to an 8-bit or 4-bit image, having the number of colors specified by maxColors. If you set paletteSize > 0 and supply an address to lpPalette, ImageGear will use your palette. If you set maxColors > 16, then an 8-bit image will always result. Setting maxColors <=16 will result in a 4-bit image. You may not specify less than 8 colors.

The table below demonstrates some sample cases of 8 and 24-bit images being reduced, using the setting of maxColors (middle column). The right-most column shows the number of Bits Per Pixel that the resulting image will have.

Bpp of Original Image Number of Resulting Colors Bpp of Reduced Image
24 17-256 8
24 8-16 4
24 16 4
8 17-256 8
8 8-16 4
8 16 Not possible, nMaxColors will be changed to 8.

Syntax:

      ReduceWithOctree (ByVal pPage As IGPage, ByVal fastRemap As
Boolean, ByVal maxColors As Long)

Parameters:

Name Description
pPage Reference to IGPage Object.
fastRemap Set to True for reduction algorithm optimized for speed. Set to False for algorithm optimized for quality.
maxColors The maximum number of colors (that is, maximum number of unique pixel values) you want in the resulting image. If you set this to > 16, the resulting image will be an 8-bit. Valid values are 8 - 256. If you pass in a value out of this range, ImageGear will set the value to either 8 or 256.

Return Value:

N/A

Bits Per Pixel:

Sample:

Image Processing and Effects

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback