def do_proof_bitmap_transform(self, img): """ Does image proof transform. Returns new image instance. """ cs_in = IMAGE_TO_COLOR[img.mode] mode = IMAGE_RGB transform = self.get_proof_transform(cs_in) return libcms.cms_do_bitmap_transform(transform, img, img.mode, mode)
def do_bitmap_transform(self, img, mode, cs_out=None): """ Does image proof transform. Returns new image instance. """ if not self.use_cms and not img.mode == IMAGE_LAB: return img.convert(mode) cs_in = IMAGE_TO_COLOR[img.mode] if not cs_out: cs_out = IMAGE_TO_COLOR[mode] transform = self.get_transform(cs_in, cs_out) return libcms.cms_do_bitmap_transform(transform, img, img.mode, mode)
def adjust_image(self, img, profilestr): """ Adjust image with embedded profile to similar colorspace defined by current profile. profilestr - embedded profile as a python string. Returns new image instance. """ custom_profile = libcms.cms_open_profile_from_string(profilestr) cs_in = cs_out = IMAGE_TO_COLOR[img.mode] out_profile = self.handles[cs_in] intent = self.rgb_intent if cs_out == COLOR_CMYK:intent = self.cmyk_intent transform = libcms.cms_create_transform(custom_profile, cs_in, out_profile, cs_out, intent, self.flags) return libcms.cms_do_bitmap_transform(transform, img, cs_in, cs_out)
def adjust_image(self, img, profilestr): """ Adjust image with embedded profile to similar colorspace defined by current profile. profilestr - embedded profile as a python string. Returns new image instance. """ custom_profile = libcms.cms_open_profile_from_string(profilestr) cs_in = cs_out = IMAGE_TO_COLOR[img.mode] out_profile = self.handles[cs_in] intent = self.rgb_intent if cs_out == COLOR_CMYK: intent = self.cmyk_intent transform = libcms.cms_create_transform(custom_profile, cs_in, out_profile, cs_out, intent, self.flags) return libcms.cms_do_bitmap_transform(transform, img, cs_in, cs_out)