From: Aaron B. <bo...@gm...> - 2018-03-27 14:31:18
|
On Tue, Mar 27, 2018 at 10:22 AM, John Jefferies via Lcms-user < lcm...@li...> wrote: > > Hi, > The first thing, cmsCIExyY() shouldn't be used as the white point of the > Lab profile. It is initialised to (0, 0, 0) which obviously isn't right. > You probably want cmsD50_xyY() instead. > > The second thing. The format of the RGB data is TYPE_RGB_DBL. That doesn't > match the [255, 255, 255] that's used. Use TYPE_RGB_8 instead. > Doesn't [255,255,255] create an array of dimension 255x255x255 ? On 27/03/2018 10:12, Gonzalez Cano, Jordi wrote: I would like to use the LCMS with python, but when I want to call the function cmsDoTransform the following error appears: *TypeError: in method 'cmsDoTransform', argument 2 of type 'void const *'* What I am sending to the cmsDoTransform si the following: *array = [255,255,255]* *labColor = lcmsF.transformToLab(array,profileInURL,"RGB","perceptual")* *--------------- * *def transformToLab(inputColor, profileInURL, formatIn, intent, BPC = True):* * LabColor = []* * labProfile = lcms.cmsCreateLab4Profile(lcms.cmsCIExyY())* * inputProfile = lcms.cmsOpenProfileFromFile(profileInURL, "r")* * if(formatIn == "RGB"):* * inType = lcms.TYPE_RGB_DBL* * elif(formatIn == "CMYK"):* * inType = lcms.TYPE_CMYK_DBL* * if(intent == "perceptual"):* * m_intent = lcms.INTENT_PERCEPTUAL* * if(BPC):* * m_BPC = lcms.cmsFLAGS_BLACKPOINTCOMPENSATION* * else:* * m_BPC = 0* * transform = lcms.cmsCreateTransform(inputProfile, inType, labProfile, lcms.TYPE_Lab_DBL, m_intent, m_BPC)* * lcms.cmsDoTransform(transform,inputColor, LabColor, DIM_OUT)* * return LabColor* How I am supposed to do it? Thanks, Jordi G.C. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Lcms-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/lcms-user > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > > |