# tensorflow::ops::DecodeImage::Attrs

`#include <image_ops.h>`

Optional attribute setters for [DecodeImage](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/decode-image#classtensorflow_1_1ops_1_1_decode_image).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a16aa607e1a5151dede520619378ab295 = 0` | `int64` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a3a318a0404dd48fa085ea4f22b8c564b = DT_UINT8` | `DataType` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a2ad9fac6cebdeb90187f5aa4b67115e6 = true` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a881c7437b561a550118c5f06841fbe2a(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs` Number of color channels for the decoded image. |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1aecdb8e63749abe9fd14ba7c5dca12938(DataType x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs` The desired DType of the returned [Tensor](https://www.tensorflow.org/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor). |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1adb2a6c7b2ca24aa3c01a1e1692e69fab(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs` Controls the output shape of the returned op. |

## Public attributes

### channels_

```
int64 tensorflow::ops::DecodeImage::Attrs::channels_ = 0
```

### dtype_

```
DataType tensorflow::ops::DecodeImage::Attrs::dtype_ = DT_UINT8
```

### expand_animations_

```
bool tensorflow::ops::DecodeImage::Attrs::expand_animations_ = true
```

## Public functions

### Channels

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::Channels(
  int64 x
)
```
Number of color channels for the decoded image.

Defaults to 0

### Dtype

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::Dtype(
  DataType x
)
```
The desired DType of the returned [Tensor](https://www.tensorflow.org/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).

Defaults to DT_UINT8

### ExpandAnimations

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::ExpandAnimations(
  bool x
)
```
Controls the output shape of the returned op.

If True, the returned op will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or not. If, False, the returned op will produce a 3-D tensor for all file types and will truncate animated GIFs to the first frame.

Defaults to true