Take a look at these images:
load 'viewmat'
   
]PAL=:6 3$0 0 255 0 255 255 0 255 0 255 255 0 255 0 0 255 0 255
]RGB=:( #:i.8){0 255
]GRB=:1 0 2{"1 RGB

ro=: 13 :'<.0.5+y'
we=: 13 :'+/"1[0.3 0.59 0.11*"1 y'
gray=: 13 :'3#"0 ro we y'
   
>./i:4

A=:i:160>./i:160
   
(gray GRB) viewmat A;'gray GRB Stripes'
   
GRB viewmat A;'GRB stripes'
   
(gray RGB) viewmat A;'gray RGB Stripes'
   
   RGB viewmat A;'RGB stripes'
   
(gray PAL) viewmat A;'gray PAL Stripes'
   
PAL viewmat A;'PAL Stripes'
   
Linda


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Tuesday, July 22, 2014 10:11 AM
To: Programming forum
Subject: Re: [Jprogramming] 'What if light triples in RGB were changed to
GRB

That makes sense:

Green is in the middle of the spectrum and our eyes are more sensitive
to green than to red or blue. It's "brighter". And red is "brighter"
than blue.

So if the first column of #:i.8 represents green, the second red and
the third blue, you'll get a better approximation of ordered
brightness than if you used a conflicting column ordering.

I suppose it's a question whether magenta is brighter than green, or
the other way around. But the answer to that question might vary from
person to person.

Or rather, when I think about things in that way, they seem to me to
make sense. When I just look at the mapping:
   #.1 0 2 {"1 #:i.8
0 1 4 5 2 3 6 7

That numeric series does not actually make much sense to me by itself
(when I think about it without your perspective on mapping colored
images to grayscale).

Thanks,

-- 
Raul

On Tue, Jul 22, 2014 at 5:41 AM, Linda Alvord <[email protected]>
wrote:
> Here's a colorful script for you to run.  Be sure to also check the data
> stream in "term" as well as the images.  The script just flips out the
> images like a stack of pancakes and you may move them around on your
screen
> on a laptop.  Just click to delete the top one to see the one under it on
a
> phone.
>
> load 'viewmat'
>
> PAL=:6 3$0 0 255 0 255 255 0 255 0 255 255 0 255 0 0 255 0 255
> HUES=:>"0:;:'BLUE AQUA GREEN YELLOW RED MAGENTA'
> PAL;HUES
>
> RGB=:( #:i.8){0 255
> ALL=:>"0:;:'BLACK BLUE GREEN AQUA RED MAGENTA YELLOW WHITE'
> RGB;ALL
>
> GRB=:1 0 2{"1 RGB
> NEW=:>"0;: 'BLACK BLUE RED  MAGENTA  GREEN AQUA YELLOW WHITE'
> GRB;NEW
>
> ro=: 13 :'<.0.5+y'
> we=: 13 :'+/"1[0.3 0.59 0.11*"1 y'
> gray=: 13 :'3#"0 ro we y'
>
> ]D=: (i:4)%/(|.>:i.4),>:i.4
> (gray GRB) viewmat D;'% GRB'
> (gray RGB) viewmat D;'% RGB'
> (gray PAL) viewmat D;'% PAL'
> GRB viewmat D;'% GRB'
> RGB viewmat D;'% RGB'
> PAL viewmat D;'% PAL'
>
> ]C=:*/~ i:4
> (gray GRB) viewmat C;'* GRB'
> (gray RGB) viewmat C;'* RGB'
> (gray PAL) viewmat C;'* PAL'
> GRB viewmat C;'* GRB'
> RGB viewmat C;'* RGB'
> PAL viewmat C;'* PAL'
>    \
> ]B=:-/~ i:4
> (gray GRB) viewmat B;'- GRB'
> (gray RGB) viewmat B;'- RGB'
> (gray PAL) viewmat B;'- PAL'
> GRB viewmat B;'- GRB'
> RGB viewmat B;'- RGB'
> PAL viewmat B;'- PAL'
>    \
> ]A=:+/~ i:4
> (gray GRB) viewmat A;'+ GRB'
> (gray RGB) viewmat A;'+ RGB'
> (gray PAL) viewmat A;'+ PAL'
> GRB viewmat A;'+ GRB'
> RGB viewmat A;'+ RGB'
> PAL viewmat A;'+ PAL'
>
> If you view addition, subtraction, times and division tables using the
> palette I call  PAL  from viewmat  (the default left argument) or RGB
colors
> they both convert poorly to grayscale.
>
> However if you simply reverse RGB to GRB  (easy in J) you get better
> grayscale images.
>
> However, the real advantage comes when you realize the larger the number
in
> the data are  the brighter the colors in the image..  Smaller numbers tend
> toward black.
>
> The colors in the  GRB  maps tell you about the comparative sizes of the
> data in the arrays.
>
> Linda
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to