I am trying to compare a png image with jpeg using ssim from skimage. But the similarity is less than 60 percent even though the images are the same. Is it possible to compare png and jpg images using ssim. Is there any other method to do the same?
from skimage.io import imread
from skimage.metrics import structural_similarity as ssim
from skimage.transform import resize
im1 = imread("image1.png")
im1 = resize(im1, (256, 256))
im2 = imread("image2.jpg")
im2 = resize(im2, (256, 256))
similarity = ssim(im1, im2)
print(similarity)
output:
0.5043544790072482
Both the images are generated by iOS testing tools.
PS: I know that the images are different when comparing at pixel level. But they look the same, so I am expecting the comparison result should also reflect the same. Is there any way to do that?
Also note that the images uploaded are for reference. Stackoverflow uses imgur in the background which automatically converts jpg to png.