function allowedImageSize(displayedWidth, displayedHeight, DPR) {
  let factor = SMALL_IMAGE_FACTOR;
  if (displayedWidth > SMALL_IMAGE_THRESHOLD || displayedHeight > SMALL_IMAGE_THRESHOLD) {
    factor = LARGE_IMAGE_FACTOR;
  }
  const requiredDpr = quantizeDpr(DPR);
  const width = Math.ceil(factor * requiredDpr * displayedWidth);
  const height = Math.ceil(factor * requiredDpr * displayedHeight);
  return [width, height];
}
Compute the size an image should have given the display dimensions and pixel density in order to
pass the audit.

For smaller images, typically icons, the size must be proportional to the density.
For larger images some tolerance is allowed as in those cases the perceived degradation is not
that bad.

@param {number} displayedWidth
@param {number} displayedHeight
@param {number} DPR
@return {[number, number]}