ó <×ï[c@s‹ddlmZddlZddlmZyddlmZWn/ek rqZddlm Z e eƒZnXddl m Z dZ dZ eZd Zd Zd Zd Zd Zd Zd Zid d 6d d6dCd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d d"6d#d$6d%d&6d'd(6d)d*6d+„d,6Zd Zx0ejƒD]"ZeeeƒrXeeBZqXqXWd-efd.„ƒYZd/ejfd0„ƒYZdd1„Z!d2e"fd3„ƒYZ#edd d d4„Z$d5„Z%ed d6„Z&eeed&d7„Z'e&Z(e'Z)d d8„Z*dd9„Z+d:„Z,d;„Z-d<„Z.d=„Z/d>„Z0d?„Z1d@„Z2dA„Z3dB„Z4dS(Diÿÿÿÿ(tprint_functionN(tImage(t _imagingcms(tdeferred_error(t isStringTypesy pyCMS a Python / PIL interface to the littleCMS ICC Color Management System Copyright (C) 2002-2003 Kevin Cazabon kevin@cazabon.com http://www.cazabon.com pyCMS home page: http://www.cazabon.com/pyCMS littleCMS home page: http://www.littlecms.com (littleCMS is Copyright (C) 1998-2001 Marti Maria) Originally released under LGPL. Graciously donated to PIL in March 2009, for distribution under the standard PIL license The pyCMS.py module provides a "clean" interface between Python/PIL and pyCMSdll, taking care of some of the more complex handling of the direct pyCMSdll functions, as well as error-checking and making sure that all relevant data is kept together. While it is possible to call pyCMSdll functions directly, it's not highly recommended. Version History: 1.0.0 pil Oct 2013 Port to LCMS 2. 0.1.0 pil mod March 10, 2009 Renamed display profile to proof profile. The proof profile is the profile of the device that is being simulated, not the profile of the device which is actually used to display/print the final simulation (that'd be the output profile) - also see LCMSAPI.txt input colorspace -> using 'renderingIntent' -> proof colorspace -> using 'proofRenderingIntent' -> output colorspace Added LCMS FLAGS support. Added FLAGS["SOFTPROOFING"] as default flag for buildProofTransform (otherwise the proof profile/intent would be ignored). 0.1.0 pil March 2009 - added to PIL, as PIL.ImageCms 0.0.2 alpha Jan 6, 2002 Added try/except statements around type() checks of potential CObjects... Python won't let you use type() on them, and raises a TypeError (stupid, if you ask me!) Added buildProofTransformFromOpenProfiles() function. Additional fixes in DLL, see DLL code for details. 0.0.1 alpha first public release, Dec. 26, 2002 Known to-do list with current version (of Python interface, not pyCMSdll): none s 1.0.0 piliiiit MATRIXINPUTt MATRIXOUTPUTt MATRIXONLYitNOWHITEONWHITEFIXUPitNOPRELINEARIZATIONi tGUESSDEVICECLASSi@tNOTCACHEit NOTPRECALCit NULLTRANSFORMitHIGHRESPRECALCit LOWRESPRECALCi tWHITEBLACKCOMPENSATIONtBLACKPOINTCOMPENSATIONit GAMUTCHECKi@t SOFTPROOFINGi€t PRESERVEBLACKitNODEFAULTRESOURCEDEFcCs |d@d>S(Niÿi((tn((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyt‡st GRIDPOINTStImageCmsProfilecBs&eZd„Zdd„Zd„ZRS(cCsˆt|ƒr(|jtj|ƒ|ƒn\t|dƒrV|jtj|jƒƒƒn.t|tj ƒrx|j|ƒn t dƒ‚dS(s© :param profile: Either a string representing a filename, a file like object containing a profile or a low-level profile object treadsInvalid type for ProfileN( Rt_settcoret profile_openthasattrtprofile_frombytesRt isinstanceRt CmsProfilet TypeError(tselftprofile((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyt__init__™s cCsC||_||_|r-d|_d|_nd|_d|_dS(N(R$tfilenametNonet product_namet product_info(R#R$R&((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyRªs     cCstj|jƒS(sŸ Returns the profile in a format suitable for embedding in saved images. :returns: a bytes object containing the ICC profile. (Rtprofile_tobytesR$(R#((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyttobytes´sN(t__name__t __module__R%R'RR+(((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR—s  tImageCmsTransformcBsAeZdZededd„Zd„Zdd„Zd„Z RS(sµ Transform. This can be used with the procedural API, or with the standard Image.point() method. Will return the output profile in the output.info['icc_profile']. ic Cs“|dkr6tj|j|j||||ƒ|_n0tj|j|j|j|||||ƒ|_||_|_||_|_ ||_ dS(N( R'RtbuildTransformR$t transformtbuildProofTransformt input_modet inputModet output_modet outputModetoutput_profile( R#tinputtoutputR2R4tintenttprooft proof_intenttflags((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR%Ès   cCs |j|ƒS(N(tapply(R#tim((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytpointßscCsm|jƒ|dkr4tj|j|jdƒ}n|jj|jj |jj ƒ|j j ƒ|j d<|S(Nt icc_profile( tloadR'RtnewR4tsizeR0R=R>tidR6R+tinfo(R#R>timOut((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR=âs   cCsd|jƒ|j|jkr+tdƒ‚n|jj|jj|jjƒ|jj ƒ|j d<|S(Ns mode mismatchR@( RAtmodeR4t ValueErrorR0R=R>RDR6R+RE(R#R>((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytapply_in_placeês  N( R,R-t__doc__tINTENT_PERCEPTUALR'tINTENT_ABSOLUTE_COLORIMETRICR%R?R=RI(((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR.¿s   cCs“tjdkr^ddlm}t||jƒrFtj|dƒ}q‰tj|pUdƒ}n+y tj }Wnt k rdSX|ƒ}t |ƒS(sx (experimental) Fetches the profile for the current display device. :returns: None if the profile is not known. twin32iÿÿÿÿ(tImageWiniiN( tsystplatformtPILRNR tHDCRtget_display_profile_win32Rtget_display_profiletAttributeErrorR'R(thandleRNR$tget((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyRTós   t PyCMSErrorcBseZdZRS(sL (pyCMS) Exception class. This is used for all errors in the pyCMS API. (R,R-RJ(((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyRX sc CsO|dkr|j}nt|tƒ sEd|ko?dkn rTtdƒ‚nt|tƒ sd|ko{tkn r”tdtƒ‚nyŒt|tƒsµt|ƒ}nt|tƒsÓt|ƒ}nt|||j||d|ƒ}|r|j|ƒd}n|j |ƒ}Wn(t t t fk rJ} t| ƒ‚nX|S(s (pyCMS) Applies an ICC transformation to a given image, mapping from inputProfile to outputProfile. If the input or output profiles specified are not valid filenames, a PyCMSError will be raised. If inPlace == TRUE and outputMode != im.mode, a PyCMSError will be raised. If an error occurs during application of the profiles, a PyCMSError will be raised. If outputMode is not a mode supported by the outputProfile (or by pyCMS), a PyCMSError will be raised. This function applies an ICC transformation to im from inputProfile's color space to outputProfile's color space using the specified rendering intent to decide how to handle out-of-gamut colors. OutputMode can be used to specify that a color mode conversion is to be done using these profiles, but the specified profiles must be able to handle that mode. I.e., if converting im from RGB to CMYK using profiles, the input profile must handle RGB data, and the output profile must handle CMYK data. :param im: An open PIL image object (i.e. Image.new(...) or Image.open(...), etc.) :param inputProfile: String, as a valid filename path to the ICC input profile you wish to use for this image, or a profile object :param outputProfile: String, as a valid filename path to the ICC output profile you wish to use for this image, or a profile object :param renderingIntent: Integer (0-3) specifying the rendering intent you wish to use for the transform ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :param outputMode: A valid PIL mode for the output image (i.e. "RGB", "CMYK", etc.). Note: if rendering the image "inPlace", outputMode MUST be the same mode as the input, or omitted completely. If omitted, the outputMode will be the same as the mode of the input image (im.mode) :param inPlace: Boolean (1 = True, None or 0 = False). If True, the original image is modified in-place, and None is returned. If False (default), a new Image object is returned with the transform applied. :param flags: Integer (0-...) specifying additional flags :returns: Either None or a new PIL image object, depending on value of inPlace :exception PyCMSError: iis2renderingIntent must be an integer between 0 and 3s)flags must be an integer between 0 and %sR<N( R'RGR tintRXt _MAX_FLAGRR.RIR=tIOErrorR"RH( R>t inputProfilet outputProfiletrenderingIntentR5tinPlaceR<R0RFtv((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytprofileToProfiles,6  --  cCs=yt|ƒSWn(tttfk r8}t|ƒ‚nXdS(sñ (pyCMS) Opens an ICC profile file. The PyCMSProfile object can be passed back into pyCMS for use in creating transforms and such (as in ImageCms.buildTransformFromOpenProfiles()). If profileFilename is not a valid filename for an ICC profile, a PyCMSError will be raised. :param profileFilename: String, as a valid filename path to the ICC profile you wish to open, or a file-like object. :returns: A CmsProfile class object. :exception PyCMSError: N(RR[R"RHRX(tprofileFilenameR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetOpenProfilegscCst|tƒ s-d|ko'dkn r<tdƒ‚nt|tƒ sid|koctkn r|tdtƒ‚ny\t|tƒst|ƒ}nt|tƒs»t|ƒ}nt|||||d|ƒSWn(tttfk r}t|ƒ‚nXdS(sà (pyCMS) Builds an ICC transform mapping from the inputProfile to the outputProfile. Use applyTransform to apply the transform to a given image. If the input or output profiles specified are not valid filenames, a PyCMSError will be raised. If an error occurs during creation of the transform, a PyCMSError will be raised. If inMode or outMode are not a mode supported by the outputProfile (or by pyCMS), a PyCMSError will be raised. This function builds and returns an ICC transform from the inputProfile to the outputProfile using the renderingIntent to determine what to do with out-of-gamut colors. It will ONLY work for converting images that are in inMode to images that are in outMode color format (PIL mode, i.e. "RGB", "RGBA", "CMYK", etc.). Building the transform is a fair part of the overhead in ImageCms.profileToProfile(), so if you're planning on converting multiple images using the same input/output settings, this can save you time. Once you have a transform object, it can be used with ImageCms.applyProfile() to convert images without the need to re-compute the lookup table for the transform. The reason pyCMS returns a class object rather than a handle directly to the transform is that it needs to keep track of the PIL input/output modes that the transform is meant for. These attributes are stored in the "inMode" and "outMode" attributes of the object (which can be manually overridden if you really want to, but I don't know of any time that would be of use, or would even work). :param inputProfile: String, as a valid filename path to the ICC input profile you wish to use for this transform, or a profile object :param outputProfile: String, as a valid filename path to the ICC output profile you wish to use for this transform, or a profile object :param inMode: String, as a valid PIL mode that the appropriate profile also supports (i.e. "RGB", "RGBA", "CMYK", etc.) :param outMode: String, as a valid PIL mode that the appropriate profile also supports (i.e. "RGB", "RGBA", "CMYK", etc.) :param renderingIntent: Integer (0-3) specifying the rendering intent you wish to use for the transform ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :param flags: Integer (0-...) specifying additional flags :returns: A CmsTransform class object. :exception PyCMSError: iis2renderingIntent must be an integer between 0 and 3s)flags must be an integer between 0 and %sR<N( R RYRXRZRR.R[R"RH(R\R]tinModetoutModeR^R<R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR/}s:-- c Cs(t|tƒ s-d|ko'dkn r<tdƒ‚nt|tƒ sid|koctkn r|tdtƒ‚ny}t|tƒst|ƒ}nt|tƒs»t|ƒ}nt|tƒsÙt|ƒ}nt||||||||ƒSWn(tttfk r#}t|ƒ‚nXdS(sQ (pyCMS) Builds an ICC transform mapping from the inputProfile to the outputProfile, but tries to simulate the result that would be obtained on the proofProfile device. If the input, output, or proof profiles specified are not valid filenames, a PyCMSError will be raised. If an error occurs during creation of the transform, a PyCMSError will be raised. If inMode or outMode are not a mode supported by the outputProfile (or by pyCMS), a PyCMSError will be raised. This function builds and returns an ICC transform from the inputProfile to the outputProfile, but tries to simulate the result that would be obtained on the proofProfile device using renderingIntent and proofRenderingIntent to determine what to do with out-of-gamut colors. This is known as "soft-proofing". It will ONLY work for converting images that are in inMode to images that are in outMode color format (PIL mode, i.e. "RGB", "RGBA", "CMYK", etc.). Usage of the resulting transform object is exactly the same as with ImageCms.buildTransform(). Proof profiling is generally used when using an output device to get a good idea of what the final printed/displayed image would look like on the proofProfile device when it's quicker and easier to use the output device for judging color. Generally, this means that the output device is a monitor, or a dye-sub printer (etc.), and the simulated device is something more expensive, complicated, or time consuming (making it difficult to make a real print for color judgement purposes). Soft-proofing basically functions by adjusting the colors on the output device to match the colors of the device being simulated. However, when the simulated device has a much wider gamut than the output device, you may obtain marginal results. :param inputProfile: String, as a valid filename path to the ICC input profile you wish to use for this transform, or a profile object :param outputProfile: String, as a valid filename path to the ICC output (monitor, usually) profile you wish to use for this transform, or a profile object :param proofProfile: String, as a valid filename path to the ICC proof profile you wish to use for this transform, or a profile object :param inMode: String, as a valid PIL mode that the appropriate profile also supports (i.e. "RGB", "RGBA", "CMYK", etc.) :param outMode: String, as a valid PIL mode that the appropriate profile also supports (i.e. "RGB", "RGBA", "CMYK", etc.) :param renderingIntent: Integer (0-3) specifying the rendering intent you wish to use for the input->proof (simulated) transform ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :param proofRenderingIntent: Integer (0-3) specifying the rendering intent you wish to use for proof->output transform ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :param flags: Integer (0-...) specifying additional flags :returns: A CmsTransform class object. :exception PyCMSError: iis2renderingIntent must be an integer between 0 and 3s)flags must be an integer between 0 and %sN( R RYRXRZRR.R[R"RH( R\R]t proofProfileRdReR^tproofRenderingIntentR<R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyR1Ês"O--cCs[y/|r|j|ƒd}n|j|ƒ}Wn%ttfk rV}t|ƒ‚nX|S(sñ (pyCMS) Applies a transform to a given image. If im.mode != transform.inMode, a PyCMSError is raised. If inPlace == TRUE and transform.inMode != transform.outMode, a PyCMSError is raised. If im.mode, transfer.inMode, or transfer.outMode is not supported by pyCMSdll or the profiles you used for the transform, a PyCMSError is raised. If an error occurs while the transform is being applied, a PyCMSError is raised. This function applies a pre-calculated transform (from ImageCms.buildTransform() or ImageCms.buildTransformFromOpenProfiles()) to an image. The transform can be used for multiple images, saving considerable calculation time if doing the same conversion multiple times. If you want to modify im in-place instead of receiving a new image as the return value, set inPlace to TRUE. This can only be done if transform.inMode and transform.outMode are the same, because we can't change the mode in-place (the buffer sizes for some modes are different). The default behavior is to return a new Image object of the same dimensions in mode transform.outMode. :param im: A PIL Image object, and im.mode must be the same as the inMode supported by the transform. :param transform: A valid CmsTransform class object :param inPlace: Bool (1 == True, 0 or None == False). If True, im is modified in place and None is returned, if False, a new Image object with the transform applied is returned (and im is not changed). The default is False. :returns: Either None, or a new PIL Image object, depending on the value of inPlace. The profile will be returned in the image's info['icc_profile']. :exception PyCMSError: N(RIR'R=R"RHRX(R>R0R_RFR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytapplyTransform2s)  cCs˜|dkrtd|ƒ‚n|dkrXyt|ƒ}WqXtd|ƒ‚qXXnytj||ƒSWn%ttfk r“}t|ƒ‚nXdS(s% (pyCMS) Creates a profile. If colorSpace not in ["LAB", "XYZ", "sRGB"], a PyCMSError is raised If using LAB and colorTemp != a positive integer, a PyCMSError is raised. If an error occurs while creating the profile, a PyCMSError is raised. Use this function to create common profiles on-the-fly instead of having to supply a profile on disk and knowing the path to it. It returns a normal CmsProfile object that can be passed to ImageCms.buildTransformFromOpenProfiles() to create a transform to apply to images. :param colorSpace: String, the color space of the profile you wish to create. Currently only "LAB", "XYZ", and "sRGB" are supported. :param colorTemp: Positive integer for the white point for the profile, in degrees Kelvin (i.e. 5000, 6500, 9600, etc.). The default is for D50 illuminant if omitted (5000k). colorTemp is ONLY applied to LAB profiles, and is ignored for XYZ and sRGB. :returns: A CmsProfile class object :exception PyCMSError: tLABtXYZtsRGBs>Color space not supported for on-the-fly profile creation (%s)s1Color temperature must be numeric, "%s" not validN(RiRjRk(RXtfloatRt createProfileR"RH(t colorSpacet colorTempR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyRmgs   cCsµyƒt|tƒs!t|ƒ}n|jj}|jj}|pB|sS|jjdS| slt|ƒdkrt|dSd||fSWn+ttt t fk r°}t |ƒ‚nXdS(sú (pyCMS) Gets the internal product name for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised If an error occurs while trying to obtain the name tag, a PyCMSError is raised. Use this function to obtain the INTERNAL name of the profile (stored in an ICC tag in the profile itself), usually the one used when the profile was originally created. Sometimes this tag also contains additional information supplied by the creator. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal name of the profile as stored in an ICC tag. :exception PyCMSError: s is%s - %s N( R RR$t product_modeltproduct_manufacturertproduct_descriptiontlenRUR[R"RHRX(R$tmodelt manufacturerR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileName•s   cCs°y~t|tƒs!t|ƒ}n|jj}|jj}g}x*||fD]}|rL|j|ƒqLqLWdj|ƒdSWn+ttt t fk r«}t |ƒ‚nXdS(sµ (pyCMS) Gets the internal product information for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the info tag, a PyCMSError is raised Use this function to obtain the information stored in the profile's info tag. This often contains details about the profile, and how it was created, as supplied by the creator. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal profile information stored in an ICC tag. :exception PyCMSError: s N( R RR$Rrtproduct_copyrighttappendtjoinRUR[R"RHRX(R$t descriptiontcprighttarrteltR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileInfo¿s  cCsby0t|tƒs!t|ƒ}n|jjdSWn+ttttfk r]}t|ƒ‚nXdS(sD (pyCMS) Gets the copyright for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the copyright tag, a PyCMSError is raised Use this function to obtain the information stored in the profile's copyright tag. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal profile information stored in an ICC tag. :exception PyCMSError: s N( R RR$RwRUR[R"RHRX(R$R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileCopyrightçs cCsby0t|tƒs!t|ƒ}n|jjdSWn+ttttfk r]}t|ƒ‚nXdS(sM (pyCMS) Gets the manufacturer for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the manufacturer tag, a PyCMSError is raised Use this function to obtain the information stored in the profile's manufacturer tag. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal profile information stored in an ICC tag. :exception PyCMSError: s N( R RR$RqRUR[R"RHRX(R$R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileManufacturers cCsby0t|tƒs!t|ƒ}n|jjdSWn+ttttfk r]}t|ƒ‚nXdS(s8 (pyCMS) Gets the model for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the model tag, a PyCMSError is raised Use this function to obtain the information stored in the profile's model tag. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal profile information stored in an ICC tag. :exception PyCMSError: s N( R RR$RpRUR[R"RHRX(R$R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileModels cCsby0t|tƒs!t|ƒ}n|jjdSWn+ttttfk r]}t|ƒ‚nXdS(sJ (pyCMS) Gets the description for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the description tag, a PyCMSError is raised Use this function to obtain the information stored in the profile's description tag. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: A string containing the internal profile information stored in an ICC tag. :exception PyCMSError: s N( R RR$RrRUR[R"RHRX(R$R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetProfileDescription<s cCs^y,t|tƒs!t|ƒ}n|jjSWn+ttttfk rY}t|ƒ‚nXdS(s‘ (pyCMS) Gets the default intent name for the given profile. If profile isn't a valid CmsProfile object or filename to a profile, a PyCMSError is raised. If an error occurs while trying to obtain the default intent, a PyCMSError is raised. Use this function to determine the default (and usually best optimized) rendering intent for this profile. Most profiles support multiple rendering intents, but are intended mostly for one type of conversion. If you wish to use a different intent than returned, use ImageCms.isIntentSupported() to verify it will work first. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :returns: Integer 0-3 specifying the default rendering intent for this profile. ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :exception PyCMSError: N( R RR$trendering_intentRUR[R"RHRX(R$R`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytgetDefaultIntentYs cCsqy?t|tƒs!t|ƒ}n|jj||ƒr:dSdSWn+ttttfk rl}t|ƒ‚nXdS(s (pyCMS) Checks if a given intent is supported. Use this function to verify that you can use your desired renderingIntent with profile, and that profile can be used for the input/output/proof profile as you desire. Some profiles are created specifically for one "direction", can cannot be used for others. Some profiles can only be used for certain rendering intents... so it's best to either verify this before trying to create a transform with them (using this function), or catch the potential PyCMSError that will occur if they don't support the modes you select. :param profile: EITHER a valid CmsProfile object, OR a string of the filename of an ICC profile. :param intent: Integer (0-3) specifying the rendering intent you wish to use with this profile ImageCms.INTENT_PERCEPTUAL = 0 (DEFAULT) ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 ImageCms.INTENT_SATURATION = 2 ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3 see the pyCMS documentation for details on rendering intents and what they do. :param direction: Integer specifying if the profile is to be used for input, output, or proof INPUT = 0 (or use ImageCms.DIRECTION_INPUT) OUTPUT = 1 (or use ImageCms.DIRECTION_OUTPUT) PROOF = 2 (or use ImageCms.DIRECTION_PROOF) :returns: 1 if the intent/direction are supported, -1 if they are not. :exception PyCMSError: iiÿÿÿÿN( R RR$tis_intent_supportedRUR[R"RHRX(R$R9t directionR`((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytisIntentSupported€s&cCs#ttjtjjƒdtjfS(s# (pyCMS) Fetches versions. i(tVERSIONRtlittlecms_versionROtversiontsplitR(((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pytversions³s i(5t __future__RRORQRRt ImportErrortext_utilRt PIL._utilRt DESCRIPTIONRˆRRKtINTENT_RELATIVE_COLORIMETRICtINTENT_SATURATIONRLtDIRECTION_INPUTtDIRECTION_OUTPUTtDIRECTION_PROOFtFLAGSRZtvaluestflagR RYtobjectRtImagePointHandlerR.R'RTt ExceptionRXRaRcR/R1tbuildTransformFromOpenProfilest#buildProofTransformFromOpenProfilesRhRmRvR~RR€RR‚R„R‡RŒ(((s,/tmp/pip-build-SKekGm/pillow/PIL/ImageCms.pyts‚ ?  (4 R M` 5 . * (     ' 3