Name
SaveBrush -- save brush to a file (V2.0)
Synopsis
SaveBrush(id, f$[, transcolor, fmt, table])
Function
This function saves the brush specified by id to the file specified by f$. If you specify the optional argument transcolor, all transparent areas of the brush will be filled with this color. The fmt argument specifies the desired picture format for the file (defaults to #IMGFMT_BMP which writes a 24-bit BMP picture).

Starting with Hollywood 2.5, you can also pass #IMGFMT_PNG as the format. SaveBrush() will then save the brush as a PNG picture. If the brush has an alpha channel, this alpha channel will also be written to the PNG image.

Starting with Hollywood 4.0, you can also pass #IMGFMT_JPEG as the format. SaveBrush() will then save the brush as a JPEG picture. Note that the JPEG format does not support alpha channels. The Quality field in the optional table argument allows you to specify the quality level for the JPEG image (valid values are 0 to 100 where 100 is the best quality).

Starting with Hollywood 4.5, you can also pass #IMGFMT_GIF and #IMGFMT_ILBM as format. If you use #IMGFMT_GIF, the brush will be saved as a GIF image. Because GIF images are always palette based, you can use the Colors and Dither tags of the optional table argument to specify the number of palette entries to allocate for the image and whether or not dithering shall be applied. If you choose #IMGFMT_ILBM, the brush will always be saved as a true color (24 bit) ILBM image.

The optional table argument allows you to configure further parameters:

Dither:
Set to True to enable dithering. This field is only handled when the destination format is palette-based. Defaults to False which means no dithering.

Colors:
Specifies how many colors the image shall use. Again, this is only handled for palette-based formats. Valid values are between 1 and 256. Defaults to 256.

Quality:
Here you can specify a value between 0 and 100 indicating the compression quality for lossy compression formats. A value of 100 means best quality, 0 means worst quality. This is only available for image formats that support lossy compression. Defaults to 90 which means pretty good quality.

Here is an overview that shows which formats support which tags:

Please note that technically it is also possible to create palette-based BMP, PNG, and ILBM images. However, Hollywood currently does not support this and will always create true color (24 bit) images for these formats. This is why you cannot use the Dither and Colors tags for these formats currently.

Inputs
id
identifier of the brush to save
f$
destination file
transcolor
optional: color to use for transparent areas (defaults to #BLACK); pass #NOTRANSPARENCY for no transparency
fmt
optional: output format; either #IMGFMT_BMP, #IMGFMT_PNG, (V2.5) #IMGFMT_JPEG, #IMGFMT_GIF or #IMGFMT_ILBM (V4.0) (defaults to #IMGFMT_BMP)
table
optional: table argument for configuring further options (V4.5)

Show TOC