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

# Automatic Format Selection

> How Openinary automatically picks AVIF, WebP, or JPEG based on browser support — and how to override it with the f parameter.

When no output format is specified, Openinary automatically selects the smallest format the requesting browser supports.

## How it works

<Steps>
  <Step title="Detect browser support">
    Reads the `Accept` header and `User-Agent` to determine which modern formats are supported.
  </Step>

  <Step title="Analyze content">
    Evaluates whether the image is a photo, graphic, or contains transparency to pick the best codec.
  </Step>

  <Step title="Pick the smallest result">
    Encodes in candidate formats, compares sizes, and serves the winner.

    **Priority:** AVIF → WebP → JPEG / PNG
  </Step>
</Steps>

## Typical size reductions

| Original format | → AVIF         | → WebP         |
| --------------- | -------------- | -------------- |
| JPEG            | 40–50% smaller | 25–35% smaller |
| PNG             | 50–70% smaller | 25–40% smaller |

<Note>
  Actual savings depend on image content and original compression level.
</Note>

## Manual format override

Use the [`f` parameter](/media-transformations/image-transformations#f) to force a specific format regardless of browser support.

```http theme={null}
GET /t/f_avif,q_80/image.jpg
GET /t/f_webp,q_85/image.jpg
GET /t/f_jpeg,q_90/image.jpg
```

## Next steps

<CardGroup cols={2}>
  <Card title="Image Transformations" icon="image" href="/media-transformations/image-transformations">
    Full reference for resize, crop, rotate, and format parameters.
  </Card>

  <Card title="Upload & Cache Warming" icon="upload" href="/media-transformations/upload-and-prewarm">
    Pre-generate optimized variants at upload time.
  </Card>
</CardGroup>
