I am trying to understand pixel value, and trying to learn to alter it. But things act weird in matlab. Correct me if I am wrong but, pixel value is in a way amound of "light" a colour has. 0 means no light= black, 255 full light. Everything in between is something like, light blue dark blue and etc. So I googled "blue 300×300" and used this code:
clc;clear all;f = imread('C:\Users\*****\Desktop\images\sfaafsfas.jpg');for i=0:255 f(f==i)=12;endimshow(f)
If I delete for loop, and look at the f value from workshot all the values of the pixel value (at least I think they are pixel values) all of them are 12. Then I add for loop, and check the values, still they are all 12, yet imshow shows me a grey image. It kinda makes sence, yet it does not too. Nothing chages but something changes. What am I missing here?
original
What I get.
Best Answer