[comp.graphics] Optimal palette selection for dither?

spencer@eecs.umich.edu (Spencer W. Thomas) (01/30/90)

In article <10675@primitive.ADS.COM> jdevries@primitive.ads.com (Jeff De Vries) writes:
>  My question is, Would you pick the same set if
> you knew you were going to dither your output?

My friend RGB (his real initials!) and I were just talking about this
the other day.  We concluded that if you were going to do some sort of
error-propagation dither (e.g. Floyd-Steinberg), that you might want
to make sure to pick representative colors that spanned the convex
hull of your actual colors.  This way your error propagation would
never diverge.

We didn't test it, but it seems reasonable.

--
=Spencer (spencer@eecs.umich.edu)

mccoy@pixar.UUCP (Daniel McCoy) (02/17/90)

In article <SPENCER.90Jan30042240@spline.eecs.umich.edu> spencer@eecs.umich.edu (Spencer W. Thomas) writes:
> ...  We concluded that if you were going to do some sort of
>error-propagation dither (e.g. Floyd-Steinberg), that you might want
>to make sure to pick representative colors that spanned the convex
>hull of your actual colors.  This way your error propagation would
>never diverge.

You would have to know the maximum possible propagated error and expand 
the convex hull by that much to insure that the error never diverges.  
(You could control it by clamping.)
Even then there can still be large gaps inside of the convex hull where
the error can get noticable.
An "optimal" pallete is hard to define, you remove error from one place
and it squirts out somewhere else.

Dan McCoy  {ucbvax,sun}!pixar!mccoy

falk@sun.Eng.Sun.COM (Ed Falk) (02/18/90)

In article <9231@pixar.UUCP>, mccoy@pixar.UUCP (Daniel McCoy) writes:
> In article <SPENCER.90Jan30042240@spline.eecs.umich.edu> spencer@eecs.umich.edu (Spencer W. Thomas) writes:
> > ...  We concluded that if you were going to do some sort of
> >error-propagation dither (e.g. Floyd-Steinberg), that you might want
> >to make sure to pick representative colors that spanned the convex
> >hull of your actual colors.  This way your error propagation would
> >never diverge.
> 
> You would have to know the maximum possible propagated error and expand 
> the convex hull by that much to insure that the error never diverges.  
> (You could control it by clamping.)
> Even then there can still be large gaps inside of the convex hull where
> the error can get noticable.
> An "optimal" pallete is hard to define, you remove error from one place
> and it squirts out somewhere else.

Ain't it the truth.

I've toyed with one variation on the median cut algorithm: instead
of assigning one color to represent a color cell, assign one color
for each corner of the cell.  That would handle the problem quite
nicely, but you would only have 1/8 as many cells.

A variation on this is in my own median-cut implementation.  I assign
a 5x5x5 color cube before I start computing cells.  This ensures that
error-propagation will never diverge.

-- 
	-ed falk, sun microsystems, sun!falk, falk@corp.sun.com

  "If you wrapped yourself in the flag like George Bush does, you'd
  be worried about flag-burning too"