moshensky / pdf-visual-diff

Visual Regression Testing for PDFs in JavaScript
MIT License
40 stars 17 forks source link

Diff in different OS #27

Closed jonyw4 closed 1 year ago

jonyw4 commented 3 years ago

Hi guys, amazing project!

I generate some images using macOS 11.5.2 with graphicsmagick ghostscript in Rosetta, and then, when I run in Ubuntu 20 (Github action default ubuntu) I have a slight change in some pixel and that fail the test. I could increase the tolerance, but I want to have a pixel-perfect comparison. Do you know if graphicsmagick has something to do with this? Do you know what I could do to not achieve this problem?

jonyw4 commented 3 years ago

I saw this article maybe is related to that http://jeromebelleman.gitlab.io/posts/graphics/gmpdf/

badigina-merck commented 3 years ago

Same for me when running tests in CI (jenkins + docker) VS snapshot created locally on Mac

Its-Alex commented 2 years ago

@moshensky Up?

moshensky commented 2 years ago

I will look into it and write back in a few days.

moshensky commented 2 years ago

This has to do something with the conversion of pdfs to images, where it seems some colors could differ a tiny bit. In my tests setting tolerance: 0.0000001 solves it. I'm curious to look at your pdfs and relevant expected images that fail, if you could share them. For the time being I'm thinking whether to change default tolerance to the above number.

moshensky commented 2 years ago

Please provide your local gm versions as well.

moshensky commented 2 years ago

So far for pixel perfect comparison same versions of graphicsmagick (maybe gs as well) need to be used everywhere. I was not able to find any reliable options for convert that would work between versions 1.3.35 and 1.3.38.

moshensky commented 2 years ago

I have updated how images are generated. My initial tests are successful. Most probably tomorrow I will release new version. Unfortunately all snapshots will have to be regenerated.

moshensky commented 1 year ago

Should be solved by latest two versions.