Peter, Usually if one person has a question, someone else may have the same question, so here are some suggestions. copy everything in the code below here (starting with (require 'viewmat').
Now start jqt and under file and new temp, paste all the code in the open window. Chose run and then all lines. The first window will have 4 palettes of color triples. Also, four images will be stacked up in the middle of the screen. The top image matches the bottom set of twelve colors or ordered triples. Don't hesitate to ask questions as you are rarely alone when you have them. When you run the code, it will be saved with a number, like 23.ijs. You may also use file and save as. Then select a name you can use to find it again if you chose to do so. . require 'viewmat' (P=:?12 3$256)viewmat(i.12);'Twelve Random Colors' P (P=:?12 3$256)viewmat(i.12);'Twelve Random Colors' P (P=:?12 3$256)viewmat(i.12);'Twelve Random Colors' P (P=:?12 3$256)viewmat(i.12);'Twelve Random Colors' P NB. Four boxes of crayons with random colors. NB. The "Top Box" matches the final colors. NB. 0 0 0 is Black and 255 255 255 is white NB. so small numbers are light colors. NB. A very small third number is amount of blue. NB. so the number is going to be quite dark. NB. Move the top box to the bottom of the screen and NB. build a tower of the four boxes NB. next to the data. NB. Select triples from the colors you like until you NB. can creat a box you like. NB. Later you may use you "crayons" to create your boxes or NB. buttons using wd commands. NB. Since I paint in watercolor I'm always surprised at NB. the combinations that I like and that I would never NB. have considered. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Monday, March 31, 2014 11:10 PM To: [email protected] Subject: Re: [Jprogramming] Challenge 14; Colorful Creations Start here. These are the only colors you can get with full red,green,blue and no red, no green and no blue. But you can get yellow magenta and cyan or the printer's colors. However there are */255 255 255 colors available. So maybe you will like 146 234 34 as your ordered triple. See if you can make a dozen colors that you like or a dozen that are picked at random. Until tomorrow..... I don't know all the answers to your questions but I think they will be fun to tackle. I'm ready to go to bed! Linda require 'viewmat' ]P8=: 255* #:i.8 P8 viewmat (i.8);'Box of Crayons' ]Q8=:1 0 2{"1 P8 Q8 viewmat (i.8);'Colors Value 8' -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Peter B. Kessler Sent: Monday, March 31, 2014 9:34 PM To: [email protected] Subject: Re: [Jprogramming] Challenge 14; Colorful Creations (Just to you, because I don't want to expose my ignorance any further than I have to.) I can see the value (pun intended) of having a grayscale palette that shades smoothly from white to black. For example if I'm preparing a bar chart for publication: I want to pick N different shadings that will be distinguishable, and I want to arrange them such that the difference from bar to bar is maximized. That is, five bars arranged 0.00, 0.50, 0.25, 1.00, 0.75 seems better than 0.00, 0.25. 0.50, 0.75, 1.00, on the theory that 0.50 is clearly darker than its surrounding 0.00 and 0.25, 0.25 is clearly lighter than 0.50 and 1.00, etc., so the bars will be distinguishable. But I haven't actually made up such a chart. As a user of color palettes, I want to say "I need N distinct colors, and have those look nice whether they are in color or in grayscale". There might be more to this than just "value". E.g., if I want 3 colors, can they be red, yellow, and blue? The primary colors. If I want 6 colors, can I get orange between the red and the yellow, green between the yellow and the blue, and purple between the blue and the red? Or is rainbow order just an accident of wavelength and not to be trusted? This seems more a matter of art than of numerics. In your GRB clock, I see what appears to be two areas of green: from 2 to about 2:30, and then again from 4 to about 5:30. The RGB clock has only one region of cyan. That seems confusing, but maybe I'm not meant to pick N colors from the clocks by choosing even intervals around the clock. Why does the GRB clock seem to have a smaller slice of cyan than the RGB clock? I'm always afraid these tests reveal more about my eyes and brain than about the colors themselves. That would be a problem if my eyes are different from everyone else's. yet another reason to rely on artists to pick colors for me. ... peter On 03/31/14 16:55, Linda Alvord wrote: > Here's some information to ponder concerning grayscale images. "Value" is a > very important aspect of color. All the computer colors depend on Red, Green > and Blue light. However, Green is brighter than Red. So life would be > simpler if we lived in a computer world which had number triples in GRB > order. There are 5 different images created here. Because they are being > timed, there are two of each image. Compare RGB and GRB. Compare Gray > RGB and Gray GRB . The final image is a different strategy for obtainin a > grayscale image. > > require 'viewmat' > > at2=: 13 :'([:{:"1 *.) j./"1 y' > RGB=: 255* #:i.8 > GRB=:1 0 2{"1 RGB > > we=: 13 :'<.0++/"1[0.3 0.59 0.11*"1 y' > gray=: 13 :'3#"0 we y' > ts=: 6!:2 , 7!:2@] > > ts 'RGB viewmat (D=.at2"0 /~ i:500);''RGB Clock''' > > ts 'GRB viewmat (D=.at2"0 /~ i:500);''GRB Clock''' > > ts '(gray RGB) viewmat (D=.at2"0 /~ i:500);''Gray RGB Clock''' > > ts '(gray GRB) viewmat (D=.at2"0 /~ i:500);''Better Gray GRB Clock Linda > Alvord''' > > RM=: (# # +/ % #)"1 > ts 'RM(3#"0 i.255) viewmat (D=.at2"0 /~ i:500);''Better Gray Clock Raul > Miller''' > > > I am looking for the bes possible way to introduce the topic of color images > and their grayscale images. Also, in the next examples I would like to show > the value of "value" in analyzing numeric data. Please send any ideas that > might be useful. > > > Linda > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Linda Alvord > Sent: Monday, March 31, 2014 12:35 AM > To: [email protected] > Subject: Re: [Jprogramming] Challenge 14; Colorful Creations > > require 'viewmat' > > at2=: 13 :'([:{:"1 *.) j./"1 y' > ]P8=: 255* #:i.8 > ]Q8=:1 0 2{"1 P8 > ro=: 13 :'<.0.5+y' > we=: 13 :'+/"1[0.3 0.59 0.11*"1 y' > gray=: 13 :'3#"0 ro we y' > ts=: 6!:2 , 7!:2@] > ts '(gray P8) viewmat (D=:at2"0 /~ i:1000);''Better Gray Clock''' > > RM=: (# # +/ % #)"1 > grayRM=:RM P8 > ts 'RM(3#"0 i.255) viewmat D;''Better Gray Clock Raul Miller''' > > Q8=:1 0 2{"1 P8 > grayLA=: 13 :'1 0 2{"1 y' > ts '(gray Q8) viewmat D;''Better Gray Clock Linda Alvord''' > > Both images look quite good. Is there some way to determine which is the > better image or are they the same? > > Linda > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Raul Miller > Sent: Sunday, March 30, 2014 4:17 PM > To: Programming forum > Subject: Re: [Jprogramming] Challenge 14; Colorful Creations > > Like this? > (3#"0 i.255) viewmat D;'Grade from white to black, clockwise from North' > > Thanks, > ---------------------------------------------------------------------- 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
