A 2D configurator can draw the product in two ways. Your products, layers and images are the same either way; only the way the preview is drawn changes.
- Canvas — every layer is drawn into one picture. It is lighter on configurators with many layers, and it is what newer features, such as image overlays, are built on.
- Image stack — one image per layer, stacked on top of each other. This is how the configurator has always drawn products.
3D configurators are not affected by this setting.
Choose the viewer
- Go to Product Configurator > Settings > Performance.
- In 2D viewer, choose Canvas or Image stack.
- Save.
The setting applies to every 2D configurator on the site.
New stores start with the canvas. Stores that used the configurator before this setting existed keep the image stack until you change it, so an update never changes how your products look.
What changes with the canvas
Customers see the same picture. On configurators with many layers, changing choices and views is faster. On small configurators you will not notice a difference.
A few things work differently:
- Images must come from your site, or be served with CORS headers. If your images are on a CDN or a storage service (an "offload" plugin, for example), that service has to send an
Access-Control-Allow-Originheader. Without it the browser does not let the canvas use the images, and the configurator uses the image stack instead (see below). - Custom HTML always sits above the images. With the image stack, a custom HTML field can sit between two layers. With the canvas it is always drawn on top of the whole picture. If you need HTML between layers, keep the image stack.
- Each view can have its own image order. With the image stack, every view uses the same order. See Changing the order of the images.
- Stylesheets cannot target the image of a single layer. The layers are no longer separate images on the page, so custom CSS aimed at one layer's image has nothing to apply to. Styling the viewer as a whole still works.
When the image stack is used anyway
The configurator falls back to the image stack on its own when the canvas cannot show a product correctly:
- the browser cannot draw with WebGL (very old browsers, or graphics turned off);
- a layer is drawn by an add-on that does not support the canvas yet;
- an image is on another domain without CORS headers;
- the browser drops its graphics and does not get them back.
Customers still see the product; it is simply drawn the old way. Your browser's console says which reason applied, starting with Product configurator: using the image viewer instead of the canvas viewer.
Add-ons
- Text overlay draws its text in the canvas from version 2.1.0. With an older version, products with a text layer use the image stack.
- Form fields shows uploaded images in the preview with the canvas only, from version 2.2.0. See Showing the uploaded image in the preview.
- Save your design needs version 2.5.0 or later for the picture in its PDF. Update it before you switch to the canvas: older versions put an empty picture in the PDF.
Large images on phones
The canvas helps with heavy configurators, but the size of the image files still matters on phones. Each image has to be decoded at its full size before it is drawn, and phones have far less memory than computers. With very large files (several thousand pixels wide) and many layers, a phone can run out of memory and reload the page.
If your layer images are large, set a smaller size for phones:
- Go to Product Configurator > Settings > General options.
- Set Preview Image size – mobile to a size around 1500 pixels wide, such as 1536×1536.
By default this is set to inherit, which uses the same size as on computers. It only applies to images in your media library.
For developers
The setting can be overridden per product with a filter:
add_filter( 'mkl_pc_viewer_2d_renderer', function( $renderer, $product_id ) {
return 123 === $product_id ? 'dom' : $renderer;
}, 10, 2 );
'dom' is the image stack, 'canvas' the canvas. In JavaScript, the PC.fe.viewer.renderer filter has the last word.