フィルターのクリア

How can I detect color space of image is CMYK

3 ビュー (過去 30 日間)
Mingming
Mingming 2014 年 6 月 20 日
コメント済み: mike milhon 2020 年 5 月 13 日
I get error:
Error using readjpg (line 11) JPEG images with CMYK colorspace are not currently supported.
I have a huge amount of images. how can get to know if the color space is CMYK. I want to skip CmYK format files.
I write a code like this:
if size(image, 4) >1
Continue;
end
but does not work. My goal is use rgb2gray(). as it does not support CMKY, so I just want to skip any file in CMYK space. I try one CMYK file, it still in M*N*3 but not *4 dims. So I do not know how to judge.
  1 件のコメント
Yohai Devir
Yohai Devir 2015 年 6 月 21 日
Use imfinfo

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

回答 (2 件)

Image Analyst
Image Analyst 2015 年 6 月 21 日
One way is to simply catch the error and continue
for k = 1 : numberOfFiles
try
rgbImage = imread(filename);
catch
continue;
end
end

Abdurrahman Tosun
Abdurrahman Tosun 2019 年 10 月 5 日
it is very easy to save this position. save to your image at paint program, after that convert to jpeg again by using paint program :) if this save you please let me know
  1 件のコメント
mike milhon
mike milhon 2020 年 5 月 13 日
Thanks, works. Opened with paint, and saved back, with yes to overwrite, and it worked. Had to do several in my set.

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

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by