Skip to content

Conversation

@JimBobSquarePants
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

Prior to this PR the png encoder always used adaptive filtering when choosing the filter method to use to provide optimum compression. This generally provides the smallest output but comes at a performance cost since the scanline has to be filtered several times before compression.

This PR adds the ability to choose each of the 5 filtering methods to use per scanline row, plus adaptive filtering which gives the developer great flexibility to encode pngs to their requirements.

@codecov
Copy link

codecov bot commented Apr 28, 2018

Codecov Report

Merging #550 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #550      +/-   ##
=========================================
- Coverage   88.15%   88.1%   -0.06%     
=========================================
  Files         838     838              
  Lines       34948   34974      +26     
  Branches     2527    2529       +2     
=========================================
+ Hits        30810   30814       +4     
- Misses       3394    3398       +4     
- Partials      744     762      +18
Impacted Files Coverage Δ
...ts/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs 97.67% <100%> (+0.41%) ⬆️
src/ImageSharp/Formats/Png/PngEncoder.cs 100% <100%> (ø) ⬆️
src/ImageSharp/Formats/Png/PngEncoderCore.cs 90.56% <100%> (+0.56%) ⬆️
src/ImageSharp/Common/Helpers/ImageMaths.cs 77.41% <0%> (-6.46%) ⬇️
...sing/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs 93.1% <0%> (-3.45%) ⬇️
...Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs 69.69% <0%> (-3.04%) ⬇️
...arp.Tests/TestUtilities/TestEnvironment.Formats.cs 87.87% <0%> (-3.04%) ⬇️
.../ImageSharp.Tests/TestUtilities/TestEnvironment.cs 82.5% <0%> (-2.5%) ⬇️
...c/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs 61.4% <0%> (-1.76%) ⬇️
...TestUtilities/Attributes/ImageDataAttributeBase.cs 83.33% <0%> (-1.67%) ⬇️
... and 18 more

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 fcafc2e...2fccea5. Read the comment docs.

Copy link
Member

@dlemstra dlemstra left a comment

Choose a reason for hiding this comment

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

Nice addition

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

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

👍 looking good

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

LGTM

@JimBobSquarePants JimBobSquarePants merged commit 87103b7 into master Apr 29, 2018
@JimBobSquarePants JimBobSquarePants deleted the js/add-png-filter-options branch April 29, 2018 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants