Property

new RevieveAR(userConf, userImage[, containerId])

RevieveAR class. The core of the Revieve AR SDK. This should be instantiated for each image you want to manipulate.

Parameters

Name Type Optional Description

userConf

Object

 

Configuration for the instance

Values in userConf have the following properties:

Name Type Optional Description

partnerID

String

 

PartnerID assigned to your organization by Revieve

skintone

String

Yes

User skintone in scale of 1-6 (fitzpatrick scale). Necessary for correct eye color and undertone calculations.

userImage

Object

 

Image to manipulate. This parameter could be a base64 representation of the image or a file HTML object

containerId

Object

Yes

Container's id where the results will be rendered. If you don't specify any container, you can use the method getResults to get the resulting div. If containerId is specified, results will be applied automatically to the container.

Property

static

masks

List of possible areas where an effect could be applied.

Methods

applyBlush(strength, color) → Promise

Apply blush in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

color

String

 

rgb, hex or name of the blush's color you want to be applied.

See also
getResults
Returns

Promise 

applyFoundation(strength) → Promise

Apply foundation in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor. returned by getResults

Parameter

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

See also
getResults
Returns

Promise 

applyLipstick(strength, color) → Promise

Apply lipstick in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

color

String

 

rgb, hex or name of the lipstick's color you want to be applied.

See also
getResults
Returns

Promise 

brightenSkin(strength, masks) → Promise

Brighten the skin in the user image areas defined in masks parameter. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

masks

Array of String

 

Array of RevieveAR.masks defining the areas where the effect is going to be applied.

See also
getResults
Returns

Promise 

getImageBefore() → Object

Get the original image ("before image") back.

Returns

Object BeforeImage

getResults() → HTMLDivElement

See the results of the manipulations.

Returns

HTMLDivElement After image - Div containing original image with added manipulations

getStatus() → Array of Object

Use this method to check warnings and errors in image analysis.

Returns

Array of Object JSON object with description, idx, and isError boolean.

hasError() → Boolean

Use this method to check if there were errors in image analysis.

Returns

Boolean Error

initialize() → Promise

Use this method to initialize the API. You must call this method before apply any effect.

Returns

Promise 

reduceCrowsFeet(strength) → Promise

Reduce crows feet in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameter

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

See also
getResults
Returns

Promise 

reduceDarkcircles(strength) → Promise

Reduce dark circles in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameter

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

See also
getResults
Returns

Promise 

reduceEyebags(strength) → Promise

Reduce eyebags in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameter

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

See also
getResults
Returns

Promise 

reduceRedness(strength, masks) → Promise

Reduce redness in the user image areas defined in masks parameter. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

masks

Array of String

 

Array of RevieveAR.masks defining the areas where the effect is going to be applied.

See also
getResults
Returns

Promise 

reduceWrinkles(strength, masks) → Promise

Reduce wrinkles in the user image areas defined in masks parameter. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

strength

Float

 

Strength of the reduction effect.

masks

Array of String

 

Array of RevieveAR.masks defining the areas where the effect is going to be applied.

See also
getResults
Returns

Promise 

reset()

Method to reset results and delete all the effects applied before.

setEffectByName(effectName, masks, strength[, fillColor]) → Promise

Please don't use this method directly. You have the general effect methods to work with them. Set an effect determined by parameter effect name in the user image. Resulting effects will be applied to div containing the image returned by getResults or to the container specified in constructor.

Parameters

Name Type Optional Description

effectName

String

 

Name of the effect to be applied.

masks

Array of String

 

Array of RevieveAR.masks defining the areas where the effect is going to be applied.

strength

Float

 

Strength of the reduction effect.

fillColor

String

Yes

Rgb, hex or name of the blush's color you want to be applied.

See also
getResults
Returns

Promise 

testImages()

Test method that add to the root of the HTML document two objects: the original image and the resulting div with all the effects applied