-
-
Notifications
You must be signed in to change notification settings - Fork 485
/
INSTALL
60 lines (35 loc) · 1.69 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Compiling via Rust/Cargo
The old `configure && make` method is no longer supported.
### Prerequisites
Install Rust 1.70 or later: https://rustup.rs
On Windows also install msys-git and Visual C++ Build Tools
with Windows 8/10/11 SDK enabled, and reboot.
### Building
Get the code by cloning *recursively*:
# Unix version
git clone --recursive https://github.com/kornelski/pngquant.git
# Windows version
git clone -b msvc --recursive https://github.com/kornelski/pngquant.git
And then build:
cd pngquant
cargo build --release
This will create executable in `target/release/pngquant`(`.exe`).
You can build with additional features:
cargo build --release --features=lcms2
The features are:
* `lcms2` — compile with support for color profiles via Little CMS.
* `lcms2-static` — same, but link statically.
* `cocoa` — compile with support for color profiles via macOS Cocoa.
## Compilation with Cocoa image reader
macOS version can use Cocoa to read images. This adds support for color profiles
and other image formats as input. However, it also disables support for preserving PNG metadata.
cargo build --release --features=cocoa
## Compilation with Little CMS 2
Little CMS library is used by default.
It's linked dynamically if `pkg-config` is working (e.g. install `liblcms2-dev`).
Otherwise uses static build as a fallback.
Set `export LCMS2_STATIC=1` or build `--features=lcms2-static` to force static linking.
## Compilation of `libimagequant_sys.a` only
If you want to use pngquant's conversion algorithm without loading/saving PNG
files, then you can run `cargo build --release` in the `lib/` directory.
The imagequant library doesn't need libpng nor zlib.