comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: 3D array imaging with different colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 3D array imaging with different colors [message #83364 is a reply to message #83347] Thu, 28 February 2013 09:15 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> You seem to know what colors you want. Just find the RGB value for that
> color and assign those values to the pixels you want to be that color.
> Simple as that.

You want something like this:

a = fltarr(500,500,3) + 128
color = [0, 0, 255] ; Blue
a[50:99,200:249,0] = Replicate(color[0],50,50)
a[50:99,200:249,1] = Replicate(color[1],50,50)
a[50:99,200:249,2] = Replicate(color[2],50,50)
color = [255, 255, 0] ; Yellow
a[200:249,50:99,0] = Replicate(color[0],50,50)
a[200:249,50:99,1] = Replicate(color[1],50,50)
a[200:249,50:99,2] = Replicate(color[2],50,50)
color = [255, 0, 0] ; Red
a[400:449,250:299,0] = Replicate(color[0],50,50)
a[400:449,250:299,1] = Replicate(color[1],50,50)
a[400:449,250:299,2] = Replicate(color[2],50,50)
graph = image(a)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrPolygon unexpected result
Next Topic: 3D array imaging with different colors

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:43:47 PDT 2025

Total time taken to generate the page: 0.96123 seconds