Detect if browser can render HEIC image

Is there an easy way to detect if a browser can render HEIC image?

I can think of one way, render a pixel heic image and check the color of the pixel post render. Something like:

const myImg = new Image();
myImg.crossOrigin = "Anonymous";
myImg.onload = () => {
  const context = document.createElement('canvas').getContext('2d');
  context.drawImage(myImg, 0, 0);
  const {
    data
  } = context.getImageData(10, 10, 1, 1);
  console.log(data)
}
myImg.src = 'https://picsum.photos/200/300';

Wondering, if there is a better way?