dmtrKovalenko / odiff

The fastest pixel-by-pixel image visual difference tool in the world.
MIT License
2.04k stars 74 forks source link

odiff-bin. outputDiffMask result is opposite #49

Open pashidlos opened 3 years ago

pashidlos commented 3 years ago

from docs:

  /** Output full diff image. */
  outputDiffMask: boolean;

Actual:

eWert-Online commented 3 years ago

@pashidlos Just to clarify, you would expect the docs comment to be changed, right? The option itself is named correctly and is doing what is expected.

dmtrKovalenko commented 3 years ago

Yeah I think we need to simply update doc and jsdoc

pashidlos commented 3 years ago

@eWert-Online for me the diff mask is the image around highlighted pixels so when I would like to draw the mask I expect to see not only diff pixels but also matched pixels when diff output mask is disabled I expect to see only diff pixels I would invert current option behaviour as for me doc text looks fine please, let me know if I misunderstand the concept

eWert-Online commented 3 years ago

To me a mask is something you can overlay on top of some other thing, to hide parts of it.

In our case, if you overlay the diff mask on top of your original image, you are "hiding" the pixels which are different. You can compare it to a Bitmask (https://en.wikipedia.org/wiki/Mask_(computing)#Common_bitmask_functions), which also uses a mask to "hide" specific bits in the original bit sequence.

So to me the concept as it is currently implemented is correct. I would only change the comment, to explain it a bit better 🙂

dmtrKovalenko commented 3 years ago

Yes agreed with @eWert-Online mask is used when you have an original image a new one and you can render diff mask on top of the original image to show diff pixels in order to not store simmilar pixels