ūüöÄ We're launching Video Optimization in beta! Read the announcement.

Image Optimization Akeneo Connector for TwicPics

Deliver perfectly optimized images from your Akeneo PIM to your websites and apps in a blink of an eye.


What is TwicPics?

TwicPics is a real-time media processing service that enables developers and companies of all sizes to deliver rich and optimized visual content to their website.

TwicPics is more precisely a Responsive Image Service Solution (SaaS). It offers on-demand responsive image generation combined with a well-thought-out and unobtrusive JavaScript library, all based around a URL-based API.

With the help of the Image Optimization Akeneo Connector for TwicPics, you can define your PIM as the source of your assets to serve perfectly optimized images to your websites and apps through TwicPics.


Want to know more about TwicPics? Click here for more information.


The Image Optimization Akeneo Connector for TwicPics requires you to:

  • Own an account (PIM) on Akeneo
  • Own an account on TwicPics
  • Set up the connections between your accounts, on both your Akeneo PIM and your TwicPics back-office
For now and by default, the option of using Akeneo as a source authentication for image optimization does not appear on the TwicPics back-office. After  creating your TwicPics account , contact us to activate the option in your TwicPics back office.

The Image Optimization Akeneo Connector for TwicPics works with the Akeneo 1.7+ and Serenity versions, depending on which image types you need to request from your Akeneo PIM.

Supported image types

The Image Optimization Akeneo Connector for TwicPics can get and optimize these following image types from your Akeneo PIM to your websites and apps:

Features & benefits

The Image Optimization Akeneo Connector for TwicPics allows you to benefit from the same features as if you were using TwicPics in the standard way.

  • Image resizing and DPR:¬†TwicPics automatically detects the DPR of your visitors. It means we automatically size your existing and future images at the correct DPR for any device.
  • Lazy loading: TwicPics automatically defers offscreen images to improve page loading time. It also offers images placeholders functionality to deliver a better user experience.
  • Many image formats processing: TwicPics supports non-animated AVIF, GIF, HEIF, JPEG, PNG and WebP formats.
  • Next-Gen format and WebP conversion: by default, and for better optimization, TwicPics automatically converts your images to WebP format for all compatible devices.
  • Lossless compression: TwicPics automatically removes useless data and compresses images on the fly. Reduce image size by up to 75% without compromising its quality.
  • SEO optimizations
  • Global CDN: serve your images closer to your visitors thanks to a worldwide CDN powered by Amazon‚ĄĘ.
  • Rock solid architecture: 99.999% service uptime and 99.99% image delivery success on average.

Akeneo PIM setup

The very first step to install the Image Optimization Akeneo Connector for TwicPics is to create a "connection" from your PIM interface. Refer to the complete documentation of Akeneo to see how you can create the "connection" that will connect TwicPics to your Akeneo PIM, or apply these following steps:

  1. From your Akeneo PIM interface, click on Connect.

  2. Then on Connection settings.

  3. Click on the button Create that will redirect you to the "connection" creation form.

  4. Here in the Label field, enter the name of the connector - this name could be TwicPics or TwicPics connector.

  5. Choose the Flow type of your "connection" (see the official documentation for more information).

  6. Grab your "connection" credentials (Client Id, Secret, Username and Password). Through the header authentication of the connector, they will be used to authenticate TwicPics' calls to Akeneo API and get your images from your PIM.


  7. Set the proper permissions for both the user role and the user group (see the official documentation for more information).

TwicPics account setup

Create your TwicPics account

If you don't have any TwicPics account yet, you can easily sign up here for free.

With your brand new account comes a subdomain akin to <sub>.twic.pics that should has been created during the onboarding process. All your media will be delivered through this domain from now on.


Connect your TwicPics domain to your Akeneo PIM

From the "Domains" section of your TwicPics Workspace, click on the Create path button.

A panel will open, in which you must set the URL of your Akeneo PIM as the Source URL.

For instance, if your Akeneo PIM is located at https://<your-pim-subdomain>.akeneo.com then the Source URL must be set to https://<your-pim-subdomain>.akeneo.com.


Then, select the Akeneo Connector option as the source authentication to fetch your images from your Akeneo PIM.


And fill in the credentials of your TwicPics connector (grabbed from your Akeneo PIM) in the dedicated fields.


Click on the Add button located at the bottom right of the popup window: the newly created connection between your TwicPics domain and your Akeneo PIM now appears in the list of paths.

From now on, you can begin integrating and optimizing your Akeneo PIM images to your websites and apps with TwicPics.

Integrate your PIM images

To integrate and optimize your Akeneo PIM images with TwicPics, simply use your TwicPics domain (e.g. https://my-company.twic.pics). The endpoint to use depends on the type of image to be optimized:

By products media files

  • Endpoint: /media/<media code>, with <media code> being the code of the media file associated to a product.
  • For instance: https://my-company.twic.pics/media/<media code> could be https://my-company.twic.pics/media/5/9/z/2/43z8b1586_DEMO_IMAGE.jpg.

By assets media files

  • Endpoint: /asset/<asset family>/<media code>, with <media code> being the code of the media file associated to an asset, and <asset family> the name of the asset family it belongs to.
    Due to the behavior of Akeneo API, you have to indicate the name of the asset family to get the asset media file.
  • For instance: https://my-company.twic.pics/asset/<asset family>/<media code> could be https://my-company.twic.pics/asset/deco/DECO_TEXTILE_CURTAIN_WHITE_300152243027.

By reference entities or records media files

  • Endpoint: /reference-entity/<media code> with <media code> being the code of the media file associated to a reference entity or a record.
  • For instance: https://my-company.twic.pics/reference-entity/<media code> could be https://my-company.twic.pics/reference-entity/color200.
To integrate your images on your websites and apps, you can either use the TwicPics script to automatically adapt your PIM images to your users or the API if you prefer writing manual request optimizations.

The example below shows a PIM image integration with the TwicPics script:

  alt="Demo image"
You can refer to our documentation for more information about the script setup .

Here the example makes use of TwicPics API to integrate the PIM image:

  alt="Demo image"
Refer to our API documentation to see every possible transformation you can manually apply to your Akeneo PIM images.

Select specific assets media files

The assets media files endpoint can actually feature multiple images. By default, the TwicPics Akeneo Connector will use the first one following the order in which the Akeneo API itself sent them.

You can override this behaviour in two ways:

  • using indexing
  • using filtering


Let's consider the asset located at https://my-company.twic.pics/asset/cloth/dress and let's suppose that there are at least three images associated to it.

You can retrieve the third image by adding its index at the end of the URL like so:

https://my-company.twic.pics/asset/cloth/dress/2 (notice the /2 at the end)

Indexes are zero-based, thus to get the first element, you have to use index 0 and to get the third element, you have to use index 2.

If the asset only features two images, then the TwicPics Akeneo Connector will simply circle back. So, in that instance, the three following URLs would be strictly equivalent:

  • https://my-company.twic.pics/asset/cloth/dress/2
  • https://my-company.twic.pics/asset/cloth/dress/0
  • https://my-company.twic.pics/asset/cloth/dress


While indexing can be useful, it can prove more effective to filter images based on associated values.

Many asset media are localized and this information is usually stored in the Akeneo API as a locale value attached to each image. You can add a filtering condition at the end of the URL to select language-specific images.

For instance:


would retrieve the american english images associated with the asset.

If there happen to be several such images, you can use indexing to select a specific one like so:


But what happens if you don't have a locale=en_US image? The TwicPics Akeneo Connector would return a 404 response. Thankfully, you can chain filters so that each subsequent filter acts as a fallback.

Let's take the following example:


This will deliver:

  • the first american english image if there is any
  • failing that, the first french image if there is any
  • failing that, the first non-language specific image is there is any

Furthermore, filters can contain complex logical expressions using parenthesis and logical operators & and |.

For instance, supposing you have a color value associated to your images, you could write filters of the form:

  • locale=en_US&color=blue
  • or (locale=en_US|locale=fr_FR)&color=blue

Finally, the special filter true can be useful as a "whatever is there" kind of fallback.

For instance, locale=en_US&color=blue/true would return the american english, blue colored images if they exist or whatever is there otherwise.

Support service

For any issue related to the Image Optimization Akeneo Connector for TwicPics, please contact the support team by sending an email at support@twic.pics.

Check out our Service Level Agreement to get more information about our different services.

responsive images

The All-In-One Toolbox For Your Medias

The simplest, most powerful way to tackle responsive images & videos