Re: change color in a bmp image



dpb <none@xxxxxxx> wrote in message <gtimj4$v87$1@xxxxxxxx>...
kudrah wrote:
...

...
a for loop (two for loops) one for each dimension of rows and
columns of the array but it changes other pixels as well apart from
those i want chaged.

Well, as shown above, "the Matlab way" is to use array indexing and
other vectorized notation as much as possible...

...
... the for loop I use is :
> for i=1:11000;
> for j=1:11000;
image(rows(i),columns(j))=0;
end
end

Normally,that would produce the same white image,but with 11000 black
pixels in the specified areas.But when i use imagesc to get the
picture of the image,that doesn't look right and also when I use find
function to check the number of black pixels,it gives far more black
pixels than it should,which is 11000. Any ideas what i do wrong?

What are the arrays rows/columns?

If they're the indices to be modified as appears, then what you really
probably need it to look at ind2sub and friends.

You're changing 11000^2 = 121E6 locations this way.

--Row and columns are the two arrays that i take after i split the first array K.
To be honest i didn't exactly get what you mean! :)
.



Relevant Pages