This crate is a library intended to read, write, and transform CGATS color files and is currently in development. The included binary is a simple implementation of the library's API.
I haven't finished documenting the library or decided which features to make available in the public API, so they're mostly all public now:
Or build the documentation yourself:
sh
cargo doc --no-deps --open
Here is a basic CGATS color file:
tsv
CGATS.17
BEGIN_DATA_FORMAT
SAMPLE_ID SAMPLE_NAME CMYK_C CMYK_M CMYK_Y CMYK_K
END_DATA_FORMAT
BEGIN_DATA
1 Cyan 100 0 0 0
2 Magenta 0 100 0 0
3 Yellow 0 0 100 0
4 Black 0 0 0 100
5 Blue 100 100 0 0
6 Red 0 100 100 0
7 Green 100 0 100 0
8 3cBlack 100 100 100 0
9 4cBlack 100 100 100 100
10 3cGray 50 40 40 0
11 1cGray 0 0 0 50
END_DATA
There are several more exmples in the test_files directory. The CGATS format is similar to TSV, but with a few additions. The BEGIN_DATA_FORMAT
/END_DATA_FORMAT
and BEGIN_DATA
/END_DATA
tags signal the way the measurements have been formatted.
```txt USAGE: cgats [FILE]... [SUBCOMMAND]
FLAGS: -h, --help Prints help information -V, --version Prints version information
ARGS:
SUBCOMMANDS: average Average 2 or more CGATS color files cat Concatenate 2 or more CGATS color files delta Calculate the Delta E between each sample in two CGATS files help Prints this message or the help of the given subcommand(s) ```
Print basic CGATS info to console:
sh
cgats test_files/cgats0.txt
Average values of 3 CGATS files:
sh
cgats average test_files/cgats{1,2,3}.tsv
DATA_FORMAT
and sample count.Concatenate sample sets from multiple CGATS files:
sh
cgats cat test_files/cgats{1,2,3}.tsv
DATA_FORMAT
.Calculate Delta E between each value pair in two CGATS files:
sh
cgats delta -m de2000 test_files/colorburst{1,2}.lin
Calculate Delta E with a report printed to stderr:
sh
cgats delta --report test_files/colorburst{1,2}.lin
LAB_L
, LAB_A
, and LAB_B
fields.First, you'll need to download and install rust. Then:
sh
git clone https://github.com/ryanobeirne/cgats
cd cgats
cargo install --example=cgats --path=. --force