Movatterモバイル変換


[0]ホーム

URL:


libvips

A fast image processing library with low memory needs.

DownloadInstallDocumentationIssuesWikilibvips projectslibvips on GitHub
Top  | Description  | Object HierarchyHomeUpPrevNext

colour

colour — colour operators

Stability Level

Stable, unless otherwise indicated

Functions

gbooleanvips_colourspace_issupported ()
intvips_colourspace ()
intvips_LabQ2sRGB ()
intvips_rad2float ()
intvips_float2rad ()
intvips_LabS2LabQ ()
intvips_LabQ2LabS ()
intvips_LabQ2Lab ()
intvips_Lab2LabQ ()
intvips_LCh2Lab ()
intvips_Lab2LCh ()
intvips_Yxy2Lab ()
intvips_CMC2XYZ ()
intvips_Lab2XYZ ()
intvips_XYZ2Lab ()
intvips_XYZ2scRGB ()
intvips_scRGB2sRGB ()
intvips_scRGB2BW ()
intvips_sRGB2scRGB ()
intvips_scRGB2XYZ ()
intvips_HSV2sRGB ()
intvips_sRGB2HSV ()
intvips_LCh2CMC ()
intvips_CMC2LCh ()
intvips_XYZ2Yxy ()
intvips_Yxy2XYZ ()
intvips_LabS2Lab ()
intvips_Lab2LabS ()
intvips_CMYK2XYZ ()
intvips_XYZ2CMYK ()
intvips_profile_load ()
intvips_icc_present ()
intvips_icc_transform ()
intvips_icc_import ()
intvips_icc_export ()
intvips_icc_ac2rc ()
gbooleanvips_icc_is_compatible_profile ()
intvips_dE76 ()
intvips_dE00 ()
intvips_dECMC ()
voidvips_col_Lab2XYZ ()
voidvips_col_XYZ2Lab ()
doublevips_col_ab2h ()
voidvips_col_ab2Ch ()
voidvips_col_Ch2ab ()
floatvips_col_L2Lcmc ()
floatvips_col_C2Ccmc ()
floatvips_col_Ch2hcmc ()
voidvips_col_make_tables_CMC ()
floatvips_col_Lcmc2L ()
floatvips_col_Ccmc2C ()
floatvips_col_Chcmc2h ()
intvips_col_sRGB2scRGB_8 ()
intvips_col_sRGB2scRGB_16 ()
intvips_col_sRGB2scRGB_8_noclip ()
intvips_col_sRGB2scRGB_16_noclip ()
intvips_col_scRGB2XYZ ()
intvips_col_XYZ2scRGB ()
intvips_col_scRGB2sRGB_8 ()
intvips_col_scRGB2sRGB_16 ()
intvips_col_scRGB2BW_16 ()
intvips_col_scRGB2BW_8 ()
floatvips_pythagoras ()
floatvips_col_dE00 ()

Types and Values

#defineVIPS_D93_X0
#defineVIPS_D93_Y0
#defineVIPS_D93_Z0
#defineVIPS_D75_X0
#defineVIPS_D75_Y0
#defineVIPS_D75_Z0
#defineVIPS_D65_X0
#defineVIPS_D65_Y0
#defineVIPS_D65_Z0
#defineVIPS_D55_X0
#defineVIPS_D55_Y0
#defineVIPS_D55_Z0
#defineVIPS_D50_X0
#defineVIPS_D50_Y0
#defineVIPS_D50_Z0
#defineVIPS_A_X0
#defineVIPS_A_Y0
#defineVIPS_A_Z0
#defineVIPS_B_X0
#defineVIPS_B_Y0
#defineVIPS_B_Z0
#defineVIPS_C_X0
#defineVIPS_C_Y0
#defineVIPS_C_Z0
#defineVIPS_E_X0
#defineVIPS_E_Y0
#defineVIPS_E_Z0
#defineVIPS_D3250_X0
#defineVIPS_D3250_Y0
#defineVIPS_D3250_Z0
enumVipsIntent
enumVipsPCS

