<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.15.0/keras/preprocessing/image.py#L2438-L2470) |

Performs a random brightness shift.

    tf.keras.preprocessing.image.random_brightness(
        x, brightness_range, scale=True
    )

> [!WARNING]
> **Deprecated:** [`tf.keras.preprocessing.image.random_brightness`](https://www.tensorflow.org/versions/r2.15/api_docs/python/tf/keras/preprocessing/image/random_brightness) does not operate on tensors and is not recommended for new code. Prefer [`tf.keras.layers.RandomBrightness`](https://www.tensorflow.org/versions/r2.15/api_docs/python/tf/keras/layers/RandomBrightness) which provides equivalent functionality as a preprocessing layer. For more information, see the tutorial for [augmenting images](https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the [preprocessing layer guide](https://www.tensorflow.org/guide/keras/preprocessing_layers).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. Must be 3D. |
| `brightness_range` | Tuple of floats; brightness range. |
| `scale` | Whether to rescale the image such that minimum and maximum values are 0 and 255 respectively. Default: True. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Numpy image tensor. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| ValueError if `brightness_range` isn't a tuple. ||

<br />