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

pngsave: Change default row filter from 'all' to 'none' #2929

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

lovell
Copy link
Member

@lovell lovell commented Jul 15, 2022

As discussed in libvips/devchat.

Preventing the use of adaptive row filtering is usually faster and produces a smaller file size, especially as PNG is typically used for diagrams and line art.

This has been the default behaviour of sharp since early 2018 - see lovell/sharp#872

This will help alleviate #2900

as this is usually faster and produces a smaller file size
@jcupitt
Copy link
Member

jcupitt commented Jul 15, 2022

I tried a few tests and none is indeed better for line art and synthetic images. It's quite a bit worse for photos, but as you say that's not the usual use of PNG. Let's do it!

@jcupitt jcupitt merged commit 1bf1a32 into libvips:master Jul 15, 2022
@lovell lovell deleted the pngsave-filter-default-none branch July 15, 2022 21:00
@dloebl
Copy link
Contributor

dloebl commented Jul 20, 2022

I just wanted to share some data on this change of the default value:

Filter avg size p50 size p99 size avg processing time p99 processing time
all 435 KB 137 KB 4800 KB 341 ms 2487 ms
none 480 KB 154 KB 4972 KB 193 ms 1377 ms

Processing times are better. File sizes increased by about 10% on average.
We tested this with 2500 transformation tasks from our PNG traffic (resizes, crops etc).

Libraries in use:
libpng v1.6.37
zlib-ng v2.0.6

@jcupitt
Copy link
Member

jcupitt commented Jul 20, 2022

Yes, I saw about a 2x speedup as well. Thanks for testing!

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.

None yet

3 participants