Name
QuantizeBrush -- reduce number of colors in brush (V6.0)
Synopsis
QuantizeBrush(id[, t])
Deprecated syntax
QuantizeBrush(id[, colors, dither])
Function
This function can be used to reduce colors in a brush. This is useful to create a retro palette-based-display look for your brush.

Starting with Hollywood 9.0, this function uses a new syntax with an optional table argument to specify additional options. The following table tags are currently recognized:

Colors:
This tag allows you to specify the desired number of colors for the brush. This must be a value between 1 and 256. Defaults to 256. Alternatively, you can also set the Depth table tag to specify the desired number of colors for the brush (see below).

Dither:
This tag allows you to control whether or not dithering should be used. Set this to True to enable or to False to disable dithering. Defaults to True.

Depth:
This tag allows you to specify the desired number of colors for the brush. This must be a value between 1 (= 2 colors) and 8 (= 256 colors). Defaults to 8. This tag is an alternative to the Colors tag (see above). (V9.0)

Palette:
Set this tag to True if you want QuantizeBrush() to convert your brush into a palette brush. Note that by default QuantizeBrush() will not create palette brushes even though it effectively always reduces colors to a number that would fit into a palette. Still, it doesn't do so due to compatibility reasons because palette brushes weren't supported before Hollywood 9.0. So if you want QuantizeBrush() to create a palette brush for you, you must set this tag to True. Defaults to False. (V9.0)

TransparentPen:
If Palette has been set to True (see above) and the brush to be quantized has a mask, all invisible pixels will be set to the number of the pen specified here so that this pen will become the transparent pen. Defaults to 0 which means tha the first pen should be made transparent by default. (V9.0)

TransparentColor:
If Palette has been set to True and the brush to be quantized has a mask, the brush's transparent pen will be set to the color you specify here. This color must be specified as an RGB color. If this tag is not set, the transparent pen won't be set to any specific color. (V9.0)

Inputs
id
identifier of the brush to quantize
t
optional: table containing further arguments (see above) (V9.0)
Example
QuantizeBrush(1, 32)
Convert brush 1 to a 32-color brush with dithering enabled

Show TOC