Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need better DiffMarkupPolicy algorithm #409

Open
xtianus opened this issue Aug 18, 2023 · 1 comment
Open

Need better DiffMarkupPolicy algorithm #409

xtianus opened this issue Aug 18, 2023 · 1 comment

Comments

@xtianus
Copy link

xtianus commented Aug 18, 2023

Sometimes, when taking two screenshots of the same page with the same PC in Chrome I get slightly different bitmaps for text.
This is an example diff:

image

The reason might be that antialias is not always the same. These are the two zoomed screenshots:

Screenshot 2023-08-18 at 5 16 11 PM

Screenshot 2023-08-18 at 5 16 43 PM

I can notice some color in the former that is absent in the latter.
Using setDiffSizeTrigger() doesn't help because it only counts the total number of points and this value can be very big when there is a long paragraph.

@xtianus
Copy link
Author

xtianus commented Aug 18, 2023

As a workaround for this specific issue I'm turning all pages to B&W with this injected CSS:

document.documentElement.style.filter = 'grayscale(100%)';

This is giving me no diff errors on the above text anymore.

I'm still getting some diffs on other parts of the page that, maybe because of animations, turn out to be a little different than before due to timing I guess.

So maybe I'd like to have a diff algorithm that counts the changed pixels locally, for example for each 100x100 square of the image.

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

No branches or pull requests

1 participant