> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poof.bg/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Too Large

> Image exceeds size limit

**HTTP Status:** 400 (or 413 when the upload is rejected by the processing service)

```json theme={null}
{
  "code": "image_too_large",
  "message": "The uploaded image exceeds the 20 MB limit.",
  "request_id": "req_3f6a2c1e-9b0d-4e7a-8c21-5d1f0a9b7e42",
  "doc_url": "https://docs.poof.bg/errors/image-too-large"
}
```

## Reasons and How to Fix

### File Size Exceeds 20 MB

The maximum allowed file size is 20 MB. The API gateway normally rejects oversized uploads with `400`; if the file reaches the processing service it is rejected there with `413`. Handle both statuses the same way.

**To fix:**

1. Compress the image before uploading
2. Resize to smaller dimensions
3. Use a more efficient format (JPEG instead of PNG for photos)

### Image Compression Tips

```python theme={null}
from PIL import Image

# Resize large images
img = Image.open("large_photo.jpg")
img.thumbnail((4096, 4096))  # Max 4096px on longest side
img.save("resized.jpg", quality=85)
```

```bash theme={null}
# Using ImageMagick
convert large_photo.jpg -resize 4096x4096\> -quality 85 resized.jpg
```

### Recommended Dimensions

For best results, images don't need to be huge:

| Use Case | Recommended Size |
| - | - |
| Web thumbnails | 800×800 |
| E-commerce | 2000×2000 |
| Print quality | 4000×4000 |

## Need Help?

Contact us at [support@poof.bg](mailto:support@poof.bg) with your `request_id`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.