Levels via paletteMap

Hello, does anyone know how to do level adjustments (like Photoshop levels) on a bitmapData Object using the paletteMap method.

I’m fine with syntax and all that, just don’t understand how the channel array values are used well enough to come up with them for myself.

I have read to use a palette of 0 and 1, but I’m not sure what that means.

The goal of this is to take a grayscale image and get sharper black and white values for it. Also, I hope to understand how to use this method better in general.

[FONT=Verdana]If anyone knows what values I should use and/or a good site that explains this I would very much appreciate it.[/FONT]