I've never liked that the colors resulting from GIMP's Posterize filter are somewhat random and do not correspond to the colors in the original image. It is also somewhat limited in that the number of resulting RGB colors must be a power of two (e.g., if Levels is "3" then the result has 8 colors, if "5" then 32 colors result, etc.).
Converting the image to Indexed Mode overcomes these limitations, but the entire image must be converted (not just the current layer, or the selected region of the current layer). Nonetheless, I often found myself performing a work-around of dragging a layer to the Toolbox, converting it to Indexed Mode, and then dragging it back.
I finally broke down and wrote a script which automates this task, as well as providing a couple of nice options for smoothing the edges between color transitions. The script does not do anything particularly special but it does seem to be well-behaved and I am basically happy with it (though a better name might be considered; too bad posterize is already taken
).
BEFORE:
AFTER:
The new function is added to the Colors menu and the command is named "Quantize". The script is described
on my Chiselapp WIKI and a link to the download file is provided therein.
Any bug reports would be welcome.