Main Content

iccwrite

Write ICC color profile data

Description

example

outProfile= iccwrite(inProfile,filename)writes an International Color Consortium (ICC) profile data in structureinProfileto the file specified byfilename.

您可以使用此功能在ICC配置文件数据结构中修改字段,并将其写入带有名称的文件filename. For example, some applications use the string field in profile description to present choices to users. The ICC recommends modifying the profile description in ICC profile data before writing the data to a file. Each profile is recommended to have a unique profile description. You can therefore, use theiccwritefunction to modify the profile description.

Note

iccwritecan write profiles that conform with either Version 2 (ICC.1:2001-04) or Version 4 (ICC.1:2001-12) of the ICC specification. To determine the version of the ICC specification, useversionfield in theHeaderof profile data structure. Based on the version, format theinProfilefor output. For more information about ICC profiles, visit the ICC website,https://www.color.org.

Examples

collapse all

Read an ICC profile data into the workspace and display the profile name.

inProfile = iccread('monitor.icm'); inProfile.Description.String
ans = 'sgC4_050102_d50.pf'

Change the profile name to'Monitor_RGB'.

inProfile.Description.String ='Monitor_RGB';

Write the updated ICC profile data to a new file and display the corresponding output ICC profile data. The new file is created in the current working folder.

outProfile = iccwrite (inProfile,'monitorcolor.icm')
outProfile =struct with fields:标题:[1x1 struct] tagtable:{11x3 cell}描述:[1x1 struct] MediaWhitePoint:[0.9642 1.0000 0.8249]版权所有:'版权续集Imaging Inc. 1996-2001'Mediablackpoint:[0 0 0] Mattrc:[1x1 struct]:[1x1 struct]:[1x1 struct]:[1x1 struct]privatetags:{'vcgt'[118 99 103 116 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...]}文件名:'MonerationColor.icm'

Verify the modified description in output ICC profile data.

outProfile.Description.String
ans = 'monitor_RGB'

Input Arguments

collapse all

Input ICC profile data, specified as a structure array represents an ICC profile in the data format returned byiccread. The ICC profile data must contain all the tags and fields required by the ICC profile specification. The input ICC profile data is written tofilename.

Data Types:struct

Name of the file to write ICC profile data, specified as a character vector or string scalar. Depending on the operating system, you can save the file with an extension.icc或者.ICM.

Note

如果仅指定没有路径的文件名,iccwritewrites the file to current working folder.

Data Types:char|string

Output Arguments

collapse all

Output ICC profile data, returned as a structure array gives the ICC profile data written to the filefilename.

Data Types:struct

Tips

iccwritedoes not perform automatic conversions from one version of the ICC specification to another. Do the conversion manually by adding fields or modifying fields in ICC profile data. Useisiccto validate the converted ICC profile data.

Version History

在R2006a之前引入