Skip to main content

Detect colors from image links with the Image Color Detection data service

Detect colors of product images with the Image Color Detection data service in Productsup.

Introduction

If your products lack product color descriptions, you can add them to your feed using the Image Color Detection data service. The service analyzes your image links and extracts the names and hex codes of the three primary colors in the image.

As a result of the data service work, the platform creates additional attributes in your feed with the following names:

Image color detection data services columns
  • url – a copy of your initial image attribute.

  • http_code – an HTTP client error status code. For example, 200 for successfully completing a request from the server to the internet browser.

  • remove_background – a value that shows if the color detection process includes or excludes the background of your image, where 1 means analyzing the background colors, and 0 means removing the background from the color detection process.

  • color1, color2, and color3 – three (3) main color names of the image. For example, antiquewhite.

  • color1_hex, color2_hex, color3_hex – three (3) main colors hex codes of the image. For example, #f3ebde for antiquewhite.

Prerequisites

To set up the Image Color Detection data service, you need:

  1. A product identifier. See Set a product identifier.

  2. The attribute containing links to your product images.

Add the Image Color Detection data service

  1. Go to Data Services from your site's main menu and select ADD SERVICE.

  2. Search for Image Color Detection and select Add.

    Image_color_detection.png
  3. Give the data service a desired name and prefix that should prepend the result columns names. By default, ___image_color is the column prefix.

  4. Choose the stage containing the image column in Service Data Level and select Add.

    Note

    The Image Color Detection data service is available for the import and intermediate stages.

  5. Select the column that contains your image links from the Image Column drop-down list.

    Note

    If you choose Import in Service Data Level, the drop-down list Image Column displays the columns of your import stage. If you choose Intermediate, the drop-down list contains your intermediate-stage columns.

  6. Set Remove Background to Off to include the background of your image in the color detection process. By default, this option is On, which excludes the image background from the color detection process.

  7. Select Save.

    Image column in Image Color Detection
  8. To let the platform process a new data service, select Run in the top-right corner of your site's view.

The platform creates new columns with the prefix you defined in Step 3.

Tip

The Image Color Detection data service process can take longer than your site's regular run time. To prevent delays, add the Image Color Detection data service to a pre-processing site and import the results into your production site as an additional data source.

Edit the Image Color Detection data service

  1. Go to Data Services from your site's main menu.

  2. Search for your data service.

  3. Select the cogwheel icon () next to the desired data service to edit settings.

  4. Select Save.

Delete the Image Color Detection data service

  1. Go to Data Services from your site's main menu.

  2. Select the cogwheel icon () next to the desired data service.

  3. In the Danger Area panel, select Remove this service.

  4. Select Yes.