rsmbl / Resemble.js

Image analysis and comparison
http://rsmbl.github.io/Resemble.js/
MIT License
4.48k stars 423 forks source link

Ignoring antialiasing does not work correctly #151

Open DudaGod opened 5 years ago

DudaGod commented 5 years ago

Hello guys.

How do you think these images are equivalent if you want to ignore antialiasing?

resemble js image analysis 2018-09-05 19-12-43

Expected behaviour: comparison with tolerance 2.3 and with ignore antialiasing

jamescryer commented 5 years ago

Apologies for the very late response. The ignore antialiasing mode is more tolerant of colour difference, in this case though I agree that it's a little too tolerant.

https://github.com/rsmbl/Resemble.js/blob/master/resemble.js#L879

It think its fair to say it should only use the increased tolerance mode on pixels identified as "anti-aliased" rather than all pixels. Any change in behaviour in this regard would probably require a major release.

rodrigo-garcia-leon commented 4 years ago

Hey, is this issue still relevant? and if so can I work on it? 🧐

jamescryer commented 4 years ago

@rodrigo-garcia-leon Of course, although it may take me a while to review any changes.

rodrigo-garcia-leon commented 4 years ago

Excellent 👌

rodrigo-garcia-leon commented 4 years ago

Hi @jamescryer,

I've been reading the code to understand the issue and come up with possible solutions. I have three ideas in mind:

  1. Lower the tolerance thresholds in https://github.com/rsmbl/Resemble.js/blob/master/resemble.js#L981
  2. Create an intermediate setting with different tolerance thresholds
  3. Allow the definition of the thresholds via the options object

Additionally, there's the improvement that you mentioned; use the increased tolerance mode only on pixels identified as "anti-aliased".

Not sure how to proceed, what do you think?

asterium commented 4 years ago

Hi @rodrigo-garcia-leon, It's offtopic for this specific bug, however option 3 mentioned will be very useful feature. Please let me know if I should open separate issue in order to implement it

RossNE99 commented 3 weeks ago

Is this still an issue, im having a similar problem when I have enabled ignore antialiasing, it seems to be somewhat working but it is highlighting some areas in grey instead of the specified color image

Diffrence only mode image

Ignore less disabled image