BitmapData.threshold seems accurate now, and decently fast, too!