Color transformation

更新时间:
复制 MD 格式

This feature automatically transforms the colors of an input image based on a specified color palette. This process prevents undesirable color artifacts in visual hot spots.

Introduction

  • Name: Color Migration/Recolor

  • Action: RecolorImage

This feature automatically transforms the colors of an input image based on a specified color palette. This process prevents undesirable color artifacts in visual hot spots.

Example result:

Parameter definitions

Input: An image. Output: The recolored image.

Input fields:

Field

Type

Required

Description

url

string

Yes

URL of the resized image

mode

string

Yes

The recoloring pattern. Default: AUTO. Valid values: AUTO for automatic recoloring, TEMPLATE for color palette recoloring, and REF_PIC for reference image recoloring.

colorTemplate

List<String>

No

For color palette recoloring. A list of top primary colors. The color value is defined in ARGB format, such as `0A0B0C`. The array size must be between 1 and 7.

refUrl

string

No

For reference image recoloring. The URL of the reference image.

colorCount

int

No

The number of expanded color palettes. The value must be between 1 and 8. Default: 1.

Note

Use only one of the `colorTemplate`, `refUrl`, or `colorCount` parameters, depending on the selected `mode`.

Output fields:

Field

Type

Required

Description

imageList

List<string>

Yes

The outpainted image URL

Examples

Input

Automatic recoloring:
{
  "url": "http://ivpd-demo.oss-cn-shanghai.aliyuncs.com/ivpd-****/images/RecolorImage/re****-1-src.png",
  "mode": "AUTO",
  "colorCount": 3
}

Reference image recoloring:
{
  "url": "http://ivpd-demo.oss-cn-shanghai.aliyuncs.com/ivpd-****/images/RecolorImage/rec****-1-src.png",
  "refUrl": "http://ivpd-demo.oss-cn-shanghai.aliyuncs.com/ivpd-****/images/RecolorImage/recolor-refurl-src.png",
  "mode": "REF_PIC"
}

Color palette recoloring
{
  "url": "http://ivpd-demo.oss-cn-shanghai.aliyuncs.com/ivpd-****/images/RecolorImage/rec****-2-src.png",
  "colorTemplate": [ 
    { "color": "056A6B"}, 
    { "color": "FF0000"}, 
    { "color": "00FF00"}, 
    { "color": "0000FF"}
  ],
  "mode": "TEMPLATE"
}

Output:

Automatic recoloring
{
    "imageList":[
        "http://vigen-invi-cdn.alibaba.com/aliyun****/pop/images/recolor-1-src.png"
    ]
}

Reference image recoloring
 {
    "imageList":[
        "http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_filter/2019-9-27/****_filter_01569552501988103****_nHdEYO.png?Expires=1569638902&Signature=zGHmW0fH9Q24fA9402qi1uJ7y1****"
    ]
}

Color palette recoloring
{
    "imageList":[
        "http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_filter/2019-9-27/****_filter_01569552503075103****_q1003K.png?Expires=1569638903&Signature=AOJj%2F%2ByjLsyerUJ5nO3VrkrDnL****"
    ]
}