Object Hierarchy

GEnum├── VipsIntent╰── VipsPCS

Includes

#include <vips/vips.h>

Description

These operators let you transform coordinates and images between colourspaces, calculate colour differences, and moveto and from device spaces.

All operations process colour from the first few bands and pass other bandsthrough unaltered. This means you can operate on images with alpha channelssafely. If you move to or from 16-bit RGB, any alpha channels are rescaledfor you.

Radiance images have four 8-bits bands and store 8 bits of R, G and B andanother 8 bits of exponent, common to all channels. They are widely used inthe HDR imaging community.

The colour functions can be divided into three main groups. First,functions to transform images between the different colour spaces supportedby VIPS:VIPS_INTERPRETATION_sRGB,VIPS_INTERPRETATION_scRGB,VIPS_INTERPRETATION_B_W,VIPS_INTERPRETATION_XYZ,VIPS_INTERPRETATION_YXY,VIPS_INTERPRETATION_LAB,VIPS_INTERPRETATION_LCH, andVIPS_INTERPRETATION_CMC.

There are also a set of minor colourspaces which are one of the above in aslightly different format:VIPS_INTERPRETATION_LAB,VIPS_INTERPRETATION_LABQ,VIPS_INTERPRETATION_LABS,VIPS_INTERPRETATION_LCH,VIPS_INTERPRETATION_RGB16, andVIPS_INTERPRETATION_GREY16.

Usevips_colourspace() to move an image to atarget colourspace using the best sequence of colour transform operations.

Secondly, there are a set of operations forcalculating colour difference metrics. Finally, VIPS wraps LittleCMS anduses it to provide a set of operations for reading and writing images withICC profiles.

This figure shows how the VIPS colour spaces interconvert:

The colour spaces supported by VIPS are:

  • VIPS_INTERPRETATION_LAB -- CIELAB '76 colourspace with a D65 white. Thisuses three floats for each band, and bands have the obvious range.

    There are twovariants,VIPS_INTERPRETATION_LABQ andVIPS_INTERPRETATION_LABS, whichuse ints to store values. These are less precise, but can be quicker tostore and process.

    VIPS_INTERPRETATION_LCH is the same, but with a*b* as polar coordinates.Hue is expressed in degrees.

  • VIPS_INTERPRETATION_XYZ -- CIE XYZ. This uses three floats.SeeVIPS_D75_X0 and friends for values for the rangesunder various illuminants.

    VIPS_INTERPRETATION_YXY is the same, but with little x and y.

  • VIPS_INTERPRETATION_scRGB -- a linear colourspace with the sRGBprimaries. This is useful if you need linear light and don't caremuch what the primaries are.

    Linearization is performed with the usual sRGB equations, see below.

  • VIPS_INTERPRETATION_sRGB -- the standard sRGB colourspace, see:wikipedia sRGB.

    This uses three 8-bit values for each of RGB.

    VIPS_INTERPRETATION_RGB16 is the same, but using three 16-bit values forRGB.

    VIPS_INTERPRETATION_HSV is sRGB, but in polar coordinates.VIPS_INTERPRETATION_LCH is much better, only use HSV if you have to.

  • VIPS_INTERPRETATION_B_W -- a monochrome image, roughly G from sRGB.The grey value iscalculated in linearVIPS_INTERPRETATION_scRGB space with RGB ratios0.2126, 0.7152, 0.0722 as defined by CIE 1931 linear luminance.

    VIPS_INTERPRETATION_GREY16 is the same, but using 16 bits.

  • VIPS_INTERPRETATION_CMC -- a colour space based on the CMC(1:1)colour difference measurement. This is a highly uniform colour space,and much better than CIELAB for expressing small differences.

    The CMC colourspace is described in "Uniform Colour Space Based on theCMC(l:c) Colour-difference Formula", M R Luo and B Rigg, Journal of theSociety of Dyers and Colourists, vol 102, 1986. Distances in thiscolourspace approximate, within 10% or so, differences in the CMC(l:c)colour difference formula.

    You can calculate metrics like CMC(2:1) by scaling the spaces beforefinding differences.

