Swift library for reading ICC color profiles defined in the the ICC Profile Format Specification.
Add the following line to your project's SwiftPM dependencies:
.package(url: "https://github.com/hughbe/ICCReader", from: "1.0.0"),
import ICCReader
let data = Data(contentsOfFile: "<path-to-file>.icm")!
let profile = try ICCColorProfile(data: data)
// Dump all the tags.
for tag in profile.tags {
print(tag.signature)
print(tag.type)
print(tag.data)
}
// Print known tags (e.g. copyright)
print(profile.getTag(signature: "cprt"))
print(profile.getTag(signature: ICCTagSignature.copyright))
print(profile.copyright)