How to Make Magento 2 Import Product Images in 2026

Apr 10, 2019 15132 Updated: May 21, 2026
How to Make Magento 2 Import Product Images in 2026

Product images shape the first impression of every Magento store. Clear, high-quality visuals help shoppers understand a product faster, build trust, and increase conversions. Magento 2 gives store owners and developers several ways to upload and manage product images, from simple admin actions to advanced API workflows.

In today’s article, we will explore four methods of adding images to a Magento product page: via the admin panel, programmatically, via import, and via the REST API.

Table of contents:

Add product image via admin panel
Add product image programmatically
Add product image via import
Add product image via REST API

Method #1: add product image via admin panel

Adding product image via the admin panel is considered the easiest way, for it does not require technical and developer expertise – only knowledge of the Magento admin panel.

Log in to the admin panel. As you navigate to Catalog -> Products, you will get to the list of products in your shop.

product dashboard magento

Choose the product you wish to add an image to and press Edit. You will get to the product configuration menu.

product page configuration menu magento

magento custom development

Magento Custom Development

Take your online store to the next level with BelVG Magento Custom Development

Visit the page

Scroll down to the Images and Videos tab. Click on the grey icon and select one or more images to upload to the product page.

images and video tab

The images uploaded should be in gif, jpg, jpeg or png formats.

magento images formats

To delete a certain image, press the basket icon in the lower left corner.

delete product image magento

Click the image to get the Image Detail configuration menu.

image detail magento

The menu consists of the following fields:

  • Alt Image – alt text of the product image;
  • Role – choose the mode of the image reflection at the product page:

Base – a good quality image that enlarges as you click on it;

base image magento

Small is an image type for the pages containing more than one image, like category or search pages.

small images magento

Thumbnail – the images placed below the Base image; they will also be reflected if you add the product to the cart.

thumbnail image magento

Swatch – the image type for advanced shop configurations; for instance, if a product is available in a wide color range, you upload several swatch images that can be applied to any product.

Method #2: add product image programmatically

In case you possess enough developer expertise, you can add a Magento product image via script.

I created the following specialized module for adding product images and declared a console command.

add image programmatically magento

Andrey_Dubina

Partner With Us

Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey

Method #3: add product image via import

Another way of adding a product image in Magento is importing. The picture will be uploaded to the Magento server, an external server, or to Media Storage.

Magento automatically creates a directory structure for product images, organized alphabetically, which means you do not need to specify the path – only place a forward slash before the file name of each image.

Log in to the admin panel and navigate to System -> Import. You will get to the import menu page. Click the Download Sample File – this is an example of how your future CSV file should look.

download sample file

To upload product images, specify in the SKU column the product SKU and add the following fields:
base_image, base_image_label, thumbnail_image, thumbnail_image_label, small_image, small_image_label.

Moreover, you need to specify the name of the picture you are uploading.

import product images csv example

Upload images into the pub/media/import folder.

import dashboard magento

Then, select the uploaded file and specify the folder you place it into. Press Check Data to make sure you have done everything right and press the Import button.

NB! In the file directory field, specify the /pub/media/import path.

magento webdesign

Magento Webdesign

Take your online store to the next level with BelVG Magento webdesign

Visit the page

Method #4: add product image via REST API

The final way is adding a product image via the REST API. If you are planning integrations with third-party services or have already performed one, this is an excellent non-admin way to upload product images.

Send to http://yourstoreurl/index.php/rest/V1/products/{sku}/media  the following request:


The request is sent via a specialized service PostMan.

api request

Wrapping it up

Adding product images in Magento 2 can be done in several ways, depending on your workflow and technical needs:

  • The Magento Admin Panel works well for manual updates and small product catalogs.
  • CSV import helps manage large numbers of product images in bulk.
  • Programmatic uploads give developers more control over custom logic and automation.
  • The Magento REST API is a strong option for third-party integrations, PIM systems, ERP connections, and automated product synchronization.

By choosing the right method, you can improve product management, keep your catalog organized, and deliver better product pages for both customers and search engines.

Magento Audit

Take your online store to the next level with BelVG Magento Audit

Visit the page
Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

FAQs for Magento 2 Import Images

How do I add a product image programmatically in Magento 2?

To add an image to a product programmatically in Magento 2, load the product using ProductRepositoryInterface and use the addImageToMediaGallery() method. Provide the image path (e.g., pub/media/import/image.jpg) and assign it to roles like image, small_image, or thumbnail. Make sure the image file exists and that Magento has the correct permissions. Save the product to apply the changes.

How do I import product images via CSV in Magento 2?

To import images in Magento, log in to the admin panel and navigate to System > Import. Click the Download Sample File – this is an example of how your future CSV file should look. Specify in the SKU column the product SKU and add the following fields: base_image, base_image_label, thumbnail_image, thumbnail_image_label, small_image, small_image_label. Upload images into the pub/media/import folder. Select the uploaded file and specify the folder where you want to place it. Press Check Data to make sure you have done everything right, and press the Import button.

How can I add a product image via the Magento 2 admin panel?

To import product images in Magento 2 through the admin panel, navigate to Catalog > Products. Choose the product to which you wish to add an image and press Edit. You will get to the product configuration menu. Scroll down to the Images and Videos tab. Click on the grey icon and select one or more images to upload. Click the image to get the Image Detail configuration menu.

What image formats are supported in Magento 2?

During Magento import products with images, you can upload pictures in JPEG (JPG), PNG, and GIF file formats. JPEG is commonly used for product photos due to its balance of quality and file size, while PNG is preferred when transparency is needed. Although GIFs are supported, they are rarely used for product visuals.

Post a new comment