Filling a group of pixels with a new color?
Show older comments
I've taken a picture, say 10x10 pixels, and converted it to doubles like this:
a = imread('photo');
b = im2double(a);
This gives me a 10x10 matrix of numbers that represent each pixel. I want to take a group of these pixels and change them all to the same color. I've tried changing the pixel values to the same value but this seems to just change the intensity of the image in that pixel group from dim to bright red.
Example:
b(1:5,1:5) = 100;
% I'm taking the pixels from 1 to 5 on x and y and making their value in
the matrix the same thing. Again, this just changes the intensity of
that group of pixels.
How can I fill those pixels with the same color? I've tried using the fill function as well, nothing is working.
The image is an unedited screenshot that I took on my computer.
Accepted Answer
More Answers (0)
Categories
Find more on Contrast Adjustment 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!