Did you know that Gemma 4 supports variable aspect ratios AND variable resolutions?
You automatically get variable aspect ratios, and you can manually set the resolution at which you want to process a given image.
The token budget size supports 70, 140, 280, 560, or 1120 visual tokens. The larger your budget size, the more visual tokens are being generated, and the LLM sees a finer-grained image. Note that a visual token is a large square, and each patch represents an embedding that gets averaged to create the visual token.
With variable aspect ratios, Gemma 4 has no issues processing very wide or very tall images. It uses 2D rotary positional embeddings so that the model knows where a visual token is positioned.
