How can I detect color space of image is CMYK
조회 수: 3 (최근 30일)
이전 댓글 표시
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.
답변 (2개)
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
댓글 수: 0
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
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 Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!