---
title: Images
slug: klevu-magento-v4/entities-images
docTags: 
createdAt: 2024-09-12T13:52:08.403Z
---

When indexing product images we can set a different image to be indexed to Klevu from the `Base` image. `Klevu Image` is added to products as a new image type alongside the default `Base`, `Small` and `Thumbnail`. This takes advantage of the Magento image processing while allowing merchants to select which image to send to Klevu.

If `Klevu Image` is not set then the `Base` image will be sent. If the `Base` image is not set then the `Placeholder` image will be sent.&#x20;

### Setting Klevu Image and Hover Image

Select this as you would select which image to use as the thumbnail for the product.

1\. Visit the product images and videos section and select the image and hover image to send to Klevu

![](https://api.archbee.com/api/optimize/Y9Igf1t4Mq0XfqFm13RFY--m8faz5Q3GYq09IpbB0IO-20250227-103807.png "Magento Product Images")

2\. Select the `Role` for the image to include `Klevu Image` or `Klevu Hover Image`

::Image[]{src="https://api.archbee.com/api/optimize/Y9Igf1t4Mq0XfqFm13RFY-4WLcfL5iDMjKwLXWygt4f-20250227-103918.png" size="64" width="1170" height="749" position="center" caption="Select Image Role" showCaption="true"}

### Image Size

The image size sent to Klevu can be configured in `Stores > Configuration > Klevu > Data Sync`.
Under the `Indexing` there are 2 settings

- Product Image Width
- Product Image Height

![](https://api.archbee.com/api/optimize/816_4eGYZQxALlijMlcBN/lgf7Cl5LXBrsBTWIpSyW4_screenshot-2024-09-12-at-145558.png)





### Image Cache Folder and Image Regeneration

The cached image path is resolved by PathProviderInterface\::get(), passing the built image params and file path.&#x20;
This follows Magento's standard convention: `pub/media/catalog/product/cache/{hash}/{image_path}`

The `{hash}` is derived from the imageParams array (width, height, type, quality, etc.) built by ParamsBuilder.&#x20;

The image is generated on demand and then served from cache on subsequent requests.&#x20;
It is only regenerated in the following cases:

If a cache doesn't exist yet,  first time the image path + params combination is encountered during indexing.

If a manual flush was done from Magento admin
If CLI command run `bin/magento catalog:images:resize`
If cache directory cleared, deleting `pub/media/catalog/product/cache/` directly

