DitherTo8 selects the colors most frequent in the DIB to be displayed. The number of colors selected for the palette in this fashion is specified by the more parameter. The total values of all colors defined by std and more must not exceed 236. This limit is in place to insure that the resulting DIB's palette will have at least 20 unused colors. These colors are needed for the standard palette on 8 bit displays.
Speed is approximately three times faster than application of an optimized palette.
A color palette created by CreateHalftonePalette should then be applied to complete the process. Note also that NT applies only an ordered dither algorithm and performs no error diffusion. Resulting quality is significantly poorer for most images than error diffusion, but ordered dithering is a significantly faster process.