Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution for issue#190 #229

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

scp-WFZ
Copy link

@scp-WFZ scp-WFZ commented May 24, 2022

PR Details

To solve the problem in issue, I modify the formula to calculate the percentage of different pixels.

Description

I add a function isDiffPixel() to return true if two pixels have the different RGBs, and in function getDifferencePercent(), the formula to calculate the percentage is 100 * diff pixels number / all pixels number.

Related Issue

Motivation and Context

The original formula to calculate the percentage of different pixels is not intuitive and clear to the user. The new calculation formula makes it easier for users to know the number of different pixels.

How Has This Been Tested

Two tests are for the comparison with different images and the same images, I add a new assert to check the percentage of diff Pixels / all Pixels is right.

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.

@scp-WFZ scp-WFZ changed the title Version for issue#190 Solution for issue#190 May 24, 2022
Copy link
Owner

@romankh3 romankh3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss my comments

@@ -16,11 +16,18 @@
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove extra lines.

/**
* Tools for the {@link ImageComparison} object.
*/
public final class ImageComparisonUtil {

public static int OFFSET = 0xff;
public static int EIGHT = 8;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the difference between EIGHT and TENSIX?

@@ -64,4 +64,34 @@
</plugin>
</plugins>
</build>

<reporting>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tell me please, for what reason you've added it?

@romankh3 romankh3 force-pushed the version-for-issue#190 branch from e27a49d to 89e24bc Compare September 23, 2022 15:56
@romankh3
Copy link
Owner

Please, fix the build

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