JohnF
2014-11-01 11:23:56 UTC
What's the best set { (r_i,g_i,b_i), i=1,...,256 }
of 24-bit rgb values to choose for an arbitrary
(i.e., unknown beforehand) gif palette?
I'm programatically constructing animated gifs,
frame-by-frame and pixel-by-pixel within frames.
Too many pixels to store them all and go back
afterwards to statistically analyze their color
distributions. Instead, I want to pre-define
a palette, and then choose the index of the
best-fit color for each pixel as its calculated.
So what's the overall best set of colors for
such a pre-defined palette, and then, given
arbitrary r,g,b values calculated for a pixel,
what's the best way to determine the best-fit
(r_i,g_i,b_i) in that palette?
Aside:
If it makes any difference, and if it's
possible, "best-fit" means "best to the human eye",
whether that's least-sum-of-squares, (r-r_i)^2+etc,
or whatever else. And maybe relevant to that, I'm
actually using the hls color model, and then
converting those values to rgb (using the Foley
method). Thanks,
of 24-bit rgb values to choose for an arbitrary
(i.e., unknown beforehand) gif palette?
I'm programatically constructing animated gifs,
frame-by-frame and pixel-by-pixel within frames.
Too many pixels to store them all and go back
afterwards to statistically analyze their color
distributions. Instead, I want to pre-define
a palette, and then choose the index of the
best-fit color for each pixel as its calculated.
So what's the overall best set of colors for
such a pre-defined palette, and then, given
arbitrary r,g,b values calculated for a pixel,
what's the best way to determine the best-fit
(r_i,g_i,b_i) in that palette?
Aside:
If it makes any difference, and if it's
possible, "best-fit" means "best to the human eye",
whether that's least-sum-of-squares, (r-r_i)^2+etc,
or whatever else. And maybe relevant to that, I'm
actually using the hls color model, and then
converting those values to rgb (using the Foley
method). Thanks,
--
John Forkosh ( mailto: ***@f.com where j=john and f=forkosh )
John Forkosh ( mailto: ***@f.com where j=john and f=forkosh )