how to convert grayscale image to RGB image
조회 수: 2 (최근 30일)
이전 댓글 표시
hello,
Plz tell me how can i convert grayscale image to RGB image
댓글 수: 0
답변 (3개)
Walter Roberson
2013년 12월 14일
RGBImage = cat(3, GrayImage, GrayImage, GrayImage);
would result in an RGB image with the same visual appearance as the grayscale image.
댓글 수: 0
Image Analyst
2013년 12월 14일
Another option to assign colors to certain gray levels is to create a color map that does the mapping and pass it into ind2rgb
rgbImage = ind2rgb(grayImage, jet(256)); % Choose whatever colormap you want instead of jet.
It just depends on what you want and expect the output to look like.
댓글 수: 0
DGM
2022년 4월 19일
Depending on what the goals are, there are various ways to interpret the question. The following link includes demonstrations of converting a single-channel image to a 3-channel image via:
- channel replication (like above)
- channel filling/deletion and potential hue adjustment
- uniform and nonuniform colorization methods
- color mapping
I imagine most needs are met with replication or colormapping, but I like generalizable answers to be somewhat comprehensive.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Blue에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!