In this request the image is processed with two methods: ‘desaturation’ and ‘caricature’. We also generate one thumbnail image of 100 px on the longest side.

Request:
<image_process_call>
    <image_url>http://developers.pho.to/img/girl.jpg</image_url>
    <methods_list>
        <method order="1">
            <name>desaturation</name>
        </method>
        <method order="2">
            <name>caricature</name>
            <params>type=1;crop_portrait=true</params>
        </method>
    </methods_list>
    <thumb1_size>100</thumb1_size>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>InProgress</status>
    <description>DESCRIPTION</description>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
    <result_url>URL1</result_url>
    <thumb1_url>URL2</thumb1_url>
</image_process_response>
  • Before

  • After


Here is an example of an incorrect add task request. It contains a wrong method name - ‘desat’ instead of ‘desaturation’.

Request:
<image_process_call>
    <image_url>http://developers.pho.to/img/girl.jpg</image_url>
    <methods_list>
        <method order=”1”>
            <name>desat</name>
        </method>
    </methods_list>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>Error</status>
    <err_code>-3</err_code>
    <description>ERROR_DESCRIPTION</description>
</image_process_response>

A sequence of requests. The resulting image of the first processing becomes the source image for the second processing.

Request 1:
<image_process_call>
    <image_url>http://developers.pho.to/img/girl.jpg</image_url>
    <methods_list>
        <method order="1">
            <name>desaturation</name>
        </method>
    </methods_list>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
    <result_url>URL1</result_url>
</image_process_response>
Request 2:
<image_process_call>
    <image_url>URL1</image_url>
    <methods_list>
        <method order=”1”>
            <name>caricature</name>
            <params>type=1;crop_portrait=true</params>
        </method>
    </methods_list>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description>DESCRIPTION</description>
    <err_code>0</err_code>
    <result_url>URL2</result_url>
</image_process_response>
  • Before

  • After


In this request a woman's portrait is processed with the 'makeup' method. Method parameters are set to heal the skin, whiten the teeth, outline the eyes, remove skin glare and wrinkles and not to fix red-eye effect.

Request:
<image_process_call>
    <image_url>http://developers.pho.to/img/woman.png</image_url>
    <methods_list>
        <method>
            <name>makeup</name>
            <params>
                use_skin_healing=true;use_eyes_enhancement=true;use_teeth_whitening=true;use_portrait_filters=true;use_flash_healing=true;use_wrinkles_healing=true;use_auto_red_eye=false
            </params>
        </method>
    </methods_list>
    <lang>en</lang>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description/>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>InProgress</status>
    <description>DESCRIPTION</description>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <result_url>URL1</result_url>
</image_process_response>
  • Before

  • After


In this request a boy's portrait is processed with the 'caricature' method (morphing type 6 - winking with one eye).

Request:
<image_process_call>
    <image_url>http://developers.pho.to/img/boy.jpg</image_url>
    <methods_list>
        <method>
            <name>caricature</name>
            <params>type=6</params>
        </method>
    </methods_list>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description/>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>InProgress</status>
    <description>DESCRIPTION</description>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <result_url>URL1</result_url>
</image_process_response>
  • Before

  • After


In this request a boy's portrait is processed with the 'caricature' method (morphing type 6 - winking with one eye), with the 'cartoon' parameter set to 'true' (converts photo to cartoon).

Request:
<image_process_call>
    <image_url>http://developers.pho.to/img/boy.jpg</image_url>
    <methods_list>
        <method>
            <name>caricature</name>
            <params>type=6;cartoon=true</params>
        </method>
    </methods_list>
</image_process_call>
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <description/>
    <err_code>0</err_code>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>InProgress</status>
    <description>DESCRIPTION</description>
</image_process_response>
Get Request:
http://opeapi.ws.pho.to/getresult?request_id=:REQUEST_ID
Response:
<image_process_response>
    <request_id>REQUEST_ID</request_id>
    <status>OK</status>
    <result_url>URL1</result_url>
</image_process_response>
  • Before

  • After