Pcomb color assignments

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

Christian Humann ~ Associate
LOISOS + UBBELOHDE
- - - - - - - - - - - - - - - - - - - - - - - - - - -
1917 Clement Avenue Building 10A
Alameda, CA 94501 USA
- - - - - - - - - - - - - - - - - - - - - - - - - - -
510 521 3800 VOICE
510 521 3820 FAX
- - - - - - - - - - - - - - - - - - - - - - - - - - -
www.coolshadow.com

···

On Oct 19, 2010, at 11:09 AM, Andy McNeil wrote:

Hi Everyone,

For those that are interested in using the new Radiance tools to perform annual simulations for complex or dynamic fenestration systems, I've prepared a tutorial. For now it's hosted on a google site:
https://sites.google.com/a/lbl.gov/andy-radiance/

Comments are welcome (of course).

Best,
Andy

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

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 <[email protected]>
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