Bedrock “Unable to Process Provided Image”: Fix Base64, Format and Size
“Unable to process provided image” means Bedrock received your image data but couldn’t decode it as a picture.
The surprise: doing what most tutorials say, base64-encoding the image, is exactly what breaks Converse in boto3.
Jake wanted the parts bot to read photos of worn brake pads that customers send in. The code read each photo, base64-encoded it like every example online, and sent it with Converse. Every call failed with this error.
Jake: "We encoded it properly. Why can’t it read the photo?"
Ethan: "Because boto3 encodes it again. The model gets base64 of base64, which isn’t a picture any more."
Base64 or bytes? It depends on the API
| How you call the model | What the image field takes |
|---|---|
| Converse / ConverseStream with an AWS SDK (boto3, JavaScript, Java) | Raw bytes in source.bytes; the SDK handles encoding |
| InvokeModel with an Anthropic model | A base64 string in source.data, with type: "base64" and media_type |
| Converse with an S3 location (supported models) | source.s3Location pointing at the object |
| Raw HTTP without an SDK | Base64 in the JSON, because JSON can’t carry raw bytes |
The rule fits in one line: with an AWS SDK, you don’t base64-encode the image bytes yourself (see ImageSource).
Fix it in Python (boto3 Converse)
import boto3
client = boto3.client("bedrock-runtime", region_name="us-east-1")
with open("brake-pad.jpg", "rb") as f:
image_bytes = f.read() # raw bytes, NOT base64
resp = client.converse(
modelId="us.amazon.nova-lite-v1:0",
messages=[{"role": "user", "content": [
{"text": "How worn is this brake pad? Answer in one sentence."},
{"image": {"format": "jpeg", "source": {"bytes": image_bytes}}},
]}],
)
print(resp["output"]["message"]["content"][0]["text"])
From S3, read the object and pass Body.read() the same way: image_bytes = s3.get_object(Bucket=b, Key=k)["Body"].read(). If that raises NoSuchKey, see S3 NoSuchKey.
Jake: "So I just delete the base64 line?"
Ethan: "Delete it. Read the file, pass the bytes, done."
Fix it in JavaScript (ConverseCommand)
Browsers and many upload libraries hand you a data URL such as data:image/png;base64,iVBOR…. Strip the prefix and decode it as base64, not UTF-8:
import { BedrockRuntimeClient, ConverseCommand } from "@aws-sdk/client-bedrock-runtime";
const client = new BedrockRuntimeClient({ region: "us-east-1" });
const b64 = dataUrl.replace(/^data:image\/\w+;base64,/, "");
const bytes = new Uint8Array(Buffer.from(b64, "base64")); // decode, don't encode
const resp = await client.send(new ConverseCommand({
modelId: "us.amazon.nova-lite-v1:0",
messages: [{ role: "user", content: [
{ text: "How worn is this brake pad?" },
{ image: { format: "png", source: { bytes } } },
]}],
}));
Buffer.from(b64, "utf-8") or new TextEncoder().encode(b64) turns the text into bytes, but those bytes are still base64 text, not a PNG.
Fix it with InvokeModel (Anthropic models)
Here base64 is correct. The Anthropic Messages body takes an image block like this:
import base64, json
body = {
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 300,
"messages": [{"role": "user", "content": [
{"type": "image", "source": {"type": "base64", "media_type": "image/jpeg",
"data": base64.b64encode(image_bytes).decode()}},
{"type": "text", "text": "How worn is this brake pad?"},
]}],
}
resp = client.invoke_model(modelId="us.anthropic.claude-fable-5-2", body=json.dumps(body))
Mixing the two styles, such as Converse’s {"image": {"source": {"bytes": …}}} inside an InvokeModel body, gives “Malformed input request” instead; see that fix.
Check the format matches the file
The ImageBlock format must be png, jpeg, gif or webp, and it has to describe the actual bytes. Phones and websites often save PNGs with a .jpg name. Detect the real type from the file’s first bytes:
def image_format(b: bytes) -> str:
if b.startswith(b"\x89PNG"): return "png"
if b.startswith(b"\xff\xd8"): return "jpeg"
if b.startswith(b"GIF8"): return "gif"
if b[8:12] == b"WEBP": return "webp"
raise ValueError("convert HEIC, BMP or TIFF to JPEG or PNG first")
iPhone HEIC photos, BMP and TIFF aren’t accepted; convert them to JPEG or PNG first.
Keep images within the size limits
| Limit (Anthropic models) | Value | What to do |
|---|---|---|
| Image size | 3.75 MB | Save as JPEG at a moderate quality |
| Height or width | 8,000 pixels | Resize the longest side, for example to about 2,000 pixels |
| Formats | JPEG, PNG, WebP, GIF | Convert HEIC, BMP, TIFF |
from PIL import Image
import io
img = Image.open("brake-pad.jpg"); img.thumbnail((2000, 2000))
buf = io.BytesIO(); img.convert("RGB").save(buf, format="JPEG", quality=85)
image_bytes = buf.getvalue()
Other model families have their own limits; check the model’s card, and the Converse supported features list for which models take images at all.
Images and Bedrock agents
A PNG sent through an agent’s file input is a common variant of this error. When it was widely reported, InvokeAgent’s files accepted documents such as PDF, text, Word, CSV and Excel, not images. For image understanding, call a vision model directly through bedrock-runtime with Converse, then pass the model’s text answer to the agent if needed.
Jake’s fix
- Removed the base64 step: Converse got the raw bytes.
- Detected the real image type, since some customer photos were PNGs named .jpg.
- Resized everything to 2,000 pixels on the longest side, saved as JPEG.
- The bot now describes pad wear from each photo in one sentence.
Jake: "So the tutorials were wrong?"
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: AI Practitioner (AIF-C01) • Machine Learning Engineer – Associate (MLA-C02) • Developer – Associate (DVA-C03 from December 1, 2026).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. A boto3 application base64-encodes a JPEG and passes the string in a Converse image block. Bedrock returns "Unable to process provided image". What is the fix?
Pass the raw image bytes in source.bytes. With an AWS SDK the bytes are encoded for transport automatically, so a base64 string ends up encoded twice and cannot be decoded as an image.
2. When must image data be base64-encoded for Amazon Bedrock?
In the InvokeModel request body for Anthropic models, where the image block uses source type base64 with media_type and data. Converse through an AWS SDK takes raw bytes instead.
3. A Converse call declares format jpeg for a file that is actually PNG and fails. How should the application choose the format?
Detect the image type from the file content (magic bytes) and set format to png, jpeg, gif or webp accordingly; the format tells the model how to decode the bytes.
4. What image limits apply to Anthropic models on Amazon Bedrock?
Each image up to 3.75 MB and no more than 8,000 pixels in height or width, in JPEG, PNG, WebP or GIF.
5. Which option avoids sending large images in the request body for models that support it?
Reference the image with an S3 location in the Converse image source instead of bytes, where the model supports S3 inputs.
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Ethan: "They were right for a different API. For Converse with an SDK, bytes are the whole trick."
Official references for this guide
- ImageSource: raw bytes, no base64 needed with an AWS SDK, and S3 locations.
- ImageBlock: the format values.
- Anthropic Messages API on Bedrock: the base64 image block, 3.75 MB and 8,000-pixel limits.
- Converse supported models and features.
Frequently asked questions
What does "Unable to process provided image" mean in Bedrock?
The model received image data it couldn’t decode as a picture. The usual causes are base64 text sent where raw bytes were expected, a wrong format value, or an image over the model’s size limits.
Should I base64-encode images for the Bedrock Converse API?
Not when you use an AWS SDK. Converse takes raw image bytes, and the SDK encodes them for transport. Passing a base64 string makes the image encoded twice.
When does Bedrock need base64 image data?
In the InvokeModel body for Anthropic models, where the image block has source type base64 and a data field with the base64 string. Converse with an SDK takes plain bytes instead.
Which image formats does the Bedrock Converse API accept?
png, jpeg, gif and webp. The format field must match the actual file.
What is the maximum image size for Anthropic models on Bedrock?
3.75 MB per image, and no more than 8,000 pixels in height or width. Resize or compress larger images first.
How do I send an image with boto3 converse?
Read the file as bytes and pass them as {"image": {"format": "png", "source": {"bytes": data}}} inside the message content, next to a text block.
How do I send a base64 image with the JavaScript SDK ConverseCommand?
Strip the data:image/...;base64, prefix and decode it: new Uint8Array(Buffer.from(b64, "base64")). Passing the base64 text, or decoding it as UTF-8, produces bytes that aren’t an image.
Can I send an image from S3 to Bedrock?
Some models accept an S3 location in the image source instead of bytes. Otherwise read the object with s3.get_object and pass its Body bytes.
Why does format="jpeg" fail for my PNG file?
The format value tells the model how to decode the bytes. If it says jpeg but the bytes are PNG, decoding fails. Detect the type from the file, not the file name.
Can I send images to a Bedrock agent?
When this question was widely asked, InvokeAgent’s file input accepted documents such as PDF, text, Word, CSV and Excel, not images. For image understanding, call a vision model through bedrock-runtime, or check the current agent file options.
Which Bedrock models accept images?
Vision-capable chat models, such as recent Anthropic, Amazon Nova and Meta Llama vision models. A text-only model rejects images; check the model’s input modalities on its card.
Why does my image work in the console but not in code?
The console sends raw bytes correctly. In code the usual difference is an extra base64 step, a data URL prefix left in, or a wrong format value.
How many images can I send in one Bedrock request?
It depends on the model; large requests also count against the context window. Send only the images the question needs, resized to a sensible resolution.
How do I make an image smaller for Bedrock?
Resize the longest side to about 1,500 to 2,000 pixels and save as JPEG at a moderate quality; that keeps most photos well under 3.75 MB with little loss for the model.
Is "Unable to process provided image" a permissions error?
No. Permissions give AccessDeniedException. This error means the image data itself couldn’t be read.
Does a Malformed input request error relate to images?
It can: an image block in the wrong shape for the model (for example Converse-style fields inside an Anthropic InvokeModel body) gives Malformed input request, while correctly shaped but unreadable data gives Unable to process provided image.
Revision note. Written November 30, 2026, against the Bedrock ImageBlock and ImageSource references and the Anthropic Messages documentation. “Too many cooks spoil the broth”: let one layer do the encoding, never two.