Skip to content

Demo: image scaling provides incorrect values#1

Open
paulirish wants to merge 2 commits intodarosh:gh-pagesfrom
paulirish:gh-pages
Open

Demo: image scaling provides incorrect values#1
paulirish wants to merge 2 commits intodarosh:gh-pagesfrom
paulirish:gh-pages

Conversation

@paulirish
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Author

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

@paulirish
Copy link
Copy Markdown
Author

ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants