Feature request
Add support for AVIF (image/avif) as an accepted image input MIME type for multimodal requests (e.g. models.generateContent with inline data or uploaded files).
Motivation
AVIF is now a mainstream storage/delivery format for images on modern platforms (iOS 16+, Android, and current Chrome/Firefox/Safari) thanks to significantly better compression than JPEG/WebP at comparable quality. Apps that already capture, store, or serve images as AVIF cannot send them to Gemini directly.
Today the supported image input MIME types are image/png, image/jpeg, and image/webp (per the Gemini API / Firebase AI Logic input-file docs). To use Gemini, developers must transcode AVIF -> JPEG/PNG/WebP server-side before every request, which adds:
- extra latency on the request path,
- server CPU/cost for re-encoding (e.g. via libvips /
sharp),
- an additional point of failure and quality loss from re-compression.
Native image/avif support would let apps pass their existing assets straight through.
Current behavior
Passing an image part with mimeType: "image/avif" is not accepted as a supported image input type.
Proposed solution
I understand AVIF acceptance ultimately depends on backend Gemini model support for decoding AVIF; if this should be routed to the model/API team, guidance on the right tracker would be appreciated.
Alternatives considered
- Client-side transcoding to WebP/JPEG (e.g.
sharp) before upload. Works, but adds the latency/cost/quality drawbacks noted above.
Environment
@google/genai
- Runtime: Node.js
- API backend: Gemini Developer API / Vertex AI (delete as appropriate)
References
Feature request
Add support for AVIF (
image/avif) as an accepted image input MIME type for multimodal requests (e.g.models.generateContentwith inline data or uploaded files).Motivation
AVIF is now a mainstream storage/delivery format for images on modern platforms (iOS 16+, Android, and current Chrome/Firefox/Safari) thanks to significantly better compression than JPEG/WebP at comparable quality. Apps that already capture, store, or serve images as AVIF cannot send them to Gemini directly.
Today the supported image input MIME types are
image/png,image/jpeg, andimage/webp(per the Gemini API / Firebase AI Logic input-file docs). To use Gemini, developers must transcode AVIF -> JPEG/PNG/WebP server-side before every request, which adds:sharp),Native
image/avifsupport would let apps pass their existing assets straight through.Current behavior
Passing an image part with
mimeType: "image/avif"is not accepted as a supported image input type.Proposed solution
image/avifas a supported image input MIME type.image/avifthere too — consistent with prior additions of image/audio MIME types in this repo (e.g. feat: Add support for more image and audio MIME types in Interactions content #1436).I understand AVIF acceptance ultimately depends on backend Gemini model support for decoding AVIF; if this should be routed to the model/API team, guidance on the right tracker would be appreciated.
Alternatives considered
sharp) before upload. Works, but adds the latency/cost/quality drawbacks noted above.Environment
@google/genaiReferences