icc-profile 0.0.3

ICC Profile reader
Documentation
  • Coverage
  • 6.8%
    28 out of 412 items documented1 out of 176 items with examples
  • Size
  • Source code size: 228.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 16.09 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 1s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mith-mmk/icc-profile
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mith-mmk

ICC Profile Reader

Example

pub fn main() -> std::io::Result<()> {
    let mut is_fast = true;
    for argument in env::args() {
        if is_fast {
            is_fast = false;
            continue
        }
        println!("{}",argument);
        let icc_profile = icc_profile::utils::load(argument)?;
        let decoded = DecodedICCProfile::new(&icc_profile.data)?;
        println!("{}",decoded_print(&decoded, 0)?);
    }
    Ok(())
}

Testing

The project includes comprehensive integration tests for ICC profile handling and color space conversions.

Running Unit Tests (No Samples Required)

cargo test --lib

This runs 14 unit tests covering color space math and gamma curves with no external dependencies.

Running Full Test Suite (Requires ICC Profiles)

For the 96 integration tests that use ICC profile samples:

  1. Prepare test samples by creating _test_samples/ directory:
mkdir -p _test_samples

  1. Add ICC profile files from trusted sources:

    • sRGB: sRGB_v4_ICC_preference.icc (or similar standard sRGB profile)
      • Source: Windows/macOS system profiles, or Adobe RGB profile
    • Printer (CMYK): JapanColor2011Coated.icc, ycck.icc
      • Source: Printing vendor profiles (Agfa, EFI, Heidelberg, etc.)
    • Monitor: asus_rog_strix_xg309cm.icm
      • Source: Monitor manufacturer profile
    • Reference: Spec400_10_700-IllumA-Abs_2deg.icc, sample1.icc, sample2.icc
      • Source: Color reference database or spectrophotometer software
  2. Run all tests:

cargo test

Test Coverage

  • Unit tests (14): Color space conversions, gamma curves, white point math
  • Integration tests (96):
    • ICC profile loading and parsing
    • CMYK→RGB pipeline transformations
    • Color difference metrics (ΔE76, CIEDE2000)
    • LUT8/LUT16 profile handling
    • Pipeline roundtrip validation

Total: 110 tests

Supported Profile Formats

  • Display profiles (RGB, Monitor)
  • Printer profiles (CMYK, YCCK)
  • Color space profiles (Lab)
  • LUT types: Lut8, Lut16, LutAtoB, LutBtoA
  • ICC v2.0 - v4.2

Development

Trusted sources for ICC profiles:

⚠️ Do not use profiles from unknown or untrusted sources

Todo

  • ICC Profile 4.x, 5.x tags full support
  • RGB→CMYK inverse pipeline (complete LUT inversion)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.