Code Monkey home page Code Monkey logo

Comments (8)

marcelerz avatar marcelerz commented on May 24, 2024

This won't work in all cases. For example, if a blur-filter (or any box-filter) is applied to remove high-frequencies, then values from neighboring pixels will be applied to the currently compared pixel and therefore share some of the information, even though they should actually be ignored. What I have done in the past, for example in the Hodman project, was to black-out some areas before applying the filters, or even save screenshots as is. This way, the pixel will share the same black pixel across comparisons. What I can do is to black-out the pixels and then compare black-to-black. This will make sure that there is no additional hash lookup for each pixel (so, no slow-down), and cases like shared pixel values will also be covered.

Here is an example:
black-out-example

Does this work for you?

from blink-diff.

koola avatar koola commented on May 24, 2024

So If I understand correctly, you would black-out a region in ImageA then define that region as a property in blinkdiff to ignore?

If that's the case, then that's great.

from blink-diff.

marcelerz avatar marcelerz commented on May 24, 2024

No, actually, I would black-out the area in imageA and imageB, and when the pixels are compared, then they are the same because they are both black.

One thing to note here is that the black-out area would be visible in the result to avoid having "ghost differences". What I mean with that are the differences in position - when the area moves due to CSS changes. For example, since the contents are blacked-out, they will not be used to be compared and shifts of the DOM element would be missed. But, when they are blacked-out, these differences will be noted by Blink-Diff since the whole frame will be shifted. If we, however, remove the black-out in the result, then differences will be highlighted in areas where there are non. That means, black-outs have to stay in the result to show what has been compared.

I hope that makes sense.

from blink-diff.

koola avatar koola commented on May 24, 2024

So I would manually black-out the area in imageA and imageB? Couldn't blinkdiff do the black-out in imageB itself via some property bounds set?

from blink-diff.

marcelerz avatar marcelerz commented on May 24, 2024

Yes, Blink-Diff could do that. The question is simply if this is acceptable for you.

from blink-diff.

koola avatar koola commented on May 24, 2024

That's absolutely acceptable. Thank you.

from blink-diff.

marcelerz avatar marcelerz commented on May 24, 2024

Sorry for the wait. I finally implemented it. The command-line has now the parameter block-out which gives the coordinates comma-separated, and this one can be called multiple times in the row.
When you access the API directly, then you can even modify the color of the blocking-out - by default it is black. I made it so that the blocked-out area is not visible by default, but when you set the debug flag, you can see the blocked-out areas in the result. This might be cleaner. Let me know if you have any questions or changes to this feature.
The current version is: [email protected]

from blink-diff.

koola avatar koola commented on May 24, 2024

Thank you for implementing this. It's awesome as is!

from blink-diff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.