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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[]
= ["crates/iqa-cli"]
= "2"
[]
# Single version shared by the `iqa` library and the `iqa-cli` binary; release-plz
# bumps both crates together (see release-plz.toml).
= "1.2.1"
[]
= "iqa"
= true
= "2024"
= "A single, ergonomic API over the patchwork of visual quality assessment metrics in the Rust ecosystem."
= "MIT OR Apache-2.0"
= "https://github.com/justin13888/iqa-rs"
= ["iqa", "image-quality", "ssim", "psnr", "metrics"]
= ["multimedia::images", "computer-vision"]
= "README.md"
= "https://docs.rs/iqa"
# Minimum supported Rust version. 1.85 is the edition-2024 baseline.
= "1.85"
= "build.rs"
# Build-uniqueness key for the shared native archive (libjxl subset + Highway +
# lcms2) that `ssimulacra2` and `butteraugli` both link.
= "iqa_native"
# The vendored submodules ship far more than build.rs compiles (tests, docs, IDE
# projects, autotools, scatterplot images). Unpruned, the package is 22.8 MiB /
# 10.0 MiB compressed — just over crates.io's 10 MiB limit, so publishing 413s.
# Drop everything that isn't a source/header the native build actually consumes:
# lcms2 needs only `include/` + `src/`, highway only `hwy/`, ssimulacra2 only
# `src/`. The verify build (default features) compiles all of it, so an
# over-exclusion fails `cargo package` rather than shipping a broken crate.
= [
"third_party/lcms2/testbed",
"third_party/lcms2/plugins",
"third_party/lcms2/doc",
"third_party/lcms2/Projects",
"third_party/lcms2/utils",
"third_party/lcms2/m4",
"third_party/highway/g3doc",
"third_party/highway/docs",
"third_party/highway/debian",
"third_party/ssimulacra2/*.svg",
# Reference papers (e.g. references/IWSSIM.pdf) are repo documentation, not
# part of the crate; keep the multi-MB binaries out of the published package.
"references/*.pdf",
]
[]
# All metrics are enabled by default for convenience. Depend on iqa with
# `default-features = false` and opt into exactly the metrics you need to keep
# the build pure-Rust (see the README).
= ["full", "vendored-lcms2"]
= ["psnr", "ssim", "dssim", "ms-ssim", "iw-ssim", "psnr-hvs-m", "ciede2000", "ssimulacra2", "butteraugli"]
= []
= []
# PSNR-HVS-M (Ponomarenko et al. 2007): DCT-domain PSNR with a contrast-
# sensitivity function and between-coefficient contrast masking. Pure Rust.
= []
# CIEDE2000 (Sharma et al. 2005): mean perceptual color difference (ΔE₀₀) over
# sRGB→CIELAB (D65). Pure Rust.
= []
# Structural dissimilarity, `(1 - SSIM) / 2`. Pure Rust; a thin transform over
# `ssim`, which it therefore enables.
= ["ssim"]
# Multi-scale SSIM (Wang/Simoncelli/Bovik 2003). Pure Rust; evaluates `ssim`'s
# per-window machinery over an image pyramid, so it enables `ssim`.
= ["ssim"]
# Information content weighted SSIM (Wang & Li 2011). Pure Rust; a Laplacian-
# pyramid extension of MS-SSIM that pools `ssim`'s contrast-structure maps by a
# Gaussian-Scale-Mixture information weight, so it enables `ssim`.
= ["ssim"]
= ["dep:cc"]
# Butteraugli, also bound to vendored libjxl C++; shares the native build (and
# therefore the lcms2 backend) with `ssimulacra2`.
= ["dep:cc"]
# lcms2 backend for the C++ metrics' color management. Mutually exclusive: enable
# exactly one (build.rs enforces the XOR with `compile_error!`). `vendored-lcms2`
# builds the library from the `third_party/lcms2` submodule (default, no system
# dependency); `system-lcms2` links a system lcms2 via pkg-config instead. Note
# this means `--all-features` is not a valid build — name the backend you want.
= []
= ["dep:pkg-config"]
[]
# Single source of truth for the `iqa` dependency requirement that `iqa-cli`
# publishes against. Keep this version in step with `workspace.package.version`
# above so a release only touches this file (`iqa-cli` inherits via
# `iqa = { workspace = true }`). The `path` resolves to the root `iqa` crate for
# local/workspace builds; the `version` is what crates.io publishes against.
= { = ".", = "1.2.1" }
[]
= "2.0.18"
= "0.1.44"
[]
= { = "1", = true }
= { = "0.3", = true }
[]
# Used by examples to decode PNG/JPEG files into iqa inputs, and by
# tests/butteraugli_reference.rs to read the committed PPM fixtures (the same
# files libjxl's `butteraugli_main` scores, so the cross-validation feeds both
# sides identical pixels).
= { = "0.25", = false, = ["png", "jpeg", "pnm"] }
[[]]
= "compare"
= ["psnr", "ssim", "dssim", "ms-ssim", "iw-ssim", "psnr-hvs-m", "ciede2000", "ssimulacra2", "butteraugli"]
[]
# Document every metric (including the C++ ones) on docs.rs, matching the default
# build. The lcms2 backends are mutually exclusive, so `all-features` is not a
# valid build; name the metric set explicitly and pin the vendored backend so
# docs.rs needs no system library (the vendored C++ ships in the published crate).
= ["psnr", "ssim", "dssim", "ms-ssim", "iw-ssim", "psnr-hvs-m", "ciede2000", "ssimulacra2", "butteraugli", "vendored-lcms2"]