# Image to Ndarray (DP\_ITN)

This function converts an image from a URL to a JSON array

## Sample Request

```javascript
{
    "block_id": 9,
    "project_id": 229,
    "parent_id": 8,
    "function_code": "DP_ITN",
    "args": {
        "image_url": "https://consolidatedlabel.com/app/uploads/2007/10/high-res-300dpi.jpg",
        "target_size": [28,28],
        "rescale": true
    }
}
```

## Parameter Details

## Image to Ndarray

<mark style="color:green;">`POST`</mark> `https://autogon.ai/api/v1/engine/start`

#### Request Body

| Name                                             | Type    | Description                                                                                           |
| ------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int     | current project ID                                                                                    |
| parent\_id<mark style="color:red;">\*</mark>     | int     | parent block ID                                                                                       |
| block\_id<mark style="color:red;">\*</mark>      | int     | current block ID                                                                                      |
| function\_code<mark style="color:red;">\*</mark> | String  | block's function code                                                                                 |
| args<mark style="color:red;">\*</mark>           | object  | block arguments                                                                                       |
| target\_size<mark style="color:red;">\*</mark>   | array   | The target size of the image array                                                                    |
| image\_url<mark style="color:red;">\*</mark>     | String  | Path to uploaded image                                                                                |
| rescale                                          | boolean | <p>specifies wether the image array should be scaled between 0-1</p><p>Default: <code>true</code></p> |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
projectId = 1
parentId = 6
blockId = 7

client.array_reshaping(projectId, parentId, blockId, {

```

{% endtab %}
{% endtabs %}
