How to invert the colors in an image

11 Ansichten (letzte 30 Tage)
Sebastian
Sebastian am 5 Feb. 2014
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!

Akzeptierte Antwort

Dishant Arora
Dishant Arora am 5 Feb. 2014
doc imcomplement

Weitere Antworten (1)

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

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by