PicassoBundle showcase

A live demo of the silarhi/picasso-bundle Symfony package — the image component that was missing from the Symfony ecosystem.

Every image below is rendered through the same Twig component: <twig:Picasso:Image>. The bundle takes care of generating a full <picture> element with AVIF and WebP sources, a JPEG fallback, responsive srcset, auto-detected dimensions and a blur placeholder inlined as a CSS background-image.

The transformer used in this project is Glide running locally with the GD driver, and signed URLs to prevent abuse. Transformed image variants are cached under var/picasso-cache/.

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.

A beautiful kitten
Responsive grid

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

A beautiful kitten
Responsive grid

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

A beautiful kitten
Responsive grid

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

Different fit modes

The same source file rendered with three different cropping strategies.

300x300px, contain
300x300px, fit="contain"
300x300px, cover
300x300px, fit="cover"
300x300px, crop
300x300px, fit="crop"

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.

Hero banner

Individual overrides

Two examples showing per-image overrides: a custom quality setting on the left, and an image with its blur placeholder explicitly disabled on the right.

Quality set to 40% (:quality="40")
Low quality
No placeholder (:placeholder="false")
No placeholder
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.