For Programmers: Free Programming Magazines  


Home > Archive > Matlab > June 2007 > Pixel color display problem.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pixel color display problem.
xianfeng shi

2007-06-29, 7:14 pm

Hi all:
I have one matrix(MxNx3). In the row M and collumn N, 1 stands for
red color, 2 means green color and 3 stands for blue color. Now I
want to distribute red color into 256 segment. For example
colormap([[0:1/ 255:1]',zeros(256,1),zeros(256,1)]),colo
rbar;

Similarly we can operate these things on green and blue color.
Now If in row M and collumn N, The first red value is 0.2, the second
green value is 0.3, and the third blue value is 0.4, we can pick
corresponding red color determined by 0.2 from red value distribution
map, green color determined by 0.3 from green value distribution map
and blue color determined by 0.4 from blue color value distribution
map.Then we mix these three color and form a new color. This is
current pixel color. I don't know how to realize it. Maybe this is
stupid problem. But I am stuck here. If anyone know this solution,
please tell me thanks you very much for your kind help.

xianfeng shi
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com