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

Home » Public Forums » archive » Re: Any suggestions for a B&W colour scheme for publication images?
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: Any suggestions for a B&W colour scheme for publication images? [message #55940 is a reply to message #55939] Tue, 25 September 2007 08:01 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Sep 25, 9:25 am, Tyler <hayes.ty...@gmail.com> wrote:
> Hello All:
>
> I am in the process of submitting some figures to a journal for
> publication (it has been accepted). I intend to save my supervisor
> cash by submitting B&W figures for print, and keep the colour images
> for the electronic version.
>
> Here is my problem. Originally, I've been using one of the EOS colour
> schemes and the figures turn out great. There is excellent contrast
> between regions, and the positive/negative values are clearly
> distinguished. Sadly, switching the colour scheme to B&W tends to blur
> these crucial distinct regions.
>
> I have tried several values for STRETCH. Perhaps I was not using the
> STRETCH command properly. Does anyone have any suggestions for values
> of STRETCH or GAMMA_CT that have worked for their own publications in
> the past? This problem is only further compounded by the fact that
> XLOADCT seems to not want to load from my IDL script file, so I'm
> limited to what I can do from the within the script.
>
> For what it's worth, I have several figures to convert to B&W, all of
> which have different maximums and minimums. Can I use that knowledge
> to control STRETCH/GAMMA_CT with these values?
>
> I have two example PNG files I can send to anyone if they would like
> to see what I am talking about. Just email me with "GAMMA_CT" in the
> subject heading.
>
> Any ideas are greatly appreciated.
>
> Cheers,
>
> t.

Here's a reference: J. McNames, "An effective color scale for
simultaneous color and gray-scale publications," IEEE Signal
Processing Magazine, Vol. 23, No. 1, January 2006, pp. 82-87. (pdf:
http://bsp.pdx.edu/Publications/2006/SPM_McNames.pdf)

I translated the matlab code here:

function hyperbola, nc, ymaxa=ymaxa

if n_elements(ymaxa) eq 0 then ymaxa=0.95

a = sqrt( (1.0-ymaxa)^2 / (1.0-(1.0-ymaxa)^2) )
xvals = findgen(nc)
xs = 2.0 * xvals/float(nc-1) - 1.0 ; scale from -1 to 1
nx = n_elements(xvals)

y = 1.0 - sqrt(xs^2+a^2)/sqrt(1.0+a^2)
y = y>0.0

return, y
end

function triangle, nc

result = findgen(nc/2)/float(nc/2-1)
result = [result,reverse(result)]

return, result
end

function colorspiral, nc, np, palname, smin=smin, twosided=twosided

if n_elements(smin) eq 0 then smin=0

;nc=128
;np=2

wn = sqrt(3.0/8.0) * hyperbola(nc)
a12 = asin(1.0/sqrt(3.0))
a23 = !pi/4.0

if keyword_set(twosided) then begin
t = sqrt(3.0)*findgen(nc/2)/float(nc/2-1)
t = [-reverse(t),t]
wn = [reverse(wn),wn]
endif else begin
t = sqrt(3.0)*findgen(nc)/float(nc-1)
endelse

r0 = abs(t)
g0 = wn * cos((t-sqrt(3.0)/2.0)*np*2.0*!pi/sqrt(3.0))
b0 = wn * sin((t-sqrt(3.0)/2.0)*np*2.0*!pi/sqrt(3.0))

pm, 3, 3
plot, r0, g0
plot, r0, b0
plot, g0, b0

rgpol = cv_coord(from_rect=transpose([[r0],[g0]]),/to_polar)
rg1 = cv_coord(from_polar=[rgpol[0,*]+a12,rgpol[1,*]],/to_rect)
r1 = reform(rg1[0,*])
g1 = reform(rg1[1,*])
b1 = b0

plot, r1, g1
plot, r1, b1
plot, g1, b1

rbpol = cv_coord(from_rect=transpose([[r1],[b1]]),/to_polar)
rb2 = cv_coord(from_polar=[rbpol[0,*]+a23,rbpol[1,*]],/to_rect)
r2 = reform(rb2[0,*])
g2 = g1
b2 = reform(rb2[1,*])

plot, r2, g2
plot, r2, b2
plot, g2, b2

spiral = bytscl([[r2],[g2],[b2]])

;smin = 0
smax = nc-smin-1

spiral = congrid(spiral[smin:smax,*],nc,3)

openw, lun, palname+'.pal', /get_lun
printf, lun, palname
for i=nc-1, 0, -1 do printf, lun, string(format='("#",3z2.2)',spiral[i,
0],spiral[i,1],spiral[i,2])
free_lun, lun

return, spiral
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mosaic_doit
Next Topic: int of pixel and surrounding pixels

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

Current Time: Sun Oct 12 08:15:27 PDT 2025

Total time taken to generate the page: 1.59666 seconds