1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*43a5ec4eSXin LI# $File: icc,v 1.7 2021/04/26 15:56:00 christos Exp $ 4b6cee71dSXin LI# icc: file(1) magic for International Color Consortium file formats 5b6cee71dSXin LI 6b6cee71dSXin LI# 7b6cee71dSXin LI# Color profiles as per the ICC's "Image technology colour management - 8b6cee71dSXin LI# Architecture, profile format, and data structure" specification. 9b6cee71dSXin LI# See 10b6cee71dSXin LI# 11b6cee71dSXin LI# http://www.color.org/specification/ICC1v43_2010-12.pdf 12b6cee71dSXin LI# 13b6cee71dSXin LI# for Specification ICC.1:2010 (Profile version 4.3.0.0). 1440427ccaSGordon Tetlow# URL: http://fileformats.archiveteam.org/wiki/ICC_profile 1540427ccaSGordon Tetlow# Reference: http://www.color.org/iccmax/ICC.2-2016-7.pdf 1640427ccaSGordon Tetlow# Update: Joerg Jenderek 17b6cee71dSXin LI# 18b6cee71dSXin LI# Bytes 36 to 39 contain a generic profile file signature of "acsp"; 19b6cee71dSXin LI# bytes 40 to 43 "may be used to identify the primary platform/operating 20b6cee71dSXin LI# system framework for which the profile was created". 21b6cee71dSXin LI# 2240427ccaSGordon Tetlow# check and display ICC/ICM color profile 2340427ccaSGordon Tetlow0 name color-profile 2440427ccaSGordon Tetlow>36 string acsp 2540427ccaSGordon Tetlow# skip ASCII like Cognacspirit.txt by month <= 12 2640427ccaSGordon Tetlow>>26 ubeshort <13 2740427ccaSGordon Tetlow# platform/operating system. Only 5 mentioned 28b6cee71dSXin LI 2940427ccaSGordon Tetlow# 30b6cee71dSXin LI# This appears to be what's used for Apple ColorSync profiles. 31b6cee71dSXin LI# Instead of adding that, Apple just changed the generic "acsp" entry 32b6cee71dSXin LI# to be for "ColorSync ICC Color Profile" rather than "Kodak Color 33b6cee71dSXin LI# Management System, ICC Profile". 34b6cee71dSXin LI# Yes, it's "APPL", not "AAPL"; see the spec. 3540427ccaSGordon Tetlow>>>40 string APPL ColorSync 36b6cee71dSXin LI 37b6cee71dSXin LI# Microsoft ICM color profile 3840427ccaSGordon Tetlow>>>40 string MSFT Microsoft 39b6cee71dSXin LI 40b6cee71dSXin LI# Yes, that's a blank after "SGI". 4140427ccaSGordon Tetlow>>>40 string SGI\ SGI 42b6cee71dSXin LI 43b6cee71dSXin LI# XXX - is this what's used for the Sun KCMS or not? The standard file 44b6cee71dSXin LI# uses just "acsp" for that, but Apple's file uses it for "ColorSync", 45b6cee71dSXin LI# and there *is* an identified "primary platform" value of SUNW. 4640427ccaSGordon Tetlow>>>40 string SUNW Sun KCMS 4740427ccaSGordon Tetlow 4840427ccaSGordon Tetlow# 5th platform 4940427ccaSGordon Tetlow>>>40 string TGNT Taligent 5040427ccaSGordon Tetlow 5140427ccaSGordon Tetlow# remaining "l" "e" of "color profile" printed later to avoid error 5240427ccaSGordon Tetlow>>>40 string x color profi 5340427ccaSGordon Tetlow#>>>40 string x (%.4s) 54b6cee71dSXin LI!:mime application/vnd.iccprofile 5540427ccaSGordon Tetlow# for "ICM" extension only versions 2.x and for Kodak "CC" 2.0 is found 5640427ccaSGordon Tetlow>>>8 ubyte =2 57d38c30c0SXin LI# do not use empty message text to avoid error like 5840427ccaSGordon Tetlow# icc, 82: Warning: Current entry does not yet have a description for adding a EXTENSION type 5940427ccaSGordon Tetlow# file.exe: could not find any valid magic files! 6040427ccaSGordon Tetlow>>>>9 ubyte !0 \ble 6140427ccaSGordon Tetlow!:ext icc/icm 6240427ccaSGordon Tetlow# minor version 6340427ccaSGordon Tetlow>>>>9 ubyte =0 \bl 6440427ccaSGordon Tetlow# Kodak colour management system 6540427ccaSGordon Tetlow>>>>>4 string =KCMS \be 6640427ccaSGordon Tetlow!:ext icc/icm/cc 6740427ccaSGordon Tetlow>>>>>4 string !KCMS \be 6840427ccaSGordon Tetlow!:ext icc/icm 6940427ccaSGordon Tetlow>>>8 ubyte !2 \ble 7040427ccaSGordon Tetlow!:ext icc 7140427ccaSGordon Tetlow# Profile version major.4bit-minor.sub1.sub2 like 4.3.0.0 (04300000h) 7240427ccaSGordon Tetlow>>>8 ubyte x %u 7340427ccaSGordon Tetlow>>>9 ubyte/16 x \b.%u 7440427ccaSGordon Tetlow# reserved and shall be null but 205.205 in umx1220u.icm 7540427ccaSGordon Tetlow>>>10 ubyte >0 \b.%u 7640427ccaSGordon Tetlow>>>>11 ubyte >0 \b.%u 7740427ccaSGordon Tetlow# preferred colour management module like appl CCMS KCMS Lino UCCM "Win " "FF " 7840427ccaSGordon Tetlow# skip space like in brmsl08f.icm and null like in brmsl09f.icm, brmsl07f.icm 7940427ccaSGordon Tetlow>>>4 string >\ \b, type %.2s 8040427ccaSGordon Tetlow>>>>6 string >\ \b%.1s 8140427ccaSGordon Tetlow>>>>>7 string >\ \b%.1s 8240427ccaSGordon Tetlow# colour space "XYZ " "Lab " "RGB " CMYK GRAY ... 8340427ccaSGordon Tetlow>>>16 string x \b, %.3s 8440427ccaSGordon Tetlow>>>19 string >\ \b%.1s 8540427ccaSGordon Tetlow# Profile Connection Space (PCS) field usually "XYZ " or "Lab " but sometimes 8640427ccaSGordon Tetlow# null or CMYK like in ISOcoated_v2_to_PSOcoated_v3_DeviceLink.icc 8740427ccaSGordon Tetlow>>>20 string >\0 \b/%.3s 8840427ccaSGordon Tetlow>>>>23 string >\ \b%.1s 8940427ccaSGordon Tetlow# eleven device classes 9040427ccaSGordon Tetlow>>>12 string x \b-%.4s device 9140427ccaSGordon Tetlow# skip 00001964h in hpf69000.icc or 0h in XRDC50Q.ICM or " ROT" in brmsl05f.icm 9240427ccaSGordon Tetlow>>>52 string >\040 9340427ccaSGordon Tetlow# skip "none" model like in "Trinitron Compatible 9300K G2.2.icm" 9440427ccaSGordon Tetlow>>>>52 ubelong !0x6e6f6e65 9540427ccaSGordon Tetlow# device manufacturer field like "HP " "IBM " EPSO 9640427ccaSGordon Tetlow>>>>>48 string x \b, %.2s 9740427ccaSGordon Tetlow>>>>>50 string >\ \b%.1s 9840427ccaSGordon Tetlow>>>>>51 string >\ \b%.1s 9940427ccaSGordon Tetlow# model like "ADI " "A265" and skip 20000404h in IS330.icm for RICOH RUSSIAN-SC 10040427ccaSGordon Tetlow>>>>>52 string >\ \ \b/%.3s 10140427ccaSGordon Tetlow>>>>>>55 string >\ \b%.1s 10240427ccaSGordon Tetlow>>>>>52 string x model 10340427ccaSGordon Tetlow# creator (often same as manufacture) like HP SONY XROX or null like in A925A.icm 10440427ccaSGordon Tetlow>>>80 string >\0 by %.2s 10540427ccaSGordon Tetlow>>>>82 string >\ \b%.1s 10640427ccaSGordon Tetlow>>>>>83 string >\ \b%.1s 10740427ccaSGordon Tetlow# profile size 10840427ccaSGordon Tetlow>>>0 ubelong x \b, %u bytes 10940427ccaSGordon Tetlow# skip invalid date 0 like in linearSRGB.icc 11040427ccaSGordon Tetlow>>>24 ubequad !0 11140427ccaSGordon Tetlow# datetime dd-mm-yyyy hh:mm:ss 11240427ccaSGordon Tetlow>>>>28 ubeshort x \b, %u 11340427ccaSGordon Tetlow# month <= 12 11440427ccaSGordon Tetlow>>>>26 ubeshort x \b-%u 11540427ccaSGordon Tetlow# year 11640427ccaSGordon Tetlow>>>>24 ubeshort x \b-%u 11740427ccaSGordon Tetlow# do not display midnight time like in CNHP8308.ICC 11840427ccaSGordon Tetlow>>>>30 ubequad&0xFFffFFffFFff0000 !0 11940427ccaSGordon Tetlow# hour <= 24 12040427ccaSGordon Tetlow>>>>>30 ubeshort x %u 12140427ccaSGordon Tetlow# minutes <= 59 12240427ccaSGordon Tetlow>>>>>32 ubeshort x \b:%.2u 12340427ccaSGordon Tetlow# seconds <= 59 12440427ccaSGordon Tetlow>>>>>34 ubeshort x \b:%.2u 12540427ccaSGordon Tetlow# vendor specific flags like 2 in HPCLJ5.ICM 126*43a5ec4eSXin LI>>>44 ubeshort >0 \b, %#x vendor flags 12740427ccaSGordon Tetlow# profile flags bits 0-2 of least 16 used by ICC 128*43a5ec4eSXin LI#>>>44 ubelong >0 \b, %#x flags 12940427ccaSGordon Tetlow# icEmbeddedProfileTrue 13040427ccaSGordon Tetlow>>>44 ubelong &1 \b, embedded 13140427ccaSGordon Tetlow# icEmbeddedProfileFalse 13240427ccaSGordon Tetlow#>>>44 ubelong ^1 \b, not embedded 13340427ccaSGordon Tetlow# icUseWithEmbeddedDataOnly 13440427ccaSGordon Tetlow>>>44 ubelong &2 \b, dependently 13540427ccaSGordon Tetlow# icUseAnywhere 13640427ccaSGordon Tetlow#>>>44 ubelong ^2 \b, independently 13740427ccaSGordon Tetlow>>>44 ubelong &4 \b, MCS 13840427ccaSGordon Tetlow#>>>44 ubelong ^4 \b, no MCS 13940427ccaSGordon Tetlow# vendor specific device attributes 1~srgb.icc 14040427ccaSGordon Tetlow# E000D00h~CNB7QEDA.ICM C000A00h~CNB5FCAA.ICM 01040401h~CNB25PE3.ICM 141*43a5ec4eSXin LI>>>56 ubelong >0 \b, %#x vendor attribute 14240427ccaSGordon Tetlow# ICC device attributes bits 0-7 used 143*43a5ec4eSXin LI#>>>60 ubelong x \b, %#x attribute 14440427ccaSGordon Tetlow# http://www.color.org/icc34.h 14540427ccaSGordon Tetlow>>>60 ubelong &0x01 \b, transparent 14640427ccaSGordon Tetlow#>>>60 ubelong ^0x01 \b, reflective 14740427ccaSGordon Tetlow>>>60 ubelong &0x02 \b, matte 14840427ccaSGordon Tetlow#>>>60 ubelong ^0x02 \b, glossy 14940427ccaSGordon Tetlow>>>60 ubelong &0x04 \b, negative 15040427ccaSGordon Tetlow#>>>60 ubelong ^0x04 \b, positive 15140427ccaSGordon Tetlow>>>60 ubelong &0x08 \b, black&white 15240427ccaSGordon Tetlow#>>>60 ubelong ^0x08 \b, colour 15340427ccaSGordon Tetlow>>>60 ubelong &0x10 \b, non-paper 15440427ccaSGordon Tetlow#>>>60 ubelong ^0x10 \b, paper 15540427ccaSGordon Tetlow>>>60 ubelong &0x20 \b, non-textured 15640427ccaSGordon Tetlow#>>>60 ubelong ^0x20 \b, textured 15740427ccaSGordon Tetlow>>>60 ubelong &0x40 \b, non-isotropic 15840427ccaSGordon Tetlow#>>>60 ubelong ^0x40 \b, isotropic 15940427ccaSGordon Tetlow>>>60 ubelong &0x80 \b, self-luminous 16040427ccaSGordon Tetlow#>>>60 ubelong ^0x80 \b, non-self-luminous 16140427ccaSGordon Tetlow# rendering intent 0-3 but 7AEA5027h in EE051__1.ICM 6CB1BCh in EE061__1.ICM 162*43a5ec4eSXin LI>>>64 ubelong >3 \b, %#x rendering intent 16340427ccaSGordon Tetlow#>>>64 ubelong =0 \b, perceptual 16440427ccaSGordon Tetlow>>>64 ubelong =1 \b, relative colorimetric 16540427ccaSGordon Tetlow>>>64 ubelong =2 \b, saturation 16640427ccaSGordon Tetlow>>>64 ubelong =3 \b, absolute colorimetric 16740427ccaSGordon Tetlow# PCS illuminant (3*s15Fixed16Numbers) often 0000f6d6 00010000 0000d32d 16840427ccaSGordon Tetlow>>>71 ubequad !0xd6000100000000d3 \b, PCS 16940427ccaSGordon Tetlow# usually X~0.9642*65536=63189.8112~63190=F6D5h ; but also found 17040427ccaSGordon Tetlow# often F6D6 in gt5000r.icm, F6B8 in kodakce.icm, F6CA in RSWOP.icm 171*43a5ec4eSXin LI>>>>68 ubelong !0x0000f6d5 X=%#x 17240427ccaSGordon Tetlow# usually Y=1.0~00010000h but Y=0 in brmsl07f.icm 173*43a5ec4eSXin LI>>>>72 ubelong !0x00010000 Y=%#x 17440427ccaSGordon Tetlow# usually Z~0.8249*65536=54060.6464~54061=D32Dh ; but also found 17540427ccaSGordon Tetlow# D2F7 in hp1200c.icm, often D32C in A925A.icm, D309 in RSWOP.icm , D2F8 in kodak_dc.icm 176*43a5ec4eSXin LI>>>>76 ubelong !0x0000d32d Z=%#x 17740427ccaSGordon Tetlow# Profile ID. MD5 fingerprinting method as defined in Internet RFC 1321. 178*43a5ec4eSXin LI>>>84 ubequad >0 \b, %#llx MD5 17940427ccaSGordon Tetlow# reserved in older versions should be zero but also found CDCDCDCDCDCDCDCD 180*43a5ec4eSXin LI#>>100 ubequad x \b %#llx reserved 18140427ccaSGordon Tetlow# tag table 18240427ccaSGordon Tetlow# 6 <= tags count <= 43 18340427ccaSGordon Tetlow#>>>128 ubelong >43 \b, %u tags 18440427ccaSGordon Tetlow>>>128 ubelong x 18540427ccaSGordon Tetlow# shall contain the profileDescriptionTag "desc" , copyrightTag "cprt" 18640427ccaSGordon Tetlow# search range = tags count * 12 -8=< maximal tag count * 12 -8= 43 * 12 -8= 508 18740427ccaSGordon Tetlow>>>>132 search/508 cprt 18840427ccaSGordon Tetlow# but no copyright tag in linearSRGB.icc 18940427ccaSGordon Tetlow# beneath /System/Library/Frameworks/WebKit.framework/ 19040427ccaSGordon Tetlow# Versions/A/Frameworks/WebCore.framework/Versions/A/Resources 19140427ccaSGordon Tetlow>>>>132 default x \b, no copyright tag 19240427ccaSGordon Tetlow# 1st tag 19340427ccaSGordon Tetlow#>>>132 string x \b, 1st tag %.4s 194*43a5ec4eSXin LI#>>>136 ubelong x %#x offset 195*43a5ec4eSXin LI#>>>140 ubelong x %#x len 19640427ccaSGordon Tetlow# 2nd tag,... 19740427ccaSGordon Tetlow# look also for profileDescriptionTag "desc" 19840427ccaSGordon Tetlow>>>132 search/508 desc 19940427ccaSGordon Tetlow# look further for TextDescriptionType "desc" signature 20040427ccaSGordon Tetlow>>>>(&0.L) string =desc 20140427ccaSGordon Tetlow>>>>>&4 pstring/l x "%s" 20240427ccaSGordon Tetlow# look alternative for multiLocalizedUnicodeType "mluc" signature like in VideoPAL.icc 20340427ccaSGordon Tetlow>>>>(&0.L) string =mluc 20440427ccaSGordon Tetlow>>>>>&(&8.L) ubequad x 20540427ccaSGordon Tetlow>>>>>>&4 bestring16 x '%s' 206b6cee71dSXin LI 207b6cee71dSXin LI# Any other profile. 208b6cee71dSXin LI# XXX - should we use "acsp\0\0\0\0" for "no primary platform" profiles, 209b6cee71dSXin LI# and use "acsp" for everything else and dump the "primary platform" 210b6cee71dSXin LI# string in those cases? 21140427ccaSGordon Tetlow36 string acsp 21240427ccaSGordon Tetlow>0 use color-profile 213b6cee71dSXin LI 214b6cee71dSXin LI 215