Ask Your Question
0

AdobeRGB to RGB without change in color or making it washed out

asked 2020-07-17 01:57:26 -0500

snsinha gravatar image

This is more like a query.I am processing some images using opencv and the images are in AdobeRBG space , opencv is able to convert it to RGB .But thats deteriorating the image color.the later one look dull. Is there a way I can handle this case.

edit retag flag offensive close merge delete

Comments

what if you just convert them ?

berak gravatar imageberak ( 2020-07-17 02:14:08 -0500 )edit

@berak convert it using what functionality?

snsinha gravatar imagesnsinha ( 2020-07-17 03:19:53 -0500 )edit

e.g. the link above ?

(but i think, you already answered it below, right ?)

berak gravatar imageberak ( 2020-07-17 03:33:55 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-07-17 02:27:48 -0500

You should know the difference between sRGB and Adobe RGB.Sorry, opencv and pillow can not complete this task very well.You should try to process the image with imagemagick first.Like this:

from PIL import Image, ImageCMS
import numpy as np
srgb = ImageCms.createProfile('sRGB')
def get_adobe(img):
    output = BytesIO()   
    output.write(img.info.get('icc_profile'))
    output.seek(0)
    adobe = ImageCms.getOpenProfile(output)     
    return adobe


def convert_to_srgb(image):
    if image.info.get('icc_profile', ''):
        adobe = get_adobe(image)
        image = ImageCms.profileToProfile(image, adobe, srgb)
    return image
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-07-17 01:57:26 -0500

Seen: 47 times

Last updated: Jul 17