1. A method of compressing input symbols, where each input symbol is selected from an alphabet of M symbols to represent a pixel in a palettized image, into codewords which are represented in fewer bits and from which the input symbols can be decoded, comprising the steps of: selecting a context model; reading an input stream of M-ary input symbols; determining a distribution of contexts indicated by said context model over said input stream; determining a distribution of said M-ary input symbols in said contexts over in said input stream; assigning a first binary sequence to a first symbol of the M symbols in the alphabet, wherein said binary sequence is K bits, K being an integer greater than or equal to log.sub.2 M; assigning subsequent binary sequences to subsequent symbols of the M symbols in the alphabet, wherein the subsequent binary sequence is the binary sequence, selected from all unassigned binary sequences, which results in a minimum partial bitwise entropy over a partial alphabet of symbols of the alphabet which have already been assigned a binary sequence and the selected binary sequence, thereby forming a reindexing table for translating any M-ary symbol to its assigned binarization; repeating said step of assigning subsequent binary sequences at least until M-1 binary sequences are assigned to symbols; assigning a remaining binary sequence to a remaining symbol, thus completing said reindexing table; binarizing each M-ary input symbol using said reindexing table to form a bit stream; and entropy encoding said bit stream to form the codewords in a compressed codeword stream.
8. The method of claim 1, wherein said context model is a bit plane context model, wherein a context of a bit is determined by said bit's position within its binarization and a context symbol.