filter

jetpack_photon_pre_args

Filter the original Photon image parameters before Photon is applied to an image.

Parameters

$args
(array | string)

Array of Photon arguments.

$image_url
string

Image URL.

$scheme
(string | null)

Image scheme. Default to null.

Changelog

How to use this hook

See “How to use actions and filters to customize Jetpack”.

Notes

You can use this filter to change the Photon parameters used for images on your site, like so:
function jeherve_custom_photon( $args ) {
    $args['quality'] = 80;
    $args['strip']   = 'all';
    $args['filter']  = 'grayscale';
    return $args;
}
add_filter( 'jetpack_photon_pre_args', 'jeherve_custom_photon' );