image-ssim-js icon indicating copy to clipboard operation
image-ssim-js copied to clipboard

Demo: image scaling provides incorrect values

Open paulirish opened this issue 7 years ago • 2 comments

Since the demo page forces images into a square, the SSIM values end up being way different than if the images were evaluated on their original aspect ratio and size.

This PR...

  1. Uses canvas of the image's size and compares that.
  2. It adjusts CSS so the new canvas fits nicely in the block.
  3. And as two images with different sizes can no longer be tested against eachother, we alert the user to that error. :)

cc @patrickhulce

Before and after: image

paulirish avatar May 13 '17 03:05 paulirish

@patrickhulce in the meantime https://paulirish.github.io/image-ssim-js/test/browser_test.html has these changes live

paulirish avatar May 13 '17 19:05 paulirish

ping?

paulirish avatar Aug 08 '19 17:08 paulirish