Skip to content

Commit e1db84f

Browse files
V9 Change log and read me (#559)
Co-authored-by: Alejandro González <[email protected]>
1 parent 93c3e7d commit e1db84f

8 files changed

+94
-1495
lines changed

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## Version 9.0.0
2+
3+
- [Breaking] Remove `--backup` option. Use `--out` or `--dir` to preserve existing files.
4+
- [Breaking] Remove `--check` option. Use `--nx --nz` to perform a non-optimizing run.
5+
- [Breaking] API: Replace `pretend` option with `OutFile::None`.
6+
- [Breaking] API: Move `preserve_attrs` into `OutFile::Path`.
7+
- [Breaking] Default to removing interlacing. Use `-i keep` to retain existing interlacing.
8+
- [Feature] Add Raw API for creating optimised PNGs from raw image data.
9+
- [Feature] Add basic support for APNG files.
10+
- [Feature] Add `--scale16` option to forcibly reduce 16-bit images to 8-bit.
11+
- [Improvement] Process multiple files in parallel.
12+
- [Improvement] Improve reductions, particularly for indexed or very small images.
13+
- [Improvement] Improve compression with latest version of libdeflate.
14+
- [Improvement] Recompress iCCP chunks.
15+
- [Improvement] Change recursive mode to only process .png/.apng files.
16+
- [Improvement] Add support for glob patterns in quotes on Windows.
17+
- [Improvement] Quieter default output logging, with multiple levels of verbosity.
18+
- [Bugfix] Fix deadlock when using oxipng within an existing Rayon thread pool.
19+
- [Bugfix] Fix early abort in recursive mode when a read error occurred.
20+
- [Bugfix] Fix losing aux chunks when there's more than one of the same type.
21+
- [Bugfix] Fix sometimes writing output even when it was larger.
22+
- [Misc] Revamp CI workflow to upload artifacts and generate binaries for additional architectures.
23+
- [Misc] Bump minimum Rust version to 1.66.0.
24+
125
## Version 8.0.0
226

327
- [Breaking] Revamp alpha optimization

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ homepage = "https://github.com/shssoichiro/oxipng"
99
license = "MIT"
1010
name = "oxipng"
1111
repository = "https://github.com/shssoichiro/oxipng"
12-
version = "8.0.0"
12+
version = "9.0.0"
1313
rust-version = "1.66.0"
1414

1515
[badges]

README.md

+61-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Overview
99

10-
Oxipng is a multithreaded lossless PNG compression optimizer. It can be used via a command-line
10+
Oxipng is a multithreaded lossless PNG/APNG compression optimizer. It can be used via a command-line
1111
interface or as a library in other Rust programs.
1212

1313
## Installing
@@ -38,31 +38,32 @@ Oxipng follows Semantic Versioning.
3838

3939
## Usage
4040

41-
Oxipng is a command-line utility. Basic usage looks similar to the following:
41+
Oxipng is a command-line utility. An example usage, suitable for web, may be the following:
4242

4343
```
44-
oxipng -o 4 -i 1 --strip safe *.png
44+
oxipng -o 4 --strip safe --alpha *.png
4545
```
4646

4747
The most commonly used options are as follows:
4848

49-
- Optimization: `-o 1` through `-o 6`, lower is faster, higher is better compression.
50-
The default (`-o 2`) is sufficiently fast on a modern CPU and provides 30-50% compression
51-
gains over an unoptimized PNG. `-o 4` is 6 times slower than `-o 2` but can provide 5-10%
52-
extra compression over `-o 2`. Using any setting higher than `-o 4` is unlikely
53-
to give any extra compression gains and is not recommended.
54-
- Interlacing: `-i 1` will enable [Adam7](https://en.wikipedia.org/wiki/Adam7_algorithm)
55-
PNG interlacing on any images that are processed. `-i 0` will remove interlacing from all
56-
processed images. Not specifying either will keep the same interlacing state as the
57-
input image. Note: Interlacing can add 25-50% to the size of an optimized image. Only use
58-
it if you believe the benefits outweigh the costs for your use case.
49+
- Optimization: `-o 0` through `-o 6` (or `-o max`), lower is faster, higher is better compression.
50+
The default (`-o 2`) is quite fast and provides good compression. Higher levels can be notably
51+
better but generally have increasingly diminishing returns.
5952
- Strip: Used to remove metadata info from processed images. Used via `--strip [safe,all]`.
6053
Can save a few kilobytes if you don't need the metadata. "Safe" removes only metadata that
6154
will never affect rendering of the image. "All" removes all metadata that is not critical
6255
to the image. You can also pass a comma-separated list of specific metadata chunks to remove.
6356
`-s` can be used as a shorthand for `--strip safe`.
57+
- Alpha: `--alpha` can improve compression of images with transparency, by altering the color
58+
values of fully transparent pixels. This is generally recommended, but take care as this is
59+
technically a lossy transformation and may be unsuitable for some specific applications.
6460

65-
More advanced options can be found by running `oxipng -h`.
61+
More advanced options can be found by running `oxipng --help`, or viewed [here](MANUAL.txt).
62+
63+
Some options have both short (`-a`) and long (`--alpha`) forms. Which form you use is just a
64+
matter of preference. Multiple short options can be combined together, e.g.:
65+
`-savvo6` is equivalent to to `--strip safe --alpha --verbose --verbose --opt 6`.
66+
Note that all options are case-sensitive.
6667

6768
## Git integration via [Trunk]
6869

@@ -75,15 +76,15 @@ To enable oxipng via [trunk]:
7576
trunk check enable oxipng
7677

7778
# to get a specific version:
78-
trunk check enable oxipng@8.0.0
79+
trunk check enable oxipng@9.0.0
7980
```
8081

8182
or modify `.trunk/trunk.yaml` in your repo to contain:
8283

8384
```
8485
lint:
8586
enabled:
86-
- oxipng@8.0.0
87+
- oxipng@9.0.0
8788
```
8889

8990
Then just run:
@@ -111,14 +112,14 @@ other Rust projects. To do so, simply add oxipng as a dependency in your Cargo.t
111112
then `extern crate oxipng` in your project. You should then have access to all of the library
112113
functions [documented here](https://docs.rs/oxipng). The simplest
113114
method of usage involves creating an
114-
[Options struct](https://docs.rs/oxipng/3.0.1/oxipng/struct.Options.html) and
115+
[Options struct](https://docs.rs/oxipng/latest/oxipng/struct.Options.html) and
115116
passing it, along with an input filename, into the
116-
[optimize function](https://docs.rs/oxipng/3.0.1/oxipng/fn.optimize.html).
117+
[optimize function](https://docs.rs/oxipng/latest/oxipng/fn.optimize.html).
117118

118119
It is recommended to disable the "binary" feature when including oxipng as a library. Currently, there is
119120
no simple way to just disable one feature in Cargo, it has to be done by disabling default features
120121
and specifying the desired ones, for example:
121-
`oxipng = { version = "8.0", features = ["parallel", "zopfli", "filetime"], default-features = false }`
122+
`oxipng = { version = "9.0", features = ["parallel", "zopfli", "filetime"], default-features = false }`
122123

123124
## History
124125

@@ -131,6 +132,9 @@ The core goal of rewriting OptiPNG was to implement multithreading,
131132
which would be very difficult to do within the existing C codebase of OptiPNG.
132133
This also served as an opportunity to choose a more modern, safer language (Rust).
133134

135+
Note that, while similar, Oxipng is not a drop-in replacement for OptiPNG.
136+
If you are migrating from OptiPNG, please check the [help](MANUAL.txt) before using.
137+
134138
## Contributing
135139

136140
Any contributions are welcome and will be accepted via pull request on GitHub. Bug reports can be
@@ -145,6 +149,43 @@ Oxipng is open-source software, distributed under the MIT license.
145149

146150
## Benchmarks
147151

152+
Tested OxiPNG 9.0.0 (commit `c16519b38b0519988db625913be919d4f0e42f5d`, compiled
153+
on `rustc 1.74.0-nightly (7b4d9e155 2023-09-28)`) against OptiPNG version 0.7.7,
154+
as packaged by Debian unstable, on a Linux 6.5.0-2-amd64 kernel, Intel Core
155+
i7-12700 CPU (8 performance cores, 4 efficiency cores, 20 threads), DDR5-5200
156+
RAM in dual channel configuration.
157+
158+
```
159+
160+
Benchmark 1: ./target/release/oxipng -P ./tests/files/rgb_16_should_be_grayscale_8.png
161+
Time (mean ± σ): 59.6 ms ± 7.7 ms [User: 77.4 ms, System: 3.6 ms]
162+
Range (min … max): 53.3 ms … 89.9 ms 32 runs
163+
164+
Benchmark 2: optipng -simulate ./tests/files/rgb_16_should_be_grayscale_8.png
165+
Time (mean ± σ): 132.4 ms ± 0.8 ms [User: 132.5 ms, System: 0.6 ms]
166+
Range (min … max): 131.8 ms … 134.4 ms 22 runs
167+
168+
Summary
169+
./target/release/oxipng -P ./tests/files/rgb_16_should_be_grayscale_8.png ran
170+
2.22 ± 0.29 times faster than optipng -simulate ./tests/files/rgb_16_should_be_grayscale_8.png
171+
172+
Benchmark 1: ./target/release/oxipng -o4 -P ./tests/files/rgb_16_should_be_grayscale_8.png
173+
Time (mean ± σ): 88.7 ms ± 4.3 ms [User: 270.3 ms, System: 11.0 ms]
174+
Range (min … max): 86.8 ms … 109.4 ms 26 runs
175+
176+
Benchmark 2: optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.png
177+
Time (mean ± σ): 444.9 ms ± 0.3 ms [User: 444.8 ms, System: 0.7 ms]
178+
Range (min … max): 444.4 ms … 445.6 ms 10 runs
179+
180+
Summary
181+
./target/release/oxipng -o4 -P ./tests/files/rgb_16_should_be_grayscale_8.png ran
182+
5.01 ± 0.25 times faster than optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.png
183+
184+
```
185+
186+
<details>
187+
<summary>Older benchmark</summary>
188+
148189
Tested oxipng 5.0.0 (compiled on rustc 1.55.0-nightly (7a16cfcff 2021-07-11)) against OptiPNG version 0.7.7 on AMD Ryzen 7 4800H with Radeon Graphics with 16 logical cores
149190

150191
```
@@ -176,3 +217,4 @@ Summary
176217
5.16 ± 0.58 times faster than 'optipng -o 4 -simulate ./tests/files/rgb_16_should_be_grayscale_8.png'
177218
178219
```
220+
</details>

README.template.md

-106
This file was deleted.

0 commit comments

Comments
 (0)