Path: utzoo!attcan!uunet!microsoft!erichs From: erichs@microsoft.UUCP (Erich Stehr) Newsgroups: comp.graphics Subject: Re: help with quick color map search Message-ID: <8126@microsoft.UUCP> Date: 20 Oct 89 15:48:02 GMT References: <67563@tut.cis.ohio-state.edu> Reply-To: erichs@microsoft.UUCP (Erich Stehr) Organization: Microsoft Corp., Redmond WA Lines: 13 In article <67563@tut.cis.ohio-state.edu> rosenbl@cis.ohio-state.edu (Robert Rosenblum) writes: >My routine >performs a linear search through the color map, comparing the >"distance" between my rgb value and each color map entry, and the >index of the closest color is returned. However, this technique is >very slow. Are you doing a square root for each iteration? If you are, that's one of your problems. All you need is the relative "distance" between the colors, and the squares of the distances will have the same relative ordering. Erich Stehr "The Sorceress' Apprentice" uunet!microsoft!erichs