# Image Anonymization in Esri ArcGIS Online

### Introduction

This tutorial will guide you through the process of anonymizing personal information in your images stored in ArcGIS Online. We'll use a [Jupyter Notebook](https://github.com/celantur/celantur-arcgis-tools/tree/main/jupyter-notebook) to connect ArcGIS Online with the [Celantur Cloud API](/cloud-api/getting-started.md).

The Notebook will fetch the original image attachments which have not been anonymized yet, send them to Celantur Cloud API for anonymization, and save the anonymized images back to ArcGIS Online.

<figure><img src="/files/3YTiGNP2pJfrlC4AtVTN" alt=""><figcaption><p>Architecture of Celantur Cloud API and ArcGIS Online integration</p></figcaption></figure>

### Prerequisites

Before you begin, ensure you have the following:

* [ ] An Esri ArcGIS Online account with access to the Notebook service
* [ ] A Celantur account (app.celantur.com)
* [ ] Basic understanding of Python

### Steps

#### 1. Log in to ArcGIS Online

Log in to your ArcGIS Online account.

#### 2. Prepare Feature Layer in ArcGIS Online

1. On the ArcGIS page <https://celantur.maps.arcgis.com/home/content.html> click to `New Item` button and proceed with creation of `Feature Layer`.
2. Then open that new Item, and open `Data` tab and select `Fields` sub-tab
3. Click to `Add` button (only if this field does not yet exist)
   * `Field Name`: `is_anonymized`
   * `Display Name`: `Is anonymized`
   * `Type`: `integer`
   * `Default Value`: `0`
   * Click `Add New Field`

#### 3. Add Images

Add images as attachment to points via e.g. Field Maps app. Make sure the same Feature Service Layer is specified in the Notebook code.

#### 4. Add the Notebook

1. In ArcGIS online, create a new Notebook.&#x20;
2. Insert the Notebook content from <https://github.com/celantur/arcgis-jupyter-dev> into your newly created Notebook.

#### 5. Configure the Notebook

1. In the section of `! CREDENTIALS !` specify your credentials accordingly
2. Go to section `Main`
   * Adjust `layer_id` uid value to the corresponding layer you want to use.
   * Adjust params to your taste, see <https://doc.celantur.com/cloud-api/api-endpoints#create-anonymization-task>
3. Create directory `/arcgis/home/downloads`
4. Run the Notebook

#### 6. Check Anonymized Images

Verify that the personal information in your images has been successfully anonymized.

#### 7. Schedule the Notebook (optional)

Schedule the Notebook to be executed regularly.

{% hint style="warning" %}
Limitations:

The current Notebook code will process **all images** where `is_anonymized` equals `false`. Please consider the impact of the amount of images on the Notebook runtime.
{% endhint %}

### Conclusion

Congratulations! 🎉 You have successfully anonymized images in Esri ArcGIS Online using the provided Jupyter Notebook and Celantur Cloud API. Feel free to explore the code and customize it for your specific use case.

If you encounter any issues or have suggestions for improvement, please address your contact person at Celantur.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.celantur.com/tutorials/image-anonymization-in-esri-arcgis-online.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
