How to invert the colors in an image

조회 수: 30 (최근 30일)
Sebastian
Sebastian 2014년 2월 5일
답변: Gerard Broussard 2020년 8월 2일
Hi, I want to invert the colors in a grayscale image that i am reading with matlab. Whenever the image is black, matlab gives me 0 values, and whenever the image is white matlab gives me certain values. I want to invert this so whenever is black matlab gives me the values and whenever is white matlab gives me 0 values. Can you help me with this? Thank you!

채택된 답변

Dishant Arora
Dishant Arora 2014년 2월 5일
doc imcomplement

추가 답변 (1개)

Gerard Broussard
Gerard Broussard 2020년 8월 2일
You can also do something like
colormap(flipud(gray))
if you don't want ot re-compute the image you're working with

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by