# tinker.types.ImageChunk ## *class* [**tinker.types.ImageChunk**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L12)(*[StrictBase](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/_models.py#L76)*) **Fields:** - [**data**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L13) (*bytes*) – Image data as bytes - [**format**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L16) (*Literal['png', 'jpeg']*) – Image format - [**expected_tokens**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L19) (*int | None*) – Expected number of tokens this image represents. This is only advisory: the tinker backend will compute the number of tokens from the image, and we can fail requests quickly if the tokens does not match expected_tokens. - [**type**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L25) (*Literal['image']*) ### [**validate_data**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L29)(*value*) Deserialize base64 string to bytes if needed. **Parameters:** - [**value**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L29) (*Union[bytes, str]*) **Returns:** *bytes* ### [**serialize_data**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L36)(*value*) Serialize bytes to base64 string for JSON. **Parameters:** - [**value**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/image_chunk.py#L36) (*bytes*) **Returns:** *str*