obartra / ssim

🖼🔬 JavaScript Image Comparison
http://obartra.github.io/ssim
MIT License
299 stars 14 forks source link

I am sorry but I do not know How to do it? The example is an old version? #311

Closed catbao closed 2 years ago

catbao commented 2 years ago

import ssim from "ssim.js";

const img1 = loadImage("./img1.jpg"); const img2 = loadImage("./img2.jpg");

const { mssim, performance } = ssim(img1, img2);

console.log(SSIM: ${mssim} (${performance}ms));

The version id not correct! I want know how to do it.

obartra commented 2 years ago

Hi there, thanks for contributing!

Can you provide some more details? What error are you getting? What have you tried? It will help us debug this more easily

catbao commented 2 years ago

Thank you for your patience. My problem maybe like: If I run the code in the RunKit+npm like follows, it wil be wrong like this. I think the problem is the version, but I do not know what's the correct version to make it work. Q9K2J`K8QQ5FLY929OUK%$3 .

obartra commented 2 years ago

Apologies for the delayed response. I suspect animated gifs won't work but I also haven't tried runkit. I see now that the demo link on the README is broken, this is the link to view the code and this one is for the rendered app.

Note that you need to import ssim as:

const { ssim } = require("ssim.js");
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.