---
title: bw
summary: null
url: https://www.fastly.com/documentation/reference/io/bw
---

Converts an image to black and white (1-bit color).

## Syntax

```text
bw={value}
bw={value},{luminance}
```

## Allowed values

| Value       | Description                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------------------- |
| `threshold` | Uses a luminance threshold to convert the image to black and white.                                                  |
| `atkinson`  | Uses [Atkinson dithering](https://en.wikipedia.org/wiki/Atkinson_dithering) to convert the image to black and white. |

## Sub-parameters

| Param       | Units    | Description                                                                                                                                                |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `luminance` | `Number` | Luminance threshold between 0 and 100. Determines the cutoff point for when pixels are rendered as black or white. A higher value produces a darker image. |

## Notes

1. The `luminance` sub-parameter is only allowed when the `value` is set to `threshold`. For example: `bw=threshold,35`.
2. The output produced when using `bw` is not grayscale. It is true 1-bit color where every pixel is either black or white.
3. When using `bw`, it is recommended to set the [`format`](https://www.fastly.com/documentation/reference/io/format) parameter to `auto`. This helps ensure the image produced has the smallest file size by using lossless compression. Lossy output with 1-bit color may introduce compression artifacts and also increase the file size of the image.

## Examples

Click the link to view the transformed image using a demo Fastly IO service.

| Example usage                                                                                | Description                                                                                          |
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [`?bw=threshold&format=auto`](https://www.fastly.io/wave.jpg?bw=threshold&format=auto)       | Convert the image to black and white using the `threshold` method and the default `luminance` value. |
| [`?bw=threshold,75&format=auto`](https://www.fastly.io/wave.jpg?bw=threshold,75&format=auto) | Convert the image to black and white using the `threshold` method with a `luminance` value of `75`.  |
| [`?bw=atkinson&format=auto`](https://www.fastly.io/image.jpg?bw=atkinson&format=auto)        | Convert the image to black and white using Atkinson dithering.                                       |
