No description
Find a file
Joshua Holmer b67083da0c Revise benchmarks to be more direct [ci skip]
Now actually runs through the whole suite without file locking issues.

Initial results:

     Running target/release/deflate-032c8bb6310daa8e

running 20 tests
test bench_deflate_16_bits_strategy_0 ... bench:  34,772,065 ns/iter (+/- 3,927,686)
test bench_deflate_16_bits_strategy_1 ... bench:  35,829,570 ns/iter (+/- 1,683,748)
test bench_deflate_16_bits_strategy_2 ... bench:  12,428,913 ns/iter (+/- 1,005,308)
test bench_deflate_16_bits_strategy_3 ... bench:  13,247,589 ns/iter (+/- 1,026,688)
test bench_deflate_1_bits_strategy_0  ... bench:     232,037 ns/iter (+/- 5,818)
test bench_deflate_1_bits_strategy_1  ... bench:     235,463 ns/iter (+/- 25,972)
test bench_deflate_1_bits_strategy_2  ... bench:     168,770 ns/iter (+/- 20,463)
test bench_deflate_1_bits_strategy_3  ... bench:      32,254 ns/iter (+/- 1,034)
test bench_deflate_2_bits_strategy_0  ... bench:     537,638 ns/iter (+/- 27,704)
test bench_deflate_2_bits_strategy_1  ... bench:     532,766 ns/iter (+/- 26,777)
test bench_deflate_2_bits_strategy_2  ... bench:     313,566 ns/iter (+/- 29,872)
test bench_deflate_2_bits_strategy_3  ... bench:      44,436 ns/iter (+/- 3,554)
test bench_deflate_4_bits_strategy_0  ... bench:   2,259,173 ns/iter (+/- 236,430)
test bench_deflate_4_bits_strategy_1  ... bench:   2,259,694 ns/iter (+/- 254,753)
test bench_deflate_4_bits_strategy_2  ... bench:     731,383 ns/iter (+/- 21,518)
test bench_deflate_4_bits_strategy_3  ... bench:     193,049 ns/iter (+/- 24,552)
test bench_deflate_8_bits_strategy_0  ... bench:  26,799,023 ns/iter (+/- 2,322,131)
test bench_deflate_8_bits_strategy_1  ... bench:  26,986,947 ns/iter (+/- 3,026,671)
test bench_deflate_8_bits_strategy_2  ... bench:   5,844,986 ns/iter (+/- 547,120)
test bench_deflate_8_bits_strategy_3  ... bench:   5,401,345 ns/iter (+/- 592,391)

test result: ok. 0 passed; 0 failed; 0 ignored; 20 measured

     Running target/release/filters-4cdef7ed188d5a43

running 30 tests
test bench_16_bits_filter_0 ... bench:   1,201,636 ns/iter (+/- 122,922)
test bench_16_bits_filter_1 ... bench:   2,515,136 ns/iter (+/- 351,661)
test bench_16_bits_filter_2 ... bench:   2,536,454 ns/iter (+/- 595,207)
test bench_16_bits_filter_3 ... bench:   2,555,551 ns/iter (+/- 519,059)
test bench_16_bits_filter_4 ... bench:   6,413,073 ns/iter (+/- 505,450)
test bench_16_bits_filter_5 ... bench:  27,124,584 ns/iter (+/- 3,171,162)
test bench_1_bits_filter_0  ... bench:      55,761 ns/iter (+/- 19,412)
test bench_1_bits_filter_1  ... bench:      80,915 ns/iter (+/- 13,928)
test bench_1_bits_filter_2  ... bench:      80,479 ns/iter (+/- 9,268)
test bench_1_bits_filter_3  ... bench:      86,080 ns/iter (+/- 47,504)
test bench_1_bits_filter_4  ... bench:     154,723 ns/iter (+/- 3,932)
test bench_1_bits_filter_5  ... bench:     805,938 ns/iter (+/- 118,853)
test bench_2_bits_filter_0  ... bench:      74,940 ns/iter (+/- 14,205)
test bench_2_bits_filter_1  ... bench:     126,821 ns/iter (+/- 22,497)
test bench_2_bits_filter_2  ... bench:     126,445 ns/iter (+/- 17,852)
test bench_2_bits_filter_3  ... bench:     129,264 ns/iter (+/- 52,772)
test bench_2_bits_filter_4  ... bench:     267,978 ns/iter (+/- 7,064)
test bench_2_bits_filter_5  ... bench:   1,354,604 ns/iter (+/- 206,764)
test bench_4_bits_filter_0  ... bench:     119,468 ns/iter (+/- 13,806)
test bench_4_bits_filter_1  ... bench:     219,357 ns/iter (+/- 34,642)
test bench_4_bits_filter_2  ... bench:     218,588 ns/iter (+/- 11,280)
test bench_4_bits_filter_3  ... bench:     222,955 ns/iter (+/- 60,112)
test bench_4_bits_filter_4  ... bench:     516,987 ns/iter (+/- 33,155)
test bench_4_bits_filter_5  ... bench:   2,424,414 ns/iter (+/- 244,989)
test bench_8_bits_filter_0  ... bench:     551,986 ns/iter (+/- 89,602)
test bench_8_bits_filter_1  ... bench:   1,234,364 ns/iter (+/- 307,291)
test bench_8_bits_filter_2  ... bench:   1,150,679 ns/iter (+/- 35,718)
test bench_8_bits_filter_3  ... bench:   1,161,331 ns/iter (+/- 124,379)
test bench_8_bits_filter_4  ... bench:   3,704,653 ns/iter (+/- 659,212)
test bench_8_bits_filter_5  ... bench:  13,863,376 ns/iter (+/- 2,134,142)

test result: ok. 0 passed; 0 failed; 0 ignored; 30 measured

     Running target/release/interlacing-3a5b64514b03c920

running 10 tests
test bench_deinterlace_16_bits ... bench: 144,075,159 ns/iter (+/- 3,388,596)
test bench_deinterlace_1_bits  ... bench:   2,848,418 ns/iter (+/- 480,685)
test bench_deinterlace_2_bits  ... bench:   5,608,614 ns/iter (+/- 224,235)
test bench_deinterlace_4_bits  ... bench:  11,114,761 ns/iter (+/- 943,506)
test bench_deinterlace_8_bits  ... bench:  71,918,245 ns/iter (+/- 5,374,438)
test bench_interlace_16_bits   ... bench: 186,786,301 ns/iter (+/- 108,170,992)
test bench_interlace_1_bits    ... bench:   3,298,814 ns/iter (+/- 299,550)
test bench_interlace_2_bits    ... bench:   6,615,721 ns/iter (+/- 886,353)
test bench_interlace_4_bits    ... bench:  13,148,900 ns/iter (+/- 1,015,178)
test bench_interlace_8_bits    ... bench:  86,973,845 ns/iter (+/- 2,876,862)

test result: ok. 0 passed; 0 failed; 0 ignored; 10 measured

     Running target/release/oxipng-0aa81de33b66b9ba

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

     Running target/release/oxipng-8dc3c38a24f45aca

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

     Running target/release/reductions-706f4e9274315f2d

running 20 tests
test bench_16_to_8_bits                ... bench:   1,462,010 ns/iter (+/- 245,041)
test bench_2_to_1_bits                 ... bench:   9,090,966 ns/iter (+/- 949,980)
test bench_4_to_1_bits                 ... bench:  17,291,283 ns/iter (+/- 2,295,195)
test bench_4_to_2_bits                 ... bench:  18,106,877 ns/iter (+/- 3,257,698)
test bench_8_to_1_bits                 ... bench:  33,967,094 ns/iter (+/- 1,963,155)
test bench_8_to_2_bits                 ... bench:  34,834,040 ns/iter (+/- 2,992,472)
test bench_8_to_4_bits                 ... bench:  36,904,665 ns/iter (+/- 2,767,626)
test bench_palette_duplicate_reduction ... bench:   5,113,086 ns/iter (+/- 449,931)
test bench_palette_full_reduction      ... bench:  14,751,743 ns/iter (+/- 1,412,029)
test bench_palette_unused_reduction    ... bench:   9,639,936 ns/iter (+/- 462,188)
test bench_rgb_to_grayscale_16         ... bench:  29,428,159 ns/iter (+/- 3,303,357)
test bench_rgb_to_grayscale_8          ... bench:   7,224,088 ns/iter (+/- 951,724)
test bench_rgb_to_palette_8            ... bench:  34,767,333 ns/iter (+/- 1,765,318)
test bench_rgba_to_grayscale_16        ... bench:  28,374,910 ns/iter (+/- 1,495,313)
test bench_rgba_to_grayscale_8         ... bench:  14,288,546 ns/iter (+/- 1,106,506)
test bench_rgba_to_grayscale_alpha_16  ... bench:  20,908,298 ns/iter (+/- 1,351,356)
test bench_rgba_to_grayscale_alpha_8   ... bench:  10,504,579 ns/iter (+/- 1,093,582)
test bench_rgba_to_palette_8           ... bench:  42,195,599 ns/iter (+/- 1,868,201)
test bench_rgba_to_rgb_16              ... bench:  15,955,026 ns/iter (+/- 2,242,433)
test bench_rgba_to_rgb_8               ... bench:   8,185,576 ns/iter (+/- 1,116,708)

