9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] alg to make a good colour palette for a graph
       [not found] <3106177662@snellwilcox.com>
@ 2003-02-21 10:03 ` Steve Simon
  2003-02-21 12:58   ` [9fans] " Jim Choate
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Simon @ 2003-02-21 10:03 UTC (permalink / raw)
  To: 9fans

Hi,

I picked up somecode from Graphics gems to do this,
it was good enough for me though I wouldn't vouch
the optimal-ness of its solution.

The file is colorquant.c, I cannot find which volume of
gems its from but I could send you the code if you like.

-Steve


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [9fans] Re: alg to make a good colour palette for a graph
  2003-02-21 10:03 ` [9fans] alg to make a good colour palette for a graph Steve Simon
@ 2003-02-21 12:58   ` Jim Choate
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Choate @ 2003-02-21 12:58 UTC (permalink / raw)
  To: 9fans


On Fri, 21 Feb 2003, Steve Simon wrote:

> I picked up somecode from Graphics gems to do this,
> it was good enough for me though I wouldn't vouch
> the optimal-ness of its solution.
>
> The file is colorquant.c, I cannot find which volume of
> gems its from but I could send you the code if you like.

Google is your friend, all the code from all five volumes is available on
the web at the Graphics Gem homesite, which by the way will take you to
their e-zine on graphics related topics.


 --
    ____________________________________________________________________

      We are all interested in the future for that is where you and I
      are going to spend the rest of our lives.

                              Criswell, "Plan 9 from Outer Space"

      ravage@ssz.com                            jchoate@open-forge.org
      www.ssz.com                               www.open-forge.org
    --------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] alg to make a good colour palette for a graph
  2003-02-21  6:08   ` [9fans] alg to make a good colour palette for a graph George Michaelson
  2003-02-21  6:39     ` Eric Grosse
@ 2003-02-21  7:46     ` Skip Tavakkolian
  1 sibling, 0 replies; 6+ messages in thread
From: Skip Tavakkolian @ 2003-02-21  7:46 UTC (permalink / raw)
  To: 9fans

> totally non Plan9 question but people here oftentimes have nice simple algs
> which work well across lots of contexts.

I agree. There is so much to be learned from people on this list,
just by observing/listening in.

On a somewhat related note, I wanted to share my pick for a new
book of algorithms; It is called "Hacker's Delight" by Henry S.
Warren Jr.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] alg to make a good colour palette for a graph
  2003-02-21  6:39     ` Eric Grosse
@ 2003-02-21  6:57       ` George Michaelson
  0 siblings, 0 replies; 6+ messages in thread
From: George Michaelson @ 2003-02-21  6:57 UTC (permalink / raw)
  To: 9fans; +Cc: ehg


Many, many thanks. perfecto!

-George


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] alg to make a good colour palette for a graph
  2003-02-21  6:08   ` [9fans] alg to make a good colour palette for a graph George Michaelson
@ 2003-02-21  6:39     ` Eric Grosse
  2003-02-21  6:57       ` George Michaelson
  2003-02-21  7:46     ` Skip Tavakkolian
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Grosse @ 2003-02-21  6:39 UTC (permalink / raw)
  To: 9fans

It depends on the monitor.  Take a look at
   http://plan9.bell-labs.com/cm/cs/doc/85/4-01.ps.gz
That solution (which used l2 optimization over a psychophysical
color difference metric) gave very good results, but is way too
complicated for awk.    You can run the computation once, build
a decent spline approximation to the hue curve, and use awk to
interpolate in the table, given <n>.   That's the approach of
   http://plan9.bell-labs.com/netlib/graphics/rainbow.c.gz

Eric


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [9fans] alg to make a good colour palette for a graph
  2003-02-21  5:55 ` Russ Cox
@ 2003-02-21  6:08   ` George Michaelson
  2003-02-21  6:39     ` Eric Grosse
  2003-02-21  7:46     ` Skip Tavakkolian
  0 siblings, 2 replies; 6+ messages in thread
From: George Michaelson @ 2003-02-21  6:08 UTC (permalink / raw)
  To: 9fans


totally non Plan9 question but people here oftentimes have nice simple algs
which work well across lots of contexts.

I need to make a set of <n> visually distinctive colours in rgb space such
that I can feed the rgb values into a tool (RRD) to graph with.

Microsloth picks colours for you. a very nasty muted set. Gnuplot repeats the
same palette of colours over and over again.

I read in the RRD list of a technique to map the <n> as equidistant points
distributed in HSV space, and then use them. But, no code.

N varies. Usually its less than 15. In those cases I think I can use an
Acronymic 'Richard Of York Gave Battle In Vain' selection. But for one case I
am looking at, I need 250+ reasonably distinctive colours.

I thought about just taking a 256colourmap, and randomizing it, and using the
entire palette that way. It should mean no two adjacent colours are very alike
which is fine for a stacked line chart.

Is there something simple and nice, which I can do in AWK? Something which
will go into the ff-space and pick good colour combos? The obvious things I
come up with make gray (for a stunningly obvious reason) It would be super
nice to have up to 25 or 30 colours which are all mutually equi-distant in
some sense.

clues? I've tried web browsing. its phenominal how few things seem remotely
relevant from keyword searches using colourspace, colourmap, palette, graph.

-George



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-21 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3106177662@snellwilcox.com>
2003-02-21 10:03 ` [9fans] alg to make a good colour palette for a graph Steve Simon
2003-02-21 12:58   ` [9fans] " Jim Choate
2003-02-21  5:47 [9fans] output of ps(1) memory usage YAMANASHI Takeshi
2003-02-21  5:55 ` Russ Cox
2003-02-21  6:08   ` [9fans] alg to make a good colour palette for a graph George Michaelson
2003-02-21  6:39     ` Eric Grosse
2003-02-21  6:57       ` George Michaelson
2003-02-21  7:46     ` Skip Tavakkolian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).