[Radiance-general] Re: Pcomb color assignments

Greg Ward gregoryjward at gmail.com
Tue Oct 19 12:04:00 PDT 2010


Hi Chris,

Try:

	pcomb -e 'reds(i)=select(i+1,ri(1),0.1,0.5,0.7);greens(i)=select(i+1,gi(1),0.3,0.9,0.1);blues(i)=select(i+1,bi(1),0.9,0.1,0.3)' \
		-e 'vals(i)=select(i,1000,2000,3000);eps:200' \
		-e 'and(a,b):if(a,b,a);eq(a,b):and(a-b+eps,b-a+eps)' \
		-e 'match(v,av,n)=if(n-.5,if(eq(v,av(n)),n,match(v,av,n-1)),0)' \
		-e 'index=match(WE*li(1),vals,vals(0))' \
		-e 'ro=reds(index);go=greens(index);bo=blues(index)' -o input.hdr > output.hdr

Naturally, you'll want to change reds(), greens(), and blues() along with vals() and eps to suit your image and preferences.

-Greg


> From: Chris Humann <chris at coolshadow.com>
> Date: October 19, 2010 11:37:11 AM PDT
> 
> Hello all,
> 
> I found this handy script of Gregs on the archives for mapping a single color to a defined range of values in an image:
> 	pcomb -e 'incontr=eq(we*li(1),16.5,0.25)' \
> 		-e 'ro=if(incontr,0,ri(1)' \
> 		-e 'go=if(incontr,1,gi(1)' \
> 		-e 'bo=if(incontr,0,bi(1)' \
> 		-e 'and(a,b):if(a,b,a)' \
> 		-e 'eq(a,b,eps):and(a-b+eps,b-a+eps)' \
> 		-o input.pic > contoured.pic
> 
> Is anyone versed in these function calls to know how to modify this script so as to define three ranges of values and assign one of three colors to each?
> 
> As always, thanks!
> 
> Chris



More information about the Radiance-general mailing list