# tf.image.adjust_jpeg_quality

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/image/adjust_jpeg_quality) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/image_ops_impl.py#L2000-L2047) |

Adjust jpeg encoding quality of an RGB image.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.image.adjust_jpeg_quality`](https://www.tensorflow.org/api_docs/python/tf/image/adjust_jpeg_quality), \`tf.compat.v2.image.adjust_jpeg_quality\`

<br />

    tf.image.adjust_jpeg_quality(
        image, jpeg_quality, name=None
    )

This is a convenience method that adjusts jpeg encoding quality of an
RGB image.

`image` is an RGB image. The image's encoding quality is adjusted
to `jpeg_quality`.
`jpeg_quality` must be in the interval `[0, 100]`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `image` | RGB image or images. Size of the last dimension must be 3. |
| `jpeg_quality` | Python int or Tensor of type int32. jpeg encoding quality. |
| `name` | A name for this operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Adjusted image(s), same shape and DType as `image`. ||

<br />

#### Usage Example:

    >> import tensorflow as tf
    >> x = tf.random.normal(shape=(256, 256, 3))
    >> tf.image.adjust_jpeg_quality(x, 75)

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `InvalidArgumentError` | quality must be in \[0,100\] |
| `InvalidArgumentError` | image must have 1 or 3 channels |

<br />