How To remove black color from gray-scale image?

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

 Réponse acceptée

Jan
Jan le 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.

1 commentaire

Lu Yaseen
Lu Yaseen le 27 Mar 2014
Thanks a lot this is exactly what i was looking for :)!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by