Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
how to give specific colour to a pixel on an image
Hi I am using the cgimage function to display my images. I was wondering how can I specify the colour of a pixel location by a particular colour. What I mean is, once I display my image then, the pixel at location [5,8] make it blue. Is that possible? With Thanks
Re: how to give specific colour to a pixel on an image
There is likely a more Coyote-like way of doing this, but I follow two steps: 1. Don't scale the image between 0 and 255 but between, say, 0 and 253, so that the "colored" pixels -- and no others -- can be given the value of 254. 2. Assign the desired color to the lookup table at a location of 254 im = dist(512) ;test image imscl = bytscl(im,top=253) ;Scale to top value of 253 imscl[5,8] = 254 ;give desired pixel a value of 254 col = cgcolor('magenta',/triple) ;Let's make the pixel magenta tvlct,col,254 ;Load at 254 in the lookup table cgimage, imscl ;Now display the image On Monday, April 20, 2015 at 12:17:08 PM UTC-4, g.na...@gmail.com wrote: > Hi > > I am using the cgimage function to display my images. I was wondering how can I specify the colour of a pixel location by a particular colour. What I mean is, once I display my image then, the pixel at location [5,8] make it blue. Is that possible? > > With Thanks
Thank you very much! that was very helpful :)