test result: ok. 0 passed; 0 failed; 0 ignored; 20 measured
2016-04-20 11:30:08 -04:00
benches Revise benchmarks to be more direct [ci skip] 2016-04-20 11:30:08 -04:00
doc Version 0.4.0 2016-04-08 13:52:15 -04:00
src Don't report pretend mode if verbosity is set to none 2016-04-19 22:38:34 -04:00
tests Add palette reduction 2016-04-13 23:16:32 -04:00
.codeclimate.yml Play around with codeclimate [ci skip] 2016-04-07 09:42:29 -04:00
.gitignore Implement multithreading for deflate passes 2016-02-04 10:32:20 -05:00
.travis.yml Revert last commit [ci skip] 2016-03-03 16:04:12 -05:00
Cargo.toml Add benchmark suite using cargo 2016-04-19 23:26:05 -04:00
CHANGELOG.md Add benchmark suite using cargo 2016-04-19 23:26:05 -04:00
index.html Add interface for rustdoc to github pages 2016-03-11 12:13:13 -05:00
LICENSE Add MIT License 2016-01-01 00:46:40 -05:00
README.md Update README [ci skip] 2016-04-08 09:01:32 -04:00
rustfmt.toml Completely parse CLI options 2016-01-08 15:09:00 -05:00

Oxipng

Build Status Version License

Overview

Oxipng is a lossless PNG compression optimizer.

Note: This package should be considered a beta. Although there are many tests in place, there is still a chance of data loss or corruption. You should backup your files before using this tool, unless you are very brave.

If you encounter an issue, please report it via the GitHub issues tab. Include as many details as possible.

Installing

Oxipng can be installed from Cargo, via the following command:

cargo install oxipng

Alternatively, oxipng can be built from source using the latest stable or nightly Rust:

git clone https://github.com/shssoichiro/oxipng.git
cd oxipng
cargo build --release
cp target/release/oxipng /usr/local/bin

Please note that zlib is a required build dependency. Oxipng should work with any 1.x version of zlib, but you are advised to use the latest version (currently 1.2.8) for security and bug fixes.

The current minimum supported Rust version is 1.6.0. Oxipng may compile on earlier versions of Rust, but there is no guarantee.

Oxipng follows Semantic Versioning.

Usage

Oxipng is a command-line utility. Basic usage looks similar to the following:

oxipng -o 4 -i 1 --strip safe *.png

The most commonly used options are as follows:

  • Optimization: -o 1 through -o 6, lower is faster, higher is better compression. The default (-o 2) is sufficiently fast on a modern CPU and provides 30-50% compression gains over an unoptimized PNG. -o 4 is 6 times slower than -o 2 but can provide 5-10% extra compression over -o 2. Using any setting higher than -o 4 is unlikely to give any extra compression gains and is not recommended.
  • Interlacing: -i 1 will enable Adam7 PNG interlacing on any images that are processed. -i 0 will remove interlacing from all processed images. Not specifying either will keep the same interlacing state as the input image. Note: Interlacing can add 25-50% to the size of an optimized image. Only use it if you have a good reason.
  • Strip: Used to remove metadata info from processed images. Used via --strip [safe,all]. Can save a few kilobytes if you don't need the metadata. "Safe" removes only metadata that will never affect rendering of the image. "All" removes all metadata that is not critical to the image. You can also pass a comma-separated list of specific metadata chunks to remove.

More advanced options can be found by running oxipng -h.

History

Oxipng began as a complete rewrite of the OptiPNG project, which was assumed to be dead as no commit had been made to it since March 2014. The name has been changed to avoid confusion and potential legal issues.

The core goal of rewriting OptiPNG was to implement multithreading, which would be very difficult to do within the existing C codebase of OptiPNG. This also served as an opportunity to choose a more modern, safer language (Rust).

Contributing

Any contributions are welcome and will be accepted via pull request on GitHub. Bug reports can be filed via GitHub issues. If you have the capability to submit a fix with the bug report, it is preferred that you do so via pull request, however you do not need to be a Rust programmer to contribute. Other contributions (such as improving documentation or translations) are also welcome via GitHub.

License

Oxipng is open-source software, distributed under the MIT license.