function pscoltran,image,r,g,b ; Returns an (x,y,3) array containing red, green, and blue ; color planes for an image, suitable for viewing in pseudocolor ; on a 24-bit display ; with e.g., tvcoords using the color table defined by the vectors ; r, g, and b (assumed to be 256 in length). Image is assumed to be ; a byte array. ; Seems there should be a more efficient (vectorized) way to do this, but ; I haven't found it yet imsize=size(image) xsize=imsize(1) & ysize=imsize(2) rim=bytarr(xsize,ysize) gim=bytarr(xsize,ysize) bim=bytarr(xsize,ysize) for i=0,255 do begin good=where(image eq i) if good(0) ne -1 then begin rim(good)=r(i) gim(good)=g(i) bim(good)=b(i) endif endfor return,[[[rim]],[[gim]],[[bim]]] end