Giving certain pixels a colour

조회 수: 4 (최근 30일)
med-sweng
med-sweng 2013년 10월 1일
편집: med-sweng 2013년 10월 1일
For an image I have, how can I do the following in MATLAB?
- Giving the pixels with values 100 for instance the colour green
EDIT
Giving all pixels except those with values `255` and `0` the colour `green`
- Leaving the pixels with 0 as is. That is, keeping them black
- Giving all other pixels the colour red
EDIT
Giving those pixels with value `255` the colour `red`
Thanks.

답변 (1개)

Image Analyst
Image Analyst 2013년 10월 1일
If the image is not grayscale, then what do you mean by "pixels with values 100"??? So, if it's RGB, do you want to replace only pixels with value (100,100,100) - in other words, 100 in every single color channel? That probably won't happen too often unless you have a synthetic (created) image.
  댓글 수: 1
med-sweng
med-sweng 2013년 10월 1일
@Image Analyst. I have converted the image into grayscale. Say that the white pixels have the value `255`. For those, I want to assign them the 'red` colour, and for all other pixels, I want to assign them the colour `green`. How can I do that? Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by