Support JSON serialization for palette; improved error remproting
Modifed image downsample for python-side linearcolormapper