Functions

vips_colourspace_issupported ()

gbooleanvips_colourspace_issupported (constVipsImage *image);

Test ifimage is in a colourspace thatvips_colourspace() can process.

[method]

Parameters

image

input image

 

Returns

TRUE ifimageis in a supported colourspace.


vips_colourspace ()

intvips_colourspace (VipsImage *in,VipsImage **out,VipsInterpretation space,...);

Optional arguments:

  • source_space: input colour space

This operation looks at the interpretation field ofin (or usessource_space, if set) and runsa set of colourspace conversion functions to move it tospace.

For example, given an image tagged asVIPS_INTERPRETATION_YXY, runningvips_colourspace() withspace set toVIPS_INTERPRETATION_LAB willconvert withvips_Yxy2XYZ() andvips_XYZ2Lab().

See also:vips_colourspace_issupported(),vips_image_guess_interpretation().

[method]

Parameters

in

input image

 

out

output image.

[out]

space

convert to this colour space

 

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LabQ2sRGB ()

intvips_LabQ2sRGB (VipsImage *in,VipsImage **out,...);

Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band short image.

See also:vips_LabS2LabQ(),vips_LabQ2sRGB(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_rad2float ()

intvips_rad2float (VipsImage *in,VipsImage **out,...);

Unpack a RAD (VIPS_CODING_RAD) image to a three-band float image.

See also:vips_float2rad(),vips_LabQ2LabS().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_float2rad ()

intvips_float2rad (VipsImage *in,VipsImage **out,...);

Convert a three-band float image to Radiance 32-bit packed format.

See also:vips_rad2float(),VIPS_CODING_RAD,vips_LabQ2Lab().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LabS2LabQ ()

intvips_LabS2LabQ (VipsImage *in,VipsImage **out,...);

Convert a LabS three-band signed short image to LabQ

See also:vips_LabQ2LabS().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LabQ2LabS ()

intvips_LabQ2LabS (VipsImage *in,VipsImage **out,...);

Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band short image.

See also:vips_LabS2LabQ(),vips_LabQ2LabS(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LabQ2Lab ()

intvips_LabQ2Lab (VipsImage *in,VipsImage **out,...);

Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band float image.

See also:vips_LabQ2Lab(),vips_LabQ2LabS(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_Lab2LabQ ()

intvips_Lab2LabQ (VipsImage *in,VipsImage **out,...);

Convert a Lab three-band float image to LabQ (VIPS_CODING_LABQ).

See also:vips_LabQ2Lab().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LCh2Lab ()

intvips_LCh2Lab (VipsImage *in,VipsImage **out,...);

Turn LCh to Lab.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_Lab2LCh ()

intvips_Lab2LCh (VipsImage *in,VipsImage **out,...);

Turn Lab to LCh.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_Yxy2Lab ()

intvips_Yxy2Lab (VipsImage *in,VipsImage **out,...);

vips_CMC2XYZ ()

intvips_CMC2XYZ (VipsImage *in,VipsImage **out,...);

vips_Lab2XYZ ()

intvips_Lab2XYZ (VipsImage *in,VipsImage **out,...);

Optional arguments:

Turn Lab to XYZ. The colour temperature defaults to D65, but can bespecified withtemp.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_XYZ2Lab ()

intvips_XYZ2Lab (VipsImage *in,VipsImage **out,...);

Optional arguments:

Turn XYZ to Lab, optionally specifying the colour temperature.tempdefaults to D65.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_XYZ2scRGB ()

intvips_XYZ2scRGB (VipsImage *in,VipsImage **out,...);

Turn XYZ to scRGB.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_scRGB2sRGB ()

intvips_scRGB2sRGB (VipsImage *in,VipsImage **out,...);

Optional arguments:

  • depth: depth of output image in bits

Convert an scRGB image to sRGB. Setdepth to 16 to get 16-bit output.

Ifdepth is 16, any extra channels after RGB aremultiplied by 256.

See also:vips_LabS2LabQ(),vips_sRGB2scRGB(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_scRGB2BW ()

intvips_scRGB2BW (VipsImage *in,VipsImage **out,...);

Optional arguments:

  • depth: depth of output image in bits

Convert an scRGB image to greyscale. Setdepth to 16 to get 16-bit output.

Ifdepth is 16, any extra channels after RGB aremultiplied by 256.

See also:vips_LabS2LabQ(),vips_sRGB2scRGB(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_sRGB2scRGB ()

intvips_sRGB2scRGB (VipsImage *in,VipsImage **out,...);

Convert an sRGB image to scRGB. The input image can be 8 or 16-bit.

If the input image is tagged asVIPS_INTERPRETATION_RGB16, any extrachannels after RGB are divided by 256. Thus, scRGB alpha isalways 0 - 255.99.

See also:vips_scRGB2XYZ(),vips_scRGB2sRGB(),vips_rad2float().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_scRGB2XYZ ()

intvips_scRGB2XYZ (VipsImage *in,VipsImage **out,...);

Turn XYZ to scRGB.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_HSV2sRGB ()

intvips_HSV2sRGB (VipsImage *in,VipsImage **out,...);

Convert HSV to sRGB.

HSV is a crude polar coordinate system for RGB images. It is provided forcompatibility with other image processing systems. Seevips_Lab2LCh() for amuch better colour space.

See also:vips_sRGB2HSV().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_sRGB2HSV ()

intvips_sRGB2HSV (VipsImage *in,VipsImage **out,...);

Convert to HSV.

HSV is a crude polar coordinate system for RGB images. It is provided forcompatibility with other image processing systems. Seevips_Lab2LCh() for amuch better colour space.

See also:vips_HSV2sRGB(),vips_Lab2LCh().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_LCh2CMC ()

intvips_LCh2CMC (VipsImage *in,VipsImage **out,...);

Turn LCh to CMC.

The CMC colourspace is described in "Uniform Colour Space Based on theCMC(l:c) Colour-difference Formula", M R Luo and B Rigg, Journal of theSociety of Dyers and Colourists, vol 102, 1986. Distances in thiscolourspace approximate, within 10% or so, differences in the CMC(l:c)colour difference formula.

This operation generates CMC(1:1). For CMC(2:1), halve Lucs and doubleCucs.

See also:vips_CMC2LCh().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_CMC2LCh ()

intvips_CMC2LCh (VipsImage *in,VipsImage **out,...);

Turn LCh to CMC.

See also:vips_LCh2CMC().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_XYZ2Yxy ()

intvips_XYZ2Yxy (VipsImage *in,VipsImage **out,...);

Turn XYZ to Yxy.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_Yxy2XYZ ()

intvips_Yxy2XYZ (VipsImage *in,VipsImage **out,...);

Turn XYZ to Yxy.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_LabS2Lab ()

intvips_LabS2Lab (VipsImage *in,VipsImage **out,...);

Convert a LabS three-band signed short image to a three-band float image.

See also:vips_LabS2Lab().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_Lab2LabS ()

intvips_Lab2LabS (VipsImage *in,VipsImage **out,...);

Turn Lab to LabS, signed 16-bit int fixed point.

See also:vips_LabQ2Lab().

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_CMYK2XYZ ()

intvips_CMYK2XYZ (VipsImage *in,VipsImage **out,...);

Turn CMYK to XYZ. If the image has an embedded ICC profile this will beused for the conversion. If there is no embedded profile, a genericfallback profile will be used.

Conversion is to D65 XYZ with relative intent. If you need more controlover the process, usevips_icc_import() instead.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_XYZ2CMYK ()

intvips_XYZ2CMYK (VipsImage *in,VipsImage **out,...);

Turn XYZ to CMYK.

Conversion is from D65 XYZ with relative intent. If you need more controlover the process, usevips_icc_export() instead.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_profile_load ()

intvips_profile_load (constchar *name,VipsBlob **profile,...);

Load a named profile.

Profiles are loaded from four sources:

  • The special name"none" means no profile.profile will beNULL in thiscase.

  • name can be the name of one of the ICC profiles embedded in libvips.These names can be at least"cmyk","p3" and"srgb".

  • name can be the full path to a file.

  • name can be the name of an ICC profile in the system profile directoryfor your platform.

Parameters

name

name of profile to load

 

profile

loaded profile.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_icc_present ()

intvips_icc_present (void);

VIPS can optionally be built without the ICC library. Use this function totest for its availability.

Returns

non-zero if the ICC library is present.


vips_icc_transform ()

intvips_icc_transform (VipsImage *in,VipsImage **out,constchar *output_profile,...);

Optional arguments:

  • pcs:VipsPCS, use XYZ or LAB PCS

  • intent:VipsIntent, transform with this intent

  • black_point_compensation:gboolean, enable black point compensation

  • embedded:gboolean, use profile embedded in input image

  • input_profile:gchararray, get the input profile from here

  • depth:gint, depth of output image in bits

Transform an image with a pair of ICC profiles. The input image is moved toprofile-connection space with the input profile and then to the outputspace with the output profile.

The input profile is searched for in three places:

  1. Ifembedded is set, libvips will try to use any profile in the inputimage metadata. You can test for the presence of an embedded profilewithvips_image_get_typeof() withVIPS_META_ICC_NAME as an argument.This will returnGType 0 if there is no profile.

  2. Otherwise, ifinput_profile is set, libvips will try to load aprofile from the named file. This can aslso be the name of one of thebuilt-in profiles.

  3. Otherwise, libvips will try to pick a compatible profile from the setof built-in profiles.

Ifblack_point_compensation is set, LCMS black point compensation isenabled.

depth defaults to 8, or 16 ifin is a 16-bit image.

The output image has the output profile attached to theVIPS_META_ICC_NAMEfield.

Usevips_icc_import() andvips_icc_export() to do either the first orsecond half of this operation in isolation.

[method]

Parameters

in

input image

 

out

output image.

[out]

output_profile

get the output profile from here

 

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_icc_import ()

intvips_icc_import (VipsImage *in,VipsImage **out,...);

Optional arguments:

  • pcs:VipsPCS, use XYZ or LAB PCS

  • intent:VipsIntent, transform with this intent

  • black_point_compensation:gboolean, enable black point compensation

  • embedded:gboolean, use profile embedded in input image

  • input_profile:gchararray, get the input profile from here

Import an image from device space to D65 LAB with an ICC profile. Ifpcs isset toVIPS_PCS_XYZ, use CIE XYZ PCS instead.

The input profile is searched for in three places:

  1. Ifembedded is set, libvips will try to use any profile in the inputimage metadata. You can test for the presence of an embedded profilewithvips_image_get_typeof() withVIPS_META_ICC_NAME as an argument.This will returnGType 0 if there is no profile.

  2. Otherwise, ifinput_profile is set, libvips will try to load aprofile from the named file. This can aslso be the name of one of thebuilt-in profiles.

  3. Otherwise, libvips will try to pick a compatible profile from the setof built-in profiles.

Ifblack_point_compensation is set, LCMS black point compensation isenabled.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_icc_export ()

intvips_icc_export (VipsImage *in,VipsImage **out,...);

Optional arguments:

  • pcs:VipsPCS, use XYZ or LAB PCS

  • intent:VipsIntent, transform with this intent

  • black_point_compensation:gboolean, enable black point compensation

  • output_profile:gchararray, get the output profile from here

  • depth:gint, depth of output image in bits

Export an image from D65 LAB to device space with an ICC profile.Ifpcs isset toVIPS_PCS_XYZ, use CIE XYZ PCS instead.Ifoutput_profile is not set, use the embedded profile, if any.Ifoutput_profile is set, export with that and attach it to the outputimage.

Ifblack_point_compensation is set, LCMS black point compensation isenabled.

[method]

Parameters

in

input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error.


vips_icc_ac2rc ()

intvips_icc_ac2rc (VipsImage *in,VipsImage **out,constchar *profile_filename);

Transform an image from absolute to relative colorimetry using theMediaWhitePoint stored in the ICC profile.

See also:vips_icc_transform(),vips_icc_import().

[method]

Parameters

in

input image

 

out

output image.

[out]

profile_filename

use this profile

 

Returns

0 on success, -1 on error.


vips_icc_is_compatible_profile ()

gbooleanvips_icc_is_compatible_profile (VipsImage *image,constvoid *data,size_t data_length);

vips_dE76 ()

intvips_dE76 (VipsImage *left,VipsImage *right,VipsImage **out,...);

Calculate dE 76.

Parameters

left

first input image

 

right

second input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_dE00 ()

intvips_dE00 (VipsImage *left,VipsImage *right,VipsImage **out,...);

Calculate dE 00.

Parameters

left

first input image

 

right

second input image

 

out

output image

 

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_dECMC ()

intvips_dECMC (VipsImage *left,VipsImage *right,VipsImage **out,...);

Calculate dE CMC. The input images are transformed to CMC colour space andthe euclidean distance between corresponding pixels calculated.

To calculate a colour difference with values for (l:c) other than (1:1),transform the two source images to CMC yourself, scale the channelsappropriately, and call this function.

See also:vips_colourspace()

Parameters

left

first input image

 

right

second input image

 

out

output image.

[out]

...

NULL-terminated list of optional named arguments

 

Returns

0 on success, -1 on error


vips_col_Lab2XYZ ()

voidvips_col_Lab2XYZ (float L,float a,float b,float *X,float *Y,float *Z);

Calculate XYZ from Lab, D65.

See also:vips_Lab2XYZ().

Parameters

L

Input CIE Lab value

 

a

Input CIE Lab value

 

b

Input CIE Lab value

 

X

Return CIE XYZ colour.

[out]

Y

Return CIE XYZ colour.

[out]

Z

Return CIE XYZ colour.

[out]

vips_col_XYZ2Lab ()

voidvips_col_XYZ2Lab (float X,float Y,float Z,float *L,float *a,float *b);

Calculate XYZ from Lab, D65.

See also:vips_XYZ2Lab().

Parameters

X

Input CIE XYZ colour

 

Y

Input CIE XYZ colour

 

Z

Input CIE XYZ colour

 

L

Return CIE Lab value.

[out]

a

Return CIE Lab value.

[out]

b

Return CIE Lab value.

[out]

vips_col_ab2h ()

doublevips_col_ab2h (double a,double b);

Parameters

a

CIE a

 

b

CIE b

 

Returns

Hue (degrees)


vips_col_ab2Ch ()

voidvips_col_ab2Ch (float a,float b,float *C,float *h);

vips_col_Ch2ab ()

voidvips_col_Ch2ab (float C,float h,float *a,float *b);

Calculate ab from Ch, h in degrees.

Parameters

C

Chroma

 

h

Hue angle (degrees)

 

a

return CIE a* value

 

b

return CIE b* value

 

vips_col_L2Lcmc ()

floatvips_col_L2Lcmc (float L);

Calculate Lcmc from L.

Parameters

L

CIE L*

 

Returns

Lcmc


vips_col_C2Ccmc ()

floatvips_col_C2Ccmc (float C);

Calculate Ccmc from C.

Parameters

C

Chroma

 

Returns

Ccmc.


vips_col_Ch2hcmc ()

floatvips_col_Ch2hcmc (float C,float h);

Calculate hcmc from C and h.

Parameters

C

Chroma

 

h

Hue (degrees)

 

Returns

hcmc.


vips_col_make_tables_CMC ()

voidvips_col_make_tables_CMC (void);

Make the lookup tables for cmc.


vips_col_Lcmc2L ()

floatvips_col_Lcmc2L (float Lcmc);

Calculate L from Lcmc using a table. Callvips_col_make_tables_CMC() atleast once before using this function.

Parameters

Lcmc

L cmc

 

Returns

L*


vips_col_Ccmc2C ()

floatvips_col_Ccmc2C (float Ccmc);

Calculate C from Ccmc using a table.Callvips_col_make_tables_CMC() atleast once before using this function.

Parameters

Ccmc

Ccmc

 

Returns

C.


vips_col_Chcmc2h ()

floatvips_col_Chcmc2h (float C,float hcmc);

Calculate h from C and hcmc, using a table.Callvips_col_make_tables_CMC() atleast once before using this function.

Parameters

C

Chroma

 

hcmc

Hue cmc (degrees)

 

Returns

h.


vips_col_sRGB2scRGB_8 ()

intvips_col_sRGB2scRGB_8 (int r,int g,int b,float *R,float *G,float *B);

vips_col_sRGB2scRGB_16 ()

intvips_col_sRGB2scRGB_16 (int r,int g,int b,float *R,float *G,float *B);

vips_col_sRGB2scRGB_8_noclip ()

intvips_col_sRGB2scRGB_8_noclip (int r,int g,int b,float *R,float *G,float *B);

vips_col_sRGB2scRGB_16_noclip ()

intvips_col_sRGB2scRGB_16_noclip (int r,int g,int b,float *R,float *G,float *B);

vips_col_scRGB2XYZ ()

intvips_col_scRGB2XYZ (float R,float G,float B,float *X,float *Y,float *Z);

Turn scRGB into XYZ.

See also:vips_scRGB2XYZ().

Parameters

R

Input scRGB value

 

G

Input scRGB value

 

B

Input scRGB value

 

X

Return XYZ colour.

[out]

Y

Return XYZ colour.

[out]

Z

Return XYZ colour.

[out]

vips_col_XYZ2scRGB ()

intvips_col_XYZ2scRGB (float X,float Y,float Z,float *R,float *G,float *B);

Turn XYZ into scRGB.

See also:vips_XYZ2scRGB().

Parameters

X

Input XYZ value

 

Y

Input XYZ value

 

Z

Input XYZ value

 

R

Return scRGB colour.

[out]

G

Return scRGB colour.

[out]

B

Return scRGB colour.

[out]

vips_col_scRGB2sRGB_8 ()

intvips_col_scRGB2sRGB_8 (float R,float G,float B,int *r,int *g,int *b,int *og);

vips_col_scRGB2sRGB_16 ()

intvips_col_scRGB2sRGB_16 (float R,float G,float B,int *r,int *g,int *b,int *og);

vips_col_scRGB2BW_16 ()

intvips_col_scRGB2BW_16 (float R,float G,float B,int *g,int *og);

vips_col_scRGB2BW_8 ()

intvips_col_scRGB2BW_8 (float R,float G,float B,int *g,int *og);

vips_pythagoras ()

floatvips_pythagoras (float L1,float a1,float b1,float L2,float a2,float b2);

Pythagorean distance between two points in colour space. Lab/XYZ/CMC etc.

Parameters

L1

Input coordinate 1

 

a1

Input coordinate 1

 

b1

Input coordinate 1

 

L2

Input coordinate 2

 

a2

Input coordinate 2

 

b2

Input coordinate 2

 

vips_col_dE00 ()

floatvips_col_dE00 (float L1,float a1,float b1,float L2,float a2,float b2);

CIEDE2000, from:

Luo, Cui, Rigg, "The Development of the CIE 2000 Colour-DifferenceFormula: CIEDE2000", COLOR research and application, pp 340

Parameters

L1

Input coordinate 1

 

a1

Input coordinate 1

 

b1

Input coordinate 1

 

L2

Input coordinate 2

 

a2

Input coordinate 2

 

b2

Input coordinate 2

 

Returns

CIE dE2000 colour difference.

Types and Values

VIPS_D93_X0

#define VIPS_D93_X0 (89.7400)

Areas under curves for D93, 2 degree observer.


VIPS_D93_Y0

#define VIPS_D93_Y0 (100.0)

VIPS_D93_Z0

#define VIPS_D93_Z0 (130.7700)

VIPS_D75_X0

#define VIPS_D75_X0 (94.9682)

Areas under curves for D75, 2 degree observer.


VIPS_D75_Y0

#define VIPS_D75_Y0 (100.0)

VIPS_D75_Z0

#define VIPS_D75_Z0 (122.5710)

VIPS_D65_X0

#define VIPS_D65_X0 (95.0470)

Areas under curves for D65, 2 degree observer.


VIPS_D65_Y0

#define VIPS_D65_Y0 (100.0)

VIPS_D65_Z0

#define VIPS_D65_Z0 (108.8827)

VIPS_D55_X0

#define VIPS_D55_X0 (95.6831)

Areas under curves for D55, 2 degree observer.


VIPS_D55_Y0

#define VIPS_D55_Y0 (100.0)

VIPS_D55_Z0

#define VIPS_D55_Z0 (92.0871)

VIPS_D50_X0

#define VIPS_D50_X0 (96.4250)

Areas under curves for D50, 2 degree observer.


VIPS_D50_Y0

#define VIPS_D50_Y0 (100.0)

VIPS_D50_Z0

#define VIPS_D50_Z0 (82.4680)

VIPS_A_X0

#define VIPS_A_X0 (109.8503)

Areas under curves for illuminant A (2856K), 2 degree observer.


VIPS_A_Y0

#define VIPS_A_Y0 (100.0)

VIPS_A_Z0

#define VIPS_A_Z0 (35.5849)

VIPS_B_X0

#define VIPS_B_X0 (99.0720)

Areas under curves for illuminant B (4874K), 2 degree observer.


VIPS_B_Y0

#define VIPS_B_Y0 (100.0)

VIPS_B_Z0

#define VIPS_B_Z0 (85.2230)

VIPS_C_X0

#define VIPS_C_X0 (98.0700)

Areas under curves for illuminant C (6774K), 2 degree observer.


VIPS_C_Y0

#define VIPS_C_Y0 (100.0)

VIPS_C_Z0

#define VIPS_C_Z0 (118.2300)

VIPS_E_X0

#define VIPS_E_X0 (100.0)

Areas under curves for equal energy illuminant E.


VIPS_E_Y0

#define VIPS_E_Y0 (100.0)

VIPS_E_Z0

#define VIPS_E_Z0 (100.0)

VIPS_D3250_X0

#define VIPS_D3250_X0 (105.6590)

Areas under curves for black body at 3250K, 2 degree observer.


VIPS_D3250_Y0

#define VIPS_D3250_Y0 (100.0)

VIPS_D3250_Z0

#define VIPS_D3250_Z0 (45.8501)

enum VipsIntent

The rendering intent.VIPS_INTENT_ABSOLUTE is best forscientific work,VIPS_INTENT_RELATIVE is usually best foraccurate communication with other imaging libraries.

Members

VIPS_INTENT_PERCEPTUAL

perceptual rendering intent

 

VIPS_INTENT_RELATIVE

relative colorimetric rendering intent

 

VIPS_INTENT_SATURATION

saturation rendering intent

 

VIPS_INTENT_ABSOLUTE

absolute colorimetric rendering intent

 

VIPS_INTENT_LAST

  

enum VipsPCS

Pick a Profile Connection Space forvips_icc_import() andvips_icc_export(). LAB is usually best, XYZ can be more convenient in somecases.

Members

VIPS_PCS_LAB

use CIELAB D65 as the Profile Connection Space

 

VIPS_PCS_XYZ

use XYZ as the Profile Connection Space

 

VIPS_PCS_LAST

  

See Also

arithmetic

Generated by GTK-Doc V1.34.0

[8]ページ先頭

©2009-2025 Movatter.jp