# png

## Description

An 8-bit grayscale, RGB or RGBA image from pixel rows. Coordinates x and y place pixels; integer t groups animated frames. Set png_width and png_height for the required dimensions; both default to 1024.

Output only. Select it with `FORMAT png`. Names ignore ASCII case; use the snake_case name shown here.

Rows describe pixels through x and y coordinates and grayscale, RGB or RGBA channel values. An integer t value can group rows into animation frames; timing uses the numerator and denominator settings.

Set dimensions explicitly for a small image. Export in native exact-byte mode and redirect stdout; image bytes are not terminal text. The format does not accept input images.

```text
SELECT expressions FORMAT png;
```

## Example usage

Use the native client's `--query` mode to preserve binary output bytes. The server must be running, the executable available as `./coordinator`, and database `data` selected.

```sh
./coordinator client --database data --query "SELECT 0 AS x, 0 AS y, 255 AS r, 0 AS g, 0 AS b SETTINGS png_width=1,png_height=1 FORMAT png" > pixel.png
```

The result is one red pixel in a 1 × 1 image.

## Format settings

Use a statement `SETTINGS` clause; these options are not persisted by `SET`.

| Setting                | Type     | Default | Meaning                                                                |
| ---------------------- | -------- | ------- | ---------------------------------------------------------------------- |
| `png_height`           | `UInt64` | `1024`  | Height of the image in pixels, from 1 through 2147483647.              |
| `png_time_denominator` | `UInt64` | `60`    | Positive denominator of the duration in seconds of one integer t unit. |
| `png_time_numerator`   | `UInt64` | `1`     | Positive numerator of the duration in seconds of one integer t unit.   |
| `png_width`            | `UInt64` | `1024`  | Width of the image in pixels, from 1 through 2147483647.               |
