Image
An image resource with URL, dimensions, and transformation options. Used for product images, collection images, media previews, and other visual content throughout the storefront.
The url field accepts an argument for resizing, cropping, scaling for retina displays, and converting between image formats. Use the thumbhash field to display lightweight placeholders while images load.
Anchor to FieldsFields
- altText (String)
- height (Int)
- id (ID)
- thumbhash (String)
- url (URL!)
- width (Int)
- Anchor to altTextalt•String
Text A word or phrase to share the nature or contents of an image.
- Anchor to heightheight•Int
The original height of the image in pixels. Returns
nullif the image isn't hosted by Shopify.- •ID
A unique ID for the image.
- Anchor to thumbhashthumbhash•String
The ThumbHash of the image.
Useful to display placeholder images while the original image is loading.
See https://evanw.github.io/thumbhash/ for details on how to use it.
- •URL!non-null
The location of the image as a URL.
If no transform options are specified, then the original image will be preserved including any pre-applied transforms.
All transformation options are considered "best-effort". Any transformation that the original image type doesn't support will be ignored.
If you need multiple variations of the same image, then you can use GraphQL aliases.
- Anchor to transformtransform•Image
Transform Input A set of options to transform the original image.
Arguments
- Anchor to widthwidth•Int
The original width of the image in pixels. Returns
nullif the image isn't hosted by Shopify.
Deprecated fields
- originalSrc (URL!): deprecated
- src (URL!): deprecated
- transformedSrc (URL!): deprecated
- Anchor to originalSrcoriginal•URL!
Src non-nullDeprecated - •URL!non-nullDeprecated
- Anchor to transformedSrctransformed•URL!
Src non-nullDeprecated - Anchor to maxWidthmax•Int
Width Image width in pixels between 1 and 5760.
- Anchor to maxHeightmax•Int
Height Image height in pixels between 1 and 5760.
- Anchor to cropcrop•Crop
Region Crops the image according to the specified region.
- Anchor to scalescale•IntDefault:1
Image size multiplier for high-resolution retina displays. Must be between 1 and 3.
- Anchor to preferredContentTypepreferred•Image
Content Type Content Type Best effort conversion of image into content type (SVG -> PNG, Anything -> JPG, Anything -> WEBP are supported).
Arguments