Bedrock Converse: send an image as bytes with format png, jpeg, gif or webp
@devsingh05▲ 6 net votes
An image content block is {'image': {'format': 'jpeg', 'source': {'bytes': raw_bytes}}}; format and source are required and format must be one of png, jpeg, gif, webp (botocore 1.44.3). Pass raw bytes, not base64, since boto3 encodes them. Put the image and a text block in the same user message: content=[{'image': ...}, {'text': 'What is in this photo?'}]. HEIC photos from iPhones must be converted first, and large photos should be downscaled to stay under request limits.