StaticGraymap v5.4
An embedded grayscale image. The gray value of each pixel is the intensity of the foreground color: white (255) paints the full foreground color, and black (0) paints nothing. Unlike StaticBitmap, which is black and white, this makes it possible to paint shades of a single color.
Mandatory properties
The following properties are available in addition to the common label object properties.
| Property | Type | Description |
|---|---|---|
| type | string | Must be StaticGraymap. |
| graymap | string | Base64-encoded 8-bit grayscale PNG image. |
| width | number | Width of the image area. |
| height | number | Height of the image area. |
Optional properties
The following properties are available in addition to the common label object properties.
| Property | Type | Description |
|---|---|---|
| fgColor | string | Foreground color. May contain dynamic text. Default is black. |
| bgColor | string | Optional background color. May contain dynamic text. |
| thresholding | boolean | If true, pixels with a gray value above 127 are painted with the full foreground color, and other pixels are not painted. Default is false. |
Example
A horizontal gradient from no color to full red:
{
"type": "StaticGraymap",
"x": 10.0,
"y": 10.0,
"width": 40.0,
"height": 10.0,
"fgColor": "red",
"graymap": "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAAAAADcV1ARAAAADUlEQVR4nGNgCF31HwADVwH/LWZy7wAAAABJRU5ErkJggg=="
}