how to use iccread if the image contains no profile

8 ビュー (過去 30 日間)
Stephen Westland
Stephen Westland 2021 年 8 月 18 日
コメント済み: Stephen Westland 2021 年 8 月 18 日
It's possible to read the icc profile from an image using iccread, e.g.
P = iccread('test.tif')
However, if the image contains no profile the above code returns an error. How can we test for whether an image contains a profile before using iccread.

採用された回答

Simon Chan
Simon Chan 2021 年 8 月 18 日
Check the MATLAB documentation: iccread
The file can be either an ICC profile file or a TIFF file containing an embedded ICC profile. To determine if a TIFF file contains an embedded ICC profile, use the imfinfo function to get information about the file and look for the ICCProfileOffset field in the output.
  2 件のコメント
Stephen Westland
Stephen Westland 2021 年 8 月 18 日
Thanks so much Simon
Stephen Westland
Stephen Westland 2021 年 8 月 18 日
For anyone else who might be interested, this was my solution
im = imfinfo(F);
if isfield(im,'ICCProfileOffset')
% read profile
else
% assume sRGB
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by