img_ urlDeprecated
{{ product | img_url }}
Output
size
The size parameter allows you to specify the dimensions of the image up to a maximum of 5760 x 5760 px. You can specify only the width, only the height, or both, and you can also use the following named sizes:
Name | Dimensions |
---|---|
pico | 16x16 px |
icon | 32x32 px |
thumb | 50x50 px |
small | 100x100 px |
compact | 160x160 px |
medium | 240x240 px |
large | 480x480 px |
grande | 600x600 px |
original master | 1024x1024 px |
{{ product | img_url: '480x' }}
{{ product | img_url: 'x480' }}
{{ product | img_url: '480x480' }}
{{ product | img_url: 'large' }}
Output
crop
The crop
parameter allows you to specify which part of the image to show if the specified dimensions result in an aspect ratio that differs from the original. You can use the following values:
top
center
bottom
left
right
The default value is center
.
{{ product | img_url: crop: 'bottom' }}
Output
format
Specify which file format to use for the image. The valid formats are pjpg
and jpg
.
It's not practical to convert a lossy image format, like jpg
, to a lossless image format, like png
, so this filter does
only the following conversions:
png
tojpg
png
topjpg
jpg
topjpg
Shopify automatically detects which image formats are supported by the client (e.g. ,
, etc.) and
selects a file format for optimal quality and file size. When a format is specified, Shopify takes into account
the features (e.g. progressive, alpha channel) of the specified file format when making the final automatic format selection.
To learn more, visit https://cdn.shopify.com/.
{{ product | img_url: format: 'pjpg' }}
Output
scale
Specify the pixel density of the image. The valid densities are 2 and 3.
{{ product | img_url: scale: 2 }}