Glide Driver: GD URLs: signed Cache: var/storage/picasso-cache/
silarhi/picasso-bundle

PicassoBundle showcase

The image component that was missing from the Symfony ecosystem. Every image below is rendered by the same Twig component, <twig:Picasso:Image>: switch any example to Code to see the Twig behind it.

  • A <picture> with AVIF and WebP sources
  • A JPEG fallback
  • A responsive srcset
  • Auto-detected dimensions
  • A blur placeholder, inlined in the CSS

Responsive grid with sizes

Three images laid out in a Bootstrap grid. The sizes attribute is forwarded to the component, and the srcset is generated automatically from the breakpoints configured in picasso.yaml.

sizes: 33vw
A beautiful kitten

Responsive grid

One line of Twig, and you get a <picture> element with every format and every size variant.

<twig:Picasso:Image
    src="{{ asset('build/images/destiny-wiens-1332880-unsplash.jpg') }}"
    width="600"
    height="400"
    sizes="(max-width: 768px) 100vw, 33vw"
    fit="cover"
    alt="A beautiful kitten"
    class="d-block w-100"
/>
sizes: 33vw
A beautiful kitten

Responsive grid

One line of Twig, and you get a <picture> element with every format and every size variant.

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    sizes="(max-width: 768px) 100vw, 33vw"
    fit="cover"
    alt="A beautiful kitten"
    class="d-block w-100"
/>
sizes: 33vw
A beautiful kitten

Responsive grid

One line of Twig, and you get a <picture> element with every format and every size variant.

<twig:Picasso:Image
    src="{{ asset('build/images/elvira-visser-k89j1SUqf5U-unsplash.jpg') }}"
    width="600"
    height="400"
    sizes="(max-width: 768px) 100vw, 33vw"
    fit="cover"
    alt="A beautiful kitten"
    class="d-block w-100"
/>

Different fit modes

The same source file rendered with three different cropping strategies.

fit: contain
300x300px, contain
300x300px, fit="contain"
<twig:Picasso:Image
    src="{{ asset('build/images/edgar-edgar-712801-unsplash.jpg') }}"
    width="300"
    height="300"
    fit="contain"
    alt="300x300px, contain"
    class="img-fluid d-block mx-auto shadow-sm"
/>
fit: cover
300x300px, cover
300x300px, fit="cover"
<twig:Picasso:Image
    src="{{ asset('build/images/edgar-edgar-712801-unsplash.jpg') }}"
    width="300"
    height="300"
    fit="cover"
    alt="300x300px, cover"
    class="img-fluid d-block mx-auto shadow-sm"
/>
fit: crop
300x300px, crop
300x300px, fit="crop"
<twig:Picasso:Image
    src="{{ asset('build/images/edgar-edgar-712801-unsplash.jpg') }}"
    width="300"
    height="300"
    fit="crop"
    alt="300x300px, crop"
    class="img-fluid d-block mx-auto shadow-sm"
/>

Priority image (LCP)

With :priority="true", the image is loaded with loading="eager" and fetchpriority="high". The blur placeholder is automatically disabled since it would only slow down the first paint. This is the mode you want for a hero banner.

fetchpriority="high" · loading="eager"
Hero banner Hero banner · LCP
<twig:Picasso:Image
    src="{{ asset('build/images/jacalyn-beales-669247-unsplash.jpg') }}"
    width="1200"
    height="500"
    sizes="100vw"
    fit="cover"
    :priority="true"
    alt="Hero banner"
    class="d-block w-100"
/>

Automatic dimensions

The width and height attributes tell the browser the shape of the image before it loads, so the layout does not jump (CLS). The filesystem loader reads them from the source file (resolve_metadata, cached), so you only pass what you know. The values below are read from the rendered HTML.

Dimensions detected from the source

No dimension at all

Rendered width="1800" height="1198": the source dimensions are used.

<twig:Picasso:Image
    src="{{ asset('build/images/destiny-wiens-1332880-unsplash.jpg') }}"
    sizes="(max-width: 768px) 100vw, 33vw"
    alt="Dimensions detected from the source"
    class="img-fluid shadow-sm"
/>
Height computed from the width

Width only

Rendered width="400" height="266": the height follows the source aspect ratio.

<twig:Picasso:Image
    src="{{ asset('build/images/destiny-wiens-1332880-unsplash.jpg') }}"
    width="400"
    sizes="(max-width: 768px) 100vw, 33vw"
    alt="Height computed from the width"
    class="img-fluid shadow-sm"
/>
Explicit source dimensions

Known source dimensions

Rendered width="400" height="266": given explicitly, the file is not read.

<twig:Picasso:Image
    src="{{ asset('build/images/destiny-wiens-1332880-unsplash.jpg') }}"
    sourceWidth="1800"
    sourceHeight="1198"
    width="400"
    sizes="(max-width: 768px) 100vw, 33vw"
    alt="Explicit source dimensions"
    class="img-fluid shadow-sm"
/>

Fixed size and pixel density

Without sizes, the image is meant to be shown at a fixed size: the srcset uses pixel density descriptors instead of widths, so a retina screen gets the 2x variant. Ideal for avatars, logos and thumbnails.

96x96
Avatar 1 srcset: 1x, 2x
<twig:Picasso:Image
    src="{{ asset('build/images/destiny-wiens-1332880-unsplash.jpg') }}"
    width="96"
    height="96"
    fit="cover"
    alt="Avatar 1"
    class="rounded-circle shadow-sm"
/>
96x96
Avatar 2 srcset: 1x, 2x
<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="96"
    height="96"
    fit="cover"
    alt="Avatar 2"
    class="rounded-circle shadow-sm"
/>
96x96
Avatar 3 srcset: 1x, 2x
<twig:Picasso:Image
    src="{{ asset('build/images/elvira-visser-k89j1SUqf5U-unsplash.jpg') }}"
    width="96"
    height="96"
    fit="cover"
    alt="Avatar 3"
    class="rounded-circle shadow-sm"
/>

Placeholders

While the photo loads, a placeholder fills its box: it is inlined as a CSS background-image on the <img> and removed once the photo is there. Below is what each strategy shows, for the same 600x400 photo (throttle your network in the dev tools to see them live).

blur

Blurred thumbnail (LQIP)

A 10x7 JPEG blurred by the transformer. The default here, no extra dependency.

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    fit="cover"
    placeholder="blur"
/>
blurhash

BlurHash

A smooth gradient decoded from a BlurHash, inlined as a PNG data URI. 402 bytes inline.

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    fit="cover"
    placeholder="blurhash"
/>
data URI

Your own data URI

Any data URI you already have, e.g. a dominant color stored with the image. 140 bytes inline.

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    fit="cover"
    placeholderData="data:image/svg+xml,…"
/>
none

No placeholder

Nothing until the photo loads: the box only reserves its space.

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    fit="cover"
    :placeholder="false"
/>
Show the configuration
config/packages/picasso.yaml YAML

picasso:
    placeholders:
        blur:
            type: transformer
            size: 10
            blur: 5
            quality: 30
        blurhash:
            type: blurhash
            driver: gd
    default_placeholder: blur

Twig functions

The component is not the only way in. picasso_image() renders the same <picture> for projects without symfony/ux-twig-component, and picasso_image_url() returns a single transformed URL, for anything that is not an <img>: a CSS background, an Open Graph image, an email.

picasso_image()
Rendered by picasso_image()

picasso_image()

The same <picture>, without the Twig component.

{{ picasso_image(
    src: asset('build/images/elvira-visser-k89j1SUqf5U-unsplash.jpg'),
    width: 600,
    height: 400,
    sizes: '(max-width: 768px) 100vw, 50vw',
    fit: 'cover',
    attributes: {alt: 'Rendered by picasso_image()', class: 'd-block w-100'},
) }}
picasso_image_url()
Text over a transformed background

picasso_image_url()

One transformed URL, here as a CSS background. This page's og:image comes from it too: a 1200x630 JPEG, the size social networks expect.

<div style="background-image: url('{{ picasso_image_url(
    asset('build/images/elvira-visser-k89j1SUqf5U-unsplash.jpg'),
    width: 1200, height: 800, format: 'webp', quality: 80, fit: 'cover'
) }}')">

<meta property="og:image" content="{{ absolute_url(picasso_image_url(
    asset('build/images/jacalyn-beales-669247-unsplash.jpg'),
    width: 1200, height: 630, format: 'jpg', fit: 'cover'
)) }}">

JSON API for headless frontends

When a React, Vue or mobile app renders the image itself, ImageHelperInterface::imageData() returns everything the component would: format sources, srcsets, placeholder and dimensions. The object is JsonSerializable, so a controller returns it as is: /picasso/api/image.json.

Controller PHP
#[Route(path: '/picasso/api/image.json', name: 'picasso_api_image')]
public function apiImage(ImageHelperInterface $imageHelper, Packages $packages): JsonResponse
{
    return new JsonResponse($imageHelper->imageData(
        src: $packages->getUrl('build/images/elvira-visser-k89j1SUqf5U-unsplash.jpg'),
        width: 1200,
        height: 800,
        sizes: '100vw',
        fit: 'cover',
    ));
}
Response application/json
{
    "fallbackSrc": "/image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1200&h=800&fm=jpg&q=75&fit=cover&s=e9VFn5reKVOSDTiYF_S8mBX6CqjbZQzFa-EH7nPm-sA",
    "fallbackSrcset": "/image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=16&h=11&fm=jpg&q=75&fit=cover&s=3rjhsbw_taXbjB-t-HGszijm7yJfLUSpifglNxIzwys 16w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=32&h=21&fm=jpg&q=75&fit=cover&s=oh9RE4GZtdSSxW2y3EeUlV4zNoQ2jKtbLQVAUaUW3PM 32w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=48&h=32&fm=jpg&q=75&fit=cover&s=TwV7glQqJQ_7VITUWq5bNmXc-Q2fX0LURHI1Z1rBws8 48w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=64&h=43&fm=jpg&q=75&fit=cover&s=3d1PjFEmdUpeUnm6-tGLGaZC_iT_FDbIS7eFSqRf8Bk 64w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=96&h=64&fm=jpg&q=75&fit=cover&s=vlwYF8MR8dV85Sc8VmdAcDjPAMMWLcDBj3v1yKHeNDg 96w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=128&h=85&fm=jpg&q=75&fit=cover&s=Uz60Wi4nM9tIcGzYrWNJnMBXGyWOsSzj4SoBMDaFSOQ 128w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=256&h=171&fm=jpg&q=75&fit=cover&s=8vg3-_pbRTrx4KUOlP_cwbEZcT7Y5lPL3BHwLffmHBk 256w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=384&h=256&fm=jpg&q=75&fit=cover&s=S6_xOxqEDiVzKDc4nGOY9atgO1AxHpL51Q8nsJYVo0Q 384w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=640&h=427&fm=jpg&q=75&fit=cover&s=CLrbjp7UvN1PPJ__Ib0apHOwHlXZfbR7X-OjlDb2feY 640w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=750&h=500&fm=jpg&q=75&fit=cover&s=xj4CNgKL6IUURHD70wcK14wts_SoFs5qfHrQP80SFNQ 750w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=828&h=552&fm=jpg&q=75&fit=cover&s=DcHJpBSGOFzrXexfsLx49XAPGDBtT6AZVw3Ca8QtYJA 828w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1080&h=720&fm=jpg&q=75&fit=cover&s=QOPpNEZiT4nC7894FSeAbfd4ljp3o8HPqePJD2og9Gw 1080w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1200&h=800&fm=jpg&q=75&fit=cover&s=e9VFn5reKVOSDTiYF_S8mBX6CqjbZQzFa-EH7nPm-sA 1200w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1920&h=1280&fm=jpg&q=75&fit=cover&s=eQhA9WO7hR3G3NjVKbzo6qkU6tPjySNgDmt-l57dz4M 1920w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=2048&h=1365&fm=jpg&q=75&fit=cover&s=PIAl3tluSGXkjlOiDGndNuwK8mVZy-fRm4x59fjB_ng 2048w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=3840&h=2560&fm=jpg&q=75&fit=cover&s=vFnzq9gsqblLAhPgYocVLM7-1ahrF9hpAVJ7vNpU8yg 3840w",
    "sources": [
        {
            "type": "image/avif",
            "srcset": "/image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=16&h=11&fm=avif&q=75&fit=cover&s=_jZ5svD6SZX54GNPZKeYXp6fMRVykVwurt6kOmukJXA 16w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=32&h=21&fm=avif&q=75&fit=cover&s=Aaf-nL44W4oc3QsWJ_weijL4axsa0N_KpIvRHNF4B5g 32w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=48&h=32&fm=avif&q=75&fit=cover&s=I-7pydOeLAc9qeB5r6cHh0iaup1nxNnjFlAARYMOXwY 48w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=64&h=43&fm=avif&q=75&fit=cover&s=_2zff33sbtMp7UA7mZv7Ms2vQWtvj5XTOe6XL2VE6EY 64w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=96&h=64&fm=avif&q=75&fit=cover&s=4_-qfq6_pAY5oCgcIrALQAWTIkOAyhFPGgixqyfvn1M 96w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=128&h=85&fm=avif&q=75&fit=cover&s=q-pZTZwEYAkGesbOLwJT-unNaEgl-3J5UDkQ-2Bj4n8 128w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=256&h=171&fm=avif&q=75&fit=cover&s=qsvQDURSOUdZhu7R8WA11LUrLnsGHTk6nScR4y6mGEs 256w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=384&h=256&fm=avif&q=75&fit=cover&s=Waxlj92vz4ZaVnB5cf_Aq9DkBzQDsZIhPq2UkXTo4mI 384w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=640&h=427&fm=avif&q=75&fit=cover&s=oZ35eQFUUrzzMZeq-4mgn0vnfk0m1FtYqnj2QK6-drY 640w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=750&h=500&fm=avif&q=75&fit=cover&s=wxaNy9lGZdtshunEMXHb3tz90KNvnjCYG_5OKzeL-og 750w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=828&h=552&fm=avif&q=75&fit=cover&s=Xr2GF0p2esFUaxlOY5LmxIR4eW5sXFS4rOz-bFXHVIw 828w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1080&h=720&fm=avif&q=75&fit=cover&s=zcRwWjeWuXGLCPyvk4MyyOWm3xo5ne2V3u8JsU5fRFc 1080w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1200&h=800&fm=avif&q=75&fit=cover&s=4F6Zh6ShE1UGw2ViSYcaWJXJ8-yDzqGoj7HGboMTu-I 1200w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1920&h=1280&fm=avif&q=75&fit=cover&s=nUrMIwD328b6jn1TeB-Pkq0tTPYfmGKAc9cpBkGDzaA 1920w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=2048&h=1365&fm=avif&q=75&fit=cover&s=zGQ5p53crqZbkdxtoJB3kLew7V4HcHXOPQU3WbpaVkE 2048w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=3840&h=2560&fm=avif&q=75&fit=cover&s=y7-dSQT9HhmkEun3LPW93cR9u6yr1b4YZ9OAwxMI3ec 3840w"
        },
        {
            "type": "image/webp",
            "srcset": "/image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=16&h=11&fm=webp&q=75&fit=cover&s=1Ain-n_76tQ0S_fjFNMcerH7-zL_KTweSWg0xmhOB1c 16w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=32&h=21&fm=webp&q=75&fit=cover&s=5buFVsRmQE7vTXeZjh5mo7oF0-XIWPS39iArJfXc2kg 32w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=48&h=32&fm=webp&q=75&fit=cover&s=8cKUTRhNiykKWIsXBUZS4XIhX7v04d06xztb1d-pyas 48w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=64&h=43&fm=webp&q=75&fit=cover&s=9pb3WbRG8QeIUbhqCYu8g7ZmtcVG9EDgz5a8eYed2DY 64w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=96&h=64&fm=webp&q=75&fit=cover&s=f1vf43ECaYPmNnFCkNxNXJxszAFLaTB7E4e1c7LZcCk 96w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=128&h=85&fm=webp&q=75&fit=cover&s=Fwocb39oZr_g2UoBlVmvf2kme-DKIE8OzsrnD5hDNXk 128w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=256&h=171&fm=webp&q=75&fit=cover&s=EesIxVUSUGv2HHgGwCzzFXpISE0P_DtsDSX1wUMUluA 256w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=384&h=256&fm=webp&q=75&fit=cover&s=mepF6LxZwPIb0aDSUZWs0aLvsqHGtec2fpYMXxR7M_g 384w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=640&h=427&fm=webp&q=75&fit=cover&s=G2lAMvtKQft63jQeeDtpKeXuA9IdDFy_S1qEqhImOf4 640w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=750&h=500&fm=webp&q=75&fit=cover&s=AF4-W1uw9L2Hlh-iz5ChT7dbhSPJr0jgVYL4rRDtoEY 750w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=828&h=552&fm=webp&q=75&fit=cover&s=74DPhLMfidx_-LBHv7MMPJgqcbcXmfk_ZhkM33QNMvE 828w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1080&h=720&fm=webp&q=75&fit=cover&s=OEQU4pSBUrWT_V_2Ywq2RVUvrsDZqP9SkwGilUWY5sE 1080w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1200&h=800&fm=webp&q=75&fit=cover&s=edbCQGRKLkdPYAl6hZ51Z1dicV-95qb-_RoLU6-WrsE 1200w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=1920&h=1280&fm=webp&q=75&fit=cover&s=kZ-E8RiC3eEPUEYMUakvKzQmlblZYCqIUQ-_mM9irsU 1920w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=2048&h=1365&fm=webp&q=75&fit=cover&s=AmeKuyIqE0CdUjxQk_rEGJS55dqznJU7IoJwGGp6wG0 2048w, /image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=3840&h=2560&fm=webp&q=75&fit=cover&s=T1zUc2V-eSLT0hXpSbVoOirwZuqb3EhKepMDCc9r79Y 3840w"
        }
    ],
    "placeholderUri": "/image/glide/filesystem/build/images/elvira-visser-k89j1SUqf5U-unsplash.cea68108.jpg?w=10&h=7&fm=jpg&q=30&fit=crop&blur=5&s=WqcERgjJQuO5E5W-X7y2j7kZvSnmQEmdmS50oVGJ9gM",
    "width": 1200,
    "height": 800,
    "loading": "lazy",
    "fetchPriority": null,
    "sizes": "100vw",
    "unoptimized": false,
    "attributes": [],
    "loader": "filesystem",
    "transformer": "glide",
    "placeholder": "blur"
}

Individual overrides

Per-image overrides: a custom quality, no placeholder, and the original file served as is with unoptimized, for what must not be transformed (an SVG logo, an animated GIF).

quality: 40
Low quality

Quality set to 40%

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    quality="40"
    fit="cover"
    alt="Low quality"
    class="d-block w-100"
/>
placeholder: false
No placeholder

No placeholder

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    :placeholder="false"
    fit="cover"
    alt="No placeholder"
    class="d-block w-100"
/>
unoptimized
Unoptimized

Original file, unoptimized

<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    :unoptimized="true"
    alt="Unoptimized"
    class="d-block w-100"
/>

What the component generates

A single Twig tag, and the HTML it renders: one <source> per modern format, a JPEG fallback, a srcset capped to the source size (no upscaling), the placeholder, lazy loading and the dimensions that prevent layout shifts. All signed, all cached.

A kitten
<twig:Picasso:Image
    src="{{ asset('build/images/diana-parkhouse-1166627-unsplash.jpg') }}"
    width="600"
    height="400"
    sizes="(max-width: 768px) 100vw, 50vw"
    fit="cover"
    alt="A kitten"
    class="d-block w-100"
/>
Generated HTML Signed, cached
<picture>
<source
    type="image/avif"
    srcset="/image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=16&amp;h=11&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=9RbNmVJviIgrbQqmaE56dGlICk7NFV1tLySdzq3yky4 16w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=32&amp;h=21&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=eN9Ms0KZzaeXgg7LFtaSRxv73t_Hu4R0E2GE_Zh7H20 32w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=48&amp;h=32&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=1w3tDkkVsQdeItvGUMJsJfOlSS1xsZ7Cng-sYGFQJFY 48w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=64&amp;h=43&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=PS17PTZN010T7EDXH69ossjeFCgv5fZaw2UQAvH1TZs 64w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=96&amp;h=64&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=wqRF9L9KGLBVf6nmiC11MCwD8lw25MNLW4ZgvOayUkc 96w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=128&amp;h=85&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=8P7iM1HgP29frWB36jmhChR3z8q47gBDRxQffEUKlyc 128w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=256&amp;h=171&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=oMd3cMOiWG_3drFi9OTIbM0wEsQbFD_v_n9LrmDYrRU 256w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=384&amp;h=256&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=o8KqlhV0MALz_eNKDjxEfn_kVRZ6iR0Hxua9yguR4Ko 384w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=640&amp;h=427&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=D3g5RdWyTp-rXmW4K3DBHQeizxQrlivuzhnWIlERREA 640w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=750&amp;h=500&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=gI1INx7rSipBko4CP9o9HMjabjhkYnVCZv6jIix7xqU 750w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=828&amp;h=552&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=nJObht8e-uXLCIT99B6BSb13FyW_cTKd7vi9zAex98s 828w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1080&amp;h=720&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=Wt1JoPPwclPwnRrW5Xvcuvi2pBVw2gNkz2uGnnRHJsM 1080w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1200&amp;h=800&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=gVrSPcnJEf0_vDkuQ-Xq4rbQu4lCy6PTYDgvM_VxcEg 1200w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1800&amp;h=1200&amp;fm=avif&amp;q=75&amp;fit=cover&amp;s=IYhxGLfUSamLtJsEMXXEMBkP4Nqy_jPcV8RUQG3ki2o 1800w"
    sizes="(max-width: 768px) 100vw, 50vw" />
<source
    type="image/webp"
    srcset="/image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=16&amp;h=11&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=sw9MeuzZThM3oaI34Gf4SbNsnEhM1vCSWGxx-cUgEQc 16w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=32&amp;h=21&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=I1XnvnLLrHMX4-17rrX73f2vAROcMD9lZViIv5mFEXY 32w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=48&amp;h=32&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=1COHujgZErsk1k10x7JkFANQmAZicaHZ66piDLCmeAU 48w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=64&amp;h=43&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=IOZdgRNLGHdMbLKJCozhPAYrV0-Hs-PxkemHDPC8RVk 64w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=96&amp;h=64&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=erpXYlt4mg2YS_ZEZ92tFsJpkk0264sn5fEt0RJAypY 96w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=128&amp;h=85&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=zCwRNabse9GWFBvJgimH0mZyAxF97t6JPGiJ4Ybg73I 128w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=256&amp;h=171&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=R8cOyxhL6gq3Bvrwb_pXyY9Q07Q2qvYDpGSQplbKcF8 256w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=384&amp;h=256&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=U8PMob79cvEfVFhjq-9x7KblFH3ejbT5mOSvVzRSQMI 384w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=640&amp;h=427&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=I-3NhsnKZbaHboxbgNe9DsDaii-OYFbfC3mi8Y21NoE 640w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=750&amp;h=500&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=GMJuOtAz2rKwMQyLXv9pXtDBnQw8-qhwTXMV9U8F3DA 750w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=828&amp;h=552&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=f5mEv64L7ERi2UhE3-vJ8a32vAAG-tz9K22GIZbMhDQ 828w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1080&amp;h=720&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=1BWyN-KUWyvLWCcnfvI3CbOFNB5HXRw1ZRF_hUV4gBY 1080w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1200&amp;h=800&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=7GHg5WkSLRwPnwB-UGp_9cLXYcJ4r82VkSz5OR7A7wY 1200w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1800&amp;h=1200&amp;fm=webp&amp;q=75&amp;fit=cover&amp;s=Bda8YHDkx__ImSCEWkKHhdRgq7x9m_ilfI4DinkGAdI 1800w"
    sizes="(max-width: 768px) 100vw, 50vw" />
<img
    src="/image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=600&amp;h=400&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=B7whPbqXKNUeKxaSrSSPx0JFGDf5tyGvsf-yOvoRsyQ"
    srcset="/image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=16&amp;h=11&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=xOCjxmXBekFzViCdGb3a4zP6E4oNB6D0h6PB9rGe20o 16w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=32&amp;h=21&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=6lBhamSHk5tumk3D6E8qOrqS_G-TbwcfMz3tQzZlO9o 32w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=48&amp;h=32&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=96Bf9fp1m2m4I-91Mdcu3POSC4UYQSSifVeTbwZHens 48w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=64&amp;h=43&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=Ny0nWhq69alpkyNT6ppA2LNtgvt-KPqVCUoqqJsq2xs 64w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=96&amp;h=64&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=Clk6mItDbmt4CrBCS1T5GF-K5vkJC4ct49yfYhE2BHc 96w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=128&amp;h=85&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=2AZB7yISHqj1_1klADvZ79ap-hRGmbvkmLZSooAMuYc 128w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=256&amp;h=171&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=7D9alx4hKjYX8_YhE5lG329PydlOqGqc7C6X5KqclHU 256w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=384&amp;h=256&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=OcNlwUuvmSzb48zKreEbQVI366t6qq78uS38CkpbqgM 384w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=640&amp;h=427&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=Zb4nchOxpEnhbdZJMf4m6pthKfpDSC2wV-EYraAgOrk 640w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=750&amp;h=500&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=SLd3yQBnlfqNOHnvwx-vHyIAM-RHJlgFPZrcrq3P6qI 750w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=828&amp;h=552&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=Wdn4DJpLx_4s9ZOKY4CDk3UpHGg466wS0sGAlKWNKTM 828w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1080&amp;h=720&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=-0rLGe8KNgalLnoBnrarLUQlyv5HpjHPtme-MKGvsCQ 1080w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1200&amp;h=800&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=eoX4Ju5GzsZx2w8pwnYLHuV0H3o6EM4vob1-TwZ7nVA 1200w, /image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=1800&amp;h=1200&amp;fm=jpg&amp;q=75&amp;fit=cover&amp;s=pd9r59raDpx6BdM5qlYuUpBQd-TSPGHRw25zbxR_pYQ 1800w"
    sizes="(max-width: 768px) 100vw, 50vw" width="600" height="400" loading="lazy"
    style="background-size:cover;background-position:center;background-repeat:no-repeat;background-image:url(/image/glide/filesystem/build/images/diana-parkhouse-1166627-unsplash.b1ccd4ef.jpg?w=10&amp;h=7&amp;fm=jpg&amp;q=30&amp;fit=crop&amp;blur=5&amp;s=WYIXkAWNRQo28LB5WqUVqO0Wq0sHcBcALqkUO7SQ3bk);" onload="this.style.backgroundImage=''" alt="A kitten" class="d-block w-100" />
</picture>
See also: the legacy version of this page, which uses Glide directly (no PicassoBundle on top), is still available at /images. Handy for comparing how much Twig code you actually need between the two approaches.