image scale/crop/colorspace converter function