From: John J. <j.j...@nt...> - 2018-03-27 14:23:05
|
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. I haven't tested the result of applying these, but it should get you further. John 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 list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |