How To remove black color from gray-scale image?
1 view (last 30 days)
Show older comments
Hi guys
i was wondering how can i remove a black color from the grayscale image? or can i just change the black into any other lighter color?
thank you
0 Comments
Accepted Answer
Jan
on 27 Mar 2014
It depends on the format of the image. For a UINT8 array:
Img = randi([0,255], 100, 100, 'uint8'); % Test data
Img(Img == 0) = 127;
Now black is replaced by a medium grey. The procedure for double format is equivalent, but a medium grey is 0.5.
More Answers (0)
See Also
Categories
Find more on Modify Image Colors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!