function cmap24 common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr if N_elements(r_orig) lt 1 then loadct, 1 common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr nnc= 256L*127L nr = FIX(rebin(float(r_curr), nnc)) ng = FIX(rebin(float(g_curr), nnc)) nb = FIX(rebin(float(b_curr), nnc )) return, [nr,ng,nb] end function image_to_truetype, image, cmap, min=min_data,max=max_data ss = size(image) if (ss[0] ne 2) then begin print, ss print, 'image_to_truetype: call me with a 2D image! ' return, 0 endif exfac = 127L nnc= (256L)*exfac nr = cmap[0:(nnc-1)] ng = cmap[nnc:(nnc*2L-1)] nb = cmap[(nnc*2L):(nnc*3L-1)] mi = min(image, max=ma) if N_elements(min_data) gt 0 then mi = min_data if N_elements(max_data) gt 0 then ma = max_data tim = findgen(3, ss[1], ss[2]) s = ma - mi ds = s/256.D ; offset by 1 color so that bottom color value is for background color nimage = ((((image)-(mi-ds))/(ma-mi))*float(nnc-exfac*2)) tim[0,*,*] = nr[nimage[*]] tim[1,*,*] = ng[nimage[*]] tim[2,*,*] = nb[nimage[*]] return, tim end