Title: Image quality and next-gen formats
Author: WordPress VIP Documentation
Published: February 14, 2024
Last modified: June 26, 2026

---

 1. [VIP File System](https://docs.wpvip.com/vip-file-system/)
 2. [Image file behavior](https://docs.wpvip.com/vip-file-system/image-files/)
 3. Image quality and next-gen formats

#  Image quality and next-gen formats

By default, [the VIP File System](https://docs.wpvip.com/vip-file-system/) automatically
converts and serves images located in a site’s `/uploads/` directory as next-gen
formats (including `*.webp` files) to compatible browsers.

Only browsers that have `webp` in their `Accept` header are compatible with `*.webp`
files. Requests for `*.jpg`, `*.png`, or `*.gif` in compatible browsers will be 
served a `*.webp` format of the image file in the response. As a result, uploading`*.
webp` files is not necessary, nor is it necessary to explicitly reference them in
application code.

In addition, a `*.webp` file that was uploaded to a WordPress site will be automatically
converted and served in `*.jpg` format to a browser that does not have `webp` in
the `Accept` header. 

## Limitation

Images larger than 10 MB will not be transformed to a `*.webp` file if the request
URL for the file does not include any [image transformation](https://docs.wpvip.com/vip-file-system/image-files/transformations/)
parameters. Additionally, images larger than 200 MB will not be transformed even
if image transformations parameters are explicitly included. In both of these cases,
the file in its original format will be returned instead.

## Image quality and file formats

The effectiveness of the `quality` parameter on an image file is dependent on its
[image file format](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types).

 * JPGs have [lossy compression](https://developer.mozilla.org/en-US/docs/Glossary/Lossy_compression)
   which allows the file to be further compressed but compromises the visual quality
   of the image as a result.
 * The more modern WebP and AVIF file formats can be _either_ lossless or lossy.
 * Lossless formats (i.e. PNG, GIF, WebP, and AVIF) will undergo lossy compression
   when quality is set below 100. Lossy compression for lossless images can be enabled
   by adding the `allow_lossy=1` parameter, regardless of quality setting. When 
   this parameter is used, the VIP File Service automatically optimizes compression
   based on the image characteristics.

In addition, transformation parameters that are set in code are automatically applied
to images when they are requested at the WordPress layer. If an image file is requested
directly (e.g. `https://example.com/uploads/2025/04/image.jpg`) in a browser or 
in a cURL request, the WordPress layer is bypassed and no transformation parameters
will be applied. The file will be returned in its original format.

### Override the default quality parameter value

The default values for the `quality` parameter that are applied to image files by
type:

 * JPEG 89%
 * PNG 80%
 * WebP 80%

The default value for `quality` can be overridden with the `vip_go_image_resize_pre_args`
filter. This filter should be added to a plugin in `[client-mu-plugins/](https://docs.wpvip.com/wordpress-skeleton/client-mu-plugins-directory/)`
so that it loads as early as possible, but the filter can also be located in `plugins/`
or `themes/`.

This code example demonstrates how to override the default `quality` parameter value
for all images with `75` (75%):

/client-mu-plugins/plugin-name.php

    ```lang-php
    function my_image_quality_filter( $args ) {
    	$args['quality'] = 75;
    	return $args;
    }
    add_filter( 'vip_go_image_resize_pre_args', 'my_image_quality_filter', 999 );
    ```

Last updated: June 26, 2026