grunt-photobox icon indicating copy to clipboard operation
grunt-photobox copied to clipboard

Only show screenshots when there are differences (optional)

Open sgabler opened this issue 10 years ago • 5 comments

It would be nice to have the option to only show the screenshots on the summary page if they are different. For other cases it could show "No differences detected".

This should be configurable.

The benefit is that you filter out the irrelevant screenshots.

sgabler avatar Nov 06 '14 09:11 sgabler

Jap, definitely would be useful.

Can not promise in near future though. But I'm looking for contributors. :bowtie:

stefanjudis avatar Nov 06 '14 12:11 stefanjudis

Looks useful to me as well. Im quite busy at the moment, but I can take a look on implementing this at the end of the next week :)

danielhusar avatar Nov 06 '14 15:11 danielhusar

@danielhusar that would be pure awesomeness!

stefanjudis avatar Nov 06 '14 16:11 stefanjudis

I looked at the code out of curiosity and tried to understand how everything is connected. Here's my first idea on how to solve this with ImageMagick:

  • The diff image will be completely white when there are no changes
  • This means that the total amount of colors will be 1
  • By running identify -format "%k" image.png i was able to get the amount of colors
  • If the result is 1, then we could exclude this diff from the result page

Not sure if this is a good approach, as I am completely new to ImageMagick. What do you guys think about this?

(EDIT: Found a better command to determine the amount of colors in the image)

sgabler avatar Nov 08 '14 01:11 sgabler

Hey thanks for jumping in. :bowtie:

I'd say, I read something about a compare command. Never tried it though - maybe that's a bit cleaner?

http://www.imagemagick.org/Usage/compare/

Then the images could be compared and only if differences are present the diff image would be generated.

What do you think?

stefanjudis avatar Nov 08 '14 01:11 stefanjudis