Skip to content

Conversation

Cheese-Bar
Copy link
Contributor

PR Details

Description

  • Add a public function compareImagesIgnoreBackground() in ImageComparison, which provide an enhancement to compare two pictures while ignore there position in the same pure bacground.
  • Three different test cases are added to confirm it's correctness.
  • Fix a small path error in shouldProperlyHandleBug180FromRoot().

Related Issue

Motivation and Context

  • Users sometimes only care if the content in the image has been modified, not the background, such as ignore the leading line space in issue [IMPROVEMENT] - Ignoring linespaces and comparing only text and styling changes #217 .
  • Therefore, I added a method that automatically counts the pixels in the image with the most pixels and uses them as background values. Then select the subgraph of the non-background region for comparison.

How Has This Been Tested

Three test cases were added to the unit test, respectively testing issue 217, the white background with the same content that should MATCH, and the green background with modified content that should MISMATCH.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Cheese-Bar and others added 2 commits April 24, 2022 20:27
…son, which provide an enhancement to compare two pictures while ignore there position in the same pure bacground. Three different test cases are added to confirm it's correctness. The related issue is romankh3#217
@romankh3
Copy link
Owner

Looks interesting, I'll see it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants