X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 May 2006 07:31 AM by  anon
begineer about images
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 May 2006 07:31 AM
    hello i have 3 arrays same dimension - 100x100 these arrays are R,G,B and stored some values of colors (0-255) how transform contents of each array to colors and display it by IDL ? and second question is - how merge my arrays for one resulting image ? thanks

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 May 2006 07:31 AM
    here is part of my code. it's not working. must i mistake somewhere anybody can help ? ;try to create image for i=0,columns-1 do begin for j=0,rows-1 do begin ;extract values from arrays to color tvlct,R[i,j],G[i,j],B[i.j] ;draw points plots,i,j endfor endfor thanks

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 May 2006 07:31 AM
    When a programmer reports that he has 3 2D arrays with color data ranging from 0-255 in value, I usually expect each of the 2D arrays to represent the intensity level of a single color shade/hue. That is, one array might hold the intensity of red, the second might be the intensity of green and the third might be the intensity of blue. That is the normal scenario I expect when I hear that someone is trying to "... merge my arrays for one resulting image." If that is your scenario, then this is your solution: rgbImageArray = BYTARR(3, 100, 100) ; Initialization of a pixel-interleaved image array rgbImageArray[0,*,*) = myFirstArray ; the red intensity values rgbImageArray[1,*,*) = mySecondArray ; the green intensity values rgbImageArray[2,*,*) = myThirdArray ; the blue intensity values TV, rgbImageArrray, TRUE=1 ; TRUE=1 is for pixel-interleaved RGB color That is the only approach I can see for what you describe. 2D arrays of values 0-255 represent nothing but the intensity of one kind of light spectrum, ***UNLESS*** you have a 256-element color table accompanying the data that gives those 256 index values a different meaning. James Jones
    You are not authorized to post a reply.