gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Image Diff

Open shuhrat opened this issue 10 years ago • 25 comments

It would be great if you give to users ability to reconfigure some steps in gemini by external packages/scripts, for example

  • Image comparison
  • Reporters

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

shuhrat avatar Jan 30 '15 05:01 shuhrat

I understand the part about custom reporters, but why do you want custom image comparsion? If you have issues do you have with looks-same (aside from non-configurable tolerance, this will be available soon).

/cc @anton-rudeshko

SevInf avatar Jan 30 '15 12:01 SevInf

what if I want to use my own image differ or use resemble.js?

shuhrat avatar Feb 26 '15 13:02 shuhrat

But why do you want it instead of builtin?

SevInf avatar Feb 26 '15 13:02 SevInf

Coz of modularity FTW! Why not? =)

anton-rudeshko avatar Feb 26 '15 15:02 anton-rudeshko

I've come across a rather hard to fix issue with the looks-same module that gemini relies on. When taking grabs of components that have border-radius applied to them, Chrome will think there's sub-pixel differences around the edges of the rounded corners when perceivably (to my eyes anyway) there isn't any visual difference to speak of.

Doing a quick test with resemble and the two grabs that gemini creates suggest that resemblejs would allow more flexibility in how the images that are grabbed are then processed. Especially the anti-aliasing feature they use.

So that's my +1 for taking a look at resemblejs. I'll hopefully be doing some work on this, so will raise a PR if it's anything of interest.

wrench7 avatar Mar 17 '15 18:03 wrench7

Ok, I understand your point and I will happily merge a PR which allows end-users to choose between Resemble and looks-same. However, we most likely won't have time for implementing it ourself in near future, so all hope is on you.

Do you have any proposals on how it might look like? I imagine it looking somthing like this:

In config file:

engine:
  module: 'gemini-resemble',
  options:
    option: value
    ...

Where module is the name of the npm module containing the plugin and options are engine specific options (for example, tolerance and strictComparsion for looks-same, ignoreAntialiasing, ignoreColors).

Engine interface itself might look like something like this (pseudocode):

class Engine {
     constructor(options);
     compare(reference, current) -> Promise<Bool equal>
}

SevInf avatar Mar 19 '15 19:03 SevInf

@shuhrat @anton-rudeshko are you still need this ability?

sipayRT avatar Jun 06 '16 10:06 sipayRT

Having it still would be nice, but it's not necessary right now :)

anton-rudeshko avatar Jun 06 '16 14:06 anton-rudeshko

@sipayRT @SevInf do you think this feature may help me for issue #682 . Because, resemble.js ignore antialiasing works for me. The following two images with ignore antialiasing in resemble.js passing but not in look-same.

phantomjs-current

phantomjs-ref

You can try here.

bruk1977 avatar Dec 02 '16 18:12 bruk1977

@sipayRT @SevInf what do you think about my above comment?

bruk1977 avatar Dec 06 '16 05:12 bruk1977

It looks like look-same has recently been updated to ignore anti aliasing: https://github.com/gemini-testing/looks-same/pull/19

Hopefully we'll be able to use this in gemini soon

nicrodgers avatar Dec 06 '16 16:12 nicrodgers

@nicrodgers thanks for the pointer. Looks like the fix is in look-same v3.1.0 and Gemini is referencing v3.0.0. @sipayRT @SevInf when are you planning to update gemini to the latest looks-same?

bruk1977 avatar Dec 06 '16 17:12 bruk1977

I tried looks-same v3.1.0 locally, I see the code checked in with looks-same issue #19. However, two images I attached above still showed as different :(

bruk1977 avatar Dec 07 '16 01:12 bruk1977

@sipayRT @SevInf is this in your radar to be addressed? or should I find time fixing my self?

bruk1977 avatar Dec 13 '16 04:12 bruk1977

@sipayRT is on the vacation till Dec 15. When he come back we will dicuss this stuff.

j0tunn avatar Dec 13 '16 07:12 j0tunn

@j0tunn Thanks for the info.

bruk1977 avatar Dec 13 '16 13:12 bruk1977

@sipayRT @j0tunn have you got a chance to discuss on this?

bruk1977 avatar Dec 20 '16 06:12 bruk1977

hi. I'll check your images with looks-same and resemble, but both tools uses the same formula to detect antialiasing. So your diff not because of AA

sipayRT avatar Dec 21 '16 10:12 sipayRT

@sipayRT really appreciate if you check the images.... even if it's not because of AA, I would like to hear from you why resemblejs says they are the same with ignore AA but not look-same.

bruk1977 avatar Dec 21 '16 16:12 bruk1977

Below is my gemini config, incase if I need to add/modify anything.

{ "rootUrl": "http://dev.staginglocal.com/", "screenshotsDir": "./vDiffScreens", "browsers": { "phantomjs": { "retry": 3, "desiredCapabilities": { "browserName": "phantomjs" } } }, "httpTimeout": 25000, "sessionRequestTimeout": 120000, "tolerance": 5, "system": { "parallelLimit": 4 }, "compositeImage": true }

bruk1977 avatar Dec 21 '16 16:12 bruk1977

@sipayRT Happy New Year :-) ... any update?

bruk1977 avatar Jan 03 '17 17:01 bruk1977

hi. sorry for delay. The main difference between those tools is checking for 'alpha'-channel. looks-same checks only RGB when node-resemble-js check RGBA. But I see image difference without any tools. that's why looks-same (and pixelmatch) says that images are not equal

sipayRT avatar Jan 19 '17 15:01 sipayRT

@sipayRT any chance looks-same also checking RGBA? I got few issues here and there because of this ... like I see test failing in edge 14 very frequently.. .when I checked on resembleJs by enabling antialiasing, image comparison passes for the same images which are failing in Gemini.

bruk1977 avatar Feb 06 '17 02:02 bruk1977

any chance looks-same also checking RGBA?

no, it's makes no sense to check Alpha channel on screenshot that was make from browser. You can try to switch off antialiasing directly in the Edge browser to avoid these diffs

sipayRT avatar Feb 09 '17 06:02 sipayRT

@sipayRT I'm using browser stack and don't have control on Edge browser. If you don't have time to add resemblejs, I'm thinking to find sometime to add resemblejs in gemini... is that okay? Looks like that will work for me.

bruk1977 avatar Feb 13 '17 16:02 bruk1977