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

Imrpoved Gray8 accuracy #754

Merged
merged 3 commits into from
Oct 27, 2018
Merged

Imrpoved Gray8 accuracy #754

merged 3 commits into from
Oct 27, 2018

Conversation

antonfirsov
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

  • Adding 0.5f in Get8BitBT709Luminance() to get a rounded result
    • This makes the Gray8 -> Rgba32 -> Gray8 conversion return the original value to itself for all inputs (31 was an outlier for example)
    • Please let me know if I misunderstood how should this work, but for me it seems much reasonable with the rounding!
  • More efficient & more accurate FromVector4 implementation
  • More tests

@JimBobSquarePants
Copy link
Member

That makes sense me. We're not losing when rounding then.

@codecov
Copy link

codecov bot commented Oct 27, 2018

Codecov Report

Merging #754 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #754      +/-   ##
==========================================
+ Coverage    88.4%   88.41%   +0.01%     
==========================================
  Files         997      996       -1     
  Lines       42325    42385      +60     
  Branches     3142     3142              
==========================================
+ Hits        37416    37476      +60     
  Misses       4225     4225              
  Partials      684      684
Impacted Files Coverage Δ
tests/ImageSharp.Tests/PixelFormats/Gray8Tests.cs 100% <100%> (ø) ⬆️
src/ImageSharp/Common/Helpers/ImageMaths.cs 87.17% <100%> (ø) ⬆️
...geSharp/PixelFormats/PixelImplementations/Gray8.cs 79.16% <100%> (+1.38%) ⬆️
tests/ImageSharp.Tests/TestImages.cs 100% <0%> (ø) ⬆️
...Sharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs 100% <0%> (ø) ⬆️
.../ImageSharp.Tests/Common/EncoderExtensionsTests.cs

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e508683...953c1ae. Read the comment docs.

@antonfirsov
Copy link
Member Author

@JimBobSquarePants should we merge this then?

@JimBobSquarePants
Copy link
Member

Yeah, I was just waiting on it to finish building

@antonfirsov antonfirsov merged commit 937dd81 into master Oct 27, 2018
@JimBobSquarePants JimBobSquarePants deleted the af/better-gray8 branch October 27, 2018 15:41
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