Set bgColor of responsive images with transparencies to transparent (PNGs and GIFs)

Hello there,

I noticed the ‘bgColor’ and ‘colors’ fields for images don’t return the correct colors for e.g. black and white logos in .png or .gif file format with transparencies.

For example take a logo with a transparent background and black text, the only colors in the png file are obviously black and transparent, yet your image analysis is returning shades of grey.

I know the Google Cloud Vision API also has this issue, so if this is out of your hands, possibly a manual override for png with transparency enabled would solve this: set ‘bgColor’ to ‘transparent’.

my current fix:

  $: if(src.includes('.png?')){
    bgColor = 'transparent';
  }