How to use .bmp images with API

I am using the chat completions API with gpt-4-vision-preview. It works great for my jpeg and png images, but I notice the API does not support .bmp images.

Is there any straightforward way I can use .bmp images? I know I can manually convert and re-upload or write a python script. But I would prefer not to do that given I already have the image URLs.

I ended up using PIL to convert to png, and then uploading to an S3 bucket. A little annoying but it worked

There’s a quick answer in the vision guide:

### What type of files can I upload?

We currently support PNG (.png), JPEG (.jpeg and .jpg), WEBP (.webp), and non-animated GIF (.gif).

### Is there a limit to the size of the image I can upload?

Yes, we restrict image uploads to 20MB per image.

Preprocessing the images for vision not only lets you ensure a wide variety can be sent, but you can also control costs, understanding the “tiles” pricing structure, and for example keeping the largest dimension under 1024px for maximum 4 tiles, or 512px for just one.

Images can be sent directly in the request by conversion to UTF-8 base64.