Reputation: 890
I need to add intensity values to a grayscale image . However this assumes that I must make a check that my values remain in the range 0...255
How can i ensure that my result values are remain in the range?
How am i supposed to perform the afformentioned operation in matlab??
Upvotes: 0
Views: 350
Reputation: 3090
If I understand you correctly, you want to increase the intensity of all the image pixels with the brightest one being 255. You can do this by
J = I .* (255/max(max(J)));
This will "scale" the brightness of your image so that the brightest part in the image will have a value of 255.
Upvotes: 1