# tf.image.rgb_to_hsv

<br />

Converts one or more images from RGB to HSV.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.image.rgb_to_hsv`](https://www.tensorflow.org/api_docs/python/tf/image/rgb_to_hsv)

<br />

    tf.image.rgb_to_hsv(
        images: _atypes.TensorFuzzingAnnotation[TV_RGBToHSV_T], name=None
    ) -> _atypes.TensorFuzzingAnnotation[TV_RGBToHSV_T]

Outputs a tensor of the same shape as the `images` tensor, containing the HSV
value of the pixels. The output is only well defined if the value in `images`
are in `[0,1]`.

`output[..., 0]` contains hue, `output[..., 1]` contains saturation, and
`output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0
corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue.

#### Usage Example:

    blue_image = tf.stack([
       tf.zeros([5,5]),
       tf.zeros([5,5]),
       tf.ones([5,5])],
       axis=-1)
    blue_hsv_image = tf.image.rgb_to_hsv(blue_image)
    blue_hsv_image[0,0].numpy()
    array([0.6666667, 1. , 1. ], dtype=float32)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `images` | A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`. 1-D or higher rank. RGB data to convert. Last dimension must be size 3. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as `images`. ||

<br />