Skip to content

Feature request: support image/avif as an image input MIME type #1664

@anggrayudi

Description

@anggrayudi

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

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions