SyliusCon 2025
Early Bird Deal
LogoLogo
🛣️ Roadmap💻 Sylius Demo💬 Community Slack
  • Sylius Documentation
  • Sylius Plugins
  • Sylius Stack
  • 📖Sylius 2.0 Documentation
    • Organization
      • Release Cycle
      • Backwards Compatibility Promise
      • Sylius Team
      • Sylius Roadmap
  • Getting Started with Sylius
    • Installation
    • Basic Configuration
    • Shipping & Payment
    • First Product
    • Customizing the Shop
    • Customizing Business Logic
    • Using API
    • Installing Plugins
    • Deployment
    • Summary
  • The Book
    • Introduction to Sylius
    • Installation
      • System Requirements
      • Sylius CE Installation
        • Sylius CE Installation with Docker
      • ➕Sylius Plus Installation
      • Upgrading Sylius CE
      • Upgrading Sylius Plus
    • Architecture
      • Architecture Overview
      • Architectural Drivers
      • Resource Layer
      • State Machine
      • Translations
      • E-Mails
      • Contact
      • Fixtures
      • Events
    • Configuration
      • Channels
      • Locales
      • Currencies
    • Customers
      • Customer & ShopUser
      • ➕Customer Pools
      • AdminUser
      • Addresses
        • Countries
        • Zones
        • Addresses
        • Address Book
    • Products
      • Products
      • Product Reviews
      • Product Associations
      • Attributes
      • Pricing
      • Catalog Promotions
      • Taxons
      • Inventory
      • ➕Multi-Source Inventory
      • Search
    • Carts & Orders
      • Orders
      • Cart flow
      • Taxation
      • Adjustments
      • Cart Promotions
      • Coupons
      • Payments
      • 🧩Invoices
      • Shipments
    • Support
    • Contributing
      • Contributing Code
        • Submitting a Patch
        • ⚠️Security Issues
        • Coding Standards
        • Conventions
        • Sylius License and Trademark
      • Contributing Translations
      • Key Contributors
  • The Customization Guide
    • Customizing Models
      • How to add a custom model?
      • How to add a custom translatable model?
    • Customizing Forms
      • How to add a live form for a custom model?
    • Customizing Styles
    • Customizing Validation
    • Customizing Menus
    • Customizing Templates
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing API
    • Customizing Serialization of API
    • Customizing Payments
      • How to integrate a Payment Gateway as a Plugin?
  • 🧑‍🍳The Cookbook
  • How to resize images?
  • How to add one image to an entity?
  • How to add multiple images to an entity?
  • Sylius 1.X Documentation
    • 📓Sylius 1.x Documentation
Powered by GitBook
LogoLogo

Developer

  • Community
  • Online Course

About

  • Team

© 2025 Sylius. All Rights Reserved

On this page
  • Where are image resizing filters defined?
  • How to Apply Image Filters in Twig
  • How to Edit existing filters
  • How to Add Custom Image Resizing Filters
  • Learn More

Was this helpful?

Edit on GitHub

How to resize images?

PreviousHow to integrate a Payment Gateway as a Plugin?NextHow to add one image to an entity?

Last updated 3 days ago

Was this helpful?

twSylius uses to handle image manipulation, including resizing and generating thumbnails.

For a full list of supported filters and configuration options, see the .


Where are image resizing filters defined?

In Sylius 2.x, image resizing filters are configured under liip_imagine in your config/packages/liip_imagine.yaml file. By default, Sylius provides a comprehensive set of filters for both the Admin and Shop interfaces.

Here are the default filters:

Filter Name
Size (px)
Description

sylius_admin_product_original

Original

Full-size admin product image

sylius_admin_avatar

200x200

Admin avatar thumbnail

sylius_admin_product_large_thumbnail

600×800

Large product image in admin

sylius_admin_product_thumbnail

200×200

Generic admin thumbnail

sylius_shop_product_original

Original

Full-size shop product image

sylius_shop_product_small_thumbnail

300×400

Small product image in shop

sylius_shop_product_thumbnail

600×800

Main product thumbnail in shop

sylius_shop_product_large_thumbnail

1200×1600

Large product image in shop

sylius_small

120×90

Generic small image size

sylius_medium

240×180

Generic medium image size

sylius_large

640×480

Generic large image size


How to Apply Image Filters in Twig

Use the imagine_filter Twig filter to apply it to an image path.

Example

<img src="{{ object.path|imagine_filter('sylius_small') }}" alt="Thumbnail" />

Sylius stores image paths (e.g. for products or avatars) in the path field of image entities. The default public path for media is /media/image.


How to Edit existing filters

Let's assume you want to change the size of images under sylius_shop_product_large_thumbnail filter to 100 x 200:

# config/packages/liip_imagine.yaml
liip_imagine:
    filter_sets:
        sylius_shop_product_large_thumbnail:
            format: webp
            quality: 80
            filters:
                thumbnail: { size: [ 100, 200 ], mode: inset }

Remember to clear cache after the changes!

php bin/console liip:imagine:cache:remove

How to Add Custom Image Resizing Filters

To define your own image resizing filter:

# config/packages/liip_imagine.yaml
liip_imagine:
    filter_sets:
        advert_banner:
            filters:
                thumbnail: { size: [800, 200], mode: inset }

Example Usage in Twig

<img src="{{ banner.path|imagine_filter('advert_banner') }}" alt="Banner" />

Learn More

LiipImagineBundle
LiipImagineBundle filter documentation
LiipImagineBundle Documentation