Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!wasatch!thomson From: thomson@wasatch.UUCP (Rich Thomson) Newsgroups: comp.graphics Subject: Re: Trying to improve a palette reduction algorithm Message-ID: <703@wasatch.UUCP> Date: 6 Dec 88 03:42:13 GMT References: <9274@gryphon.COM> Reply-To: thomson@wasatch.utah.edu.UUCP (Rich Thomson) Organization: Oasis Technologies Lines: 32 In article <9274@gryphon.COM> keithd@gryphon.COM (Keith Doyle) writes: :I'm trying to improve a palette reduction algorithm I'm using, :I know it can get better because I've also been using a couple :of programs that clearly do a better job. : :What I'm currently doing: : :1. computing the histogram :2. sorting it into a most-used-first table :3. starting at ncolors/2, scanning up through the : table successively eliminating colors that are within : x distance of a color already in the palette, and adjusting : x until I've reduced to ncolors. [stuff deleted] Check out chapter six of _Digital Picture Processing_, 2nd ed., by Azriel Rosenfield and Avinash C. Kak. This chapter covers techniques of 'histogram sharpening' and other histogram modification techniques. Basically, 'histogram sharpening' is an iterative process that will sharpen the histogram peaks of the image, then you can reduce the number of palette entries to just those taken up by the peaks of the histogram. Upon glancing at the description of the method, it appears to modify the original image (at least in terms of the color values used for the pixels) which may not be what you want. Anyway, there's lots of useful stuff in this book (I think), so you may want to check it out anyway. -- Rich -- Rich Thomson thomson@cs.utah.edu {bellcore,hplabs}!utah-cs!thomson "Tyranny, like hell, is not easily conquered; yet we have this consolation with us, that the harder the conflict, the more glorious the triumph. What we obtain too cheap, we esteem too lightly." Thomas Paine, _The Crisis_, Dec. 23rd, 1776