{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c71b7240-c3f2-4a3e-9e67-ad163f3f4305",
   "metadata": {},
   "source": [
    "## Generate the pipeline without a describing the steps in the config file"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fd299860-18e4-402a-b36f-bfd6a2aee946",
   "metadata": {},
   "source": [
    "This is an example on how to generate a pipeline without creating and describing the steps on the configuration file."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d0d88df2-a9a1-4444-bed0-11bba7f4c3c3",
   "metadata": {},
   "source": [
    "## Import dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "908dd731-e15e-4b30-a4bf-ea1b9b3158ee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The autoreload extension is already loaded. To reload it, use:\n",
      "  %reload_ext autoreload\n"
     ]
    }
   ],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "from paidiverpy.colour_layer import ColourLayer\n",
    "from paidiverpy.open_layer import OpenLayer\n",
    "from paidiverpy.pipeline import Pipeline"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "197687bf-078b-4db1-a92f-45e2c13c2dcb",
   "metadata": {},
   "source": [
    "## Creating steps by hand"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b589e509-a6f2-420f-bf41-55b8cbe7f71a",
   "metadata": {},
   "source": [
    "Create the steps by hand, without adding then to a configuration file"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "46f413c1-b9a5-4dc1-a27d-9cba7f9c745c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# creating the steps by hand\n",
    "open_layer_params = {\n",
    "    \"convert\": [\n",
    "        {\n",
    "            \"mode\": \"bits\",\n",
    "            \"params\": {\n",
    "                \"output_bits\": 8,\n",
    "            },\n",
    "        },\n",
    "    ],\n",
    "    \"sampling\": [{\"mode\": \"percent\", \"params\": {\"value\": 0.3}}],\n",
    "}\n",
    "pipeline_steps = [(\"raw\", OpenLayer, open_layer_params)]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f7e2f5d3-8cfc-4b60-85f6-c2c0f591501b",
   "metadata": {},
   "source": [
    "Now, you can instantiate the Pipeline class. You still need to pass a simple configuration file with information about input and output path of the data and of the metadata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "0cd55684-3eaf-41d4-a521-5861906f6229",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.pipeline.pipeline.Pipeline object at 0x713f031bdf60&gt;</pre><div>\n",
       "    <div class=\"ppy-pipeline-wrap\">\n",
       "        \n",
       "    <div id=\"ppy-pipeline-rhd-general\" title=\"Click to see more information\"\n",
       "        class=\"ppy-pipeline ppy-pipeline-rhd\"\n",
       "        onclick=\"showParameters('general', 'rhd')\">\n",
       "        <h2 class=\"ppy-h2\">Raw</h2>\n",
       "        <h3 class=\"ppy-h3\">Type: Raw</h2>\n",
       "    </div>\n",
       "    \n",
       "    </div>\n",
       "    <div id=\"ppy-pipeline-parameters\" class=\"ppy-pipeline-parameters-all\">\n",
       "        <div id=\"ppy-pipeline-parameters-rhd-general\" class=\"ppy-pipeline-parameters ppy-pipeline-parameters-rhd\"\n",
       "            style=\"display: none;\">\n",
       "            <h4 class=\"ppy-h4\">Parameters:</h4>\n",
       "            <pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">sample_data</span>: <span class=\"ppy-json-string\">\"benthic_csv\"</span>\n",
       "<span class=\"ppy-json-key\">input_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/images\"</span>\n",
       "<span class=\"ppy-json-key\">output_path</span>: <span class=\"ppy-json-string\">\"output\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_type</span>: <span class=\"ppy-json-string\">\"CSV_FILE\"</span>\n",
       "<span class=\"ppy-json-key\">image_open_args</span>: <span class=\"ppy-json-string\">\"PNG\"</span>\n",
       "<span class=\"ppy-json-key\">append_data_to_metadata</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">n_jobs</span>: <span class=\"ppy-json-number\">1</span>\n",
       "<span class=\"ppy-json-key\">track_changes</span>: <span class=\"ppy-json-number\">True</span>\n",
       "<span class=\"ppy-json-key\">rename</span>: <span class=\"ppy-json-string\">\"datetime\"</span>\n",
       "<span class=\"ppy-json-key\">sampling</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">value</span>: <span class=\"ppy-json-number\">0.3</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"percent\"</span>\n",
       "<span class=\"ppy-json-key\">convert</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">output_bits</span>: <span class=\"ppy-json-number\">8</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"bits\"</span></pre>\n",
       "        </div>\n",
       "    </div>\n",
       "    </div></div>"
      ],
      "text/plain": [
       "<paidiverpy.pipeline.pipeline.Pipeline at 0x713f031bdf60>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Instantiate the pipeline class and see the step described in the pipeline_steps variable\n",
    "pipeline = Pipeline(\n",
    "    config_file_path=\"../config_files/config_simple.yml\",\n",
    "    steps=pipeline_steps,\n",
    ")\n",
    "pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "07911eb2-c8b4-4e5d-b646-81ed8f71152e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:36 | Processing images using 1 cores\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Processing images using 1 cores\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:36 | Running step 0: raw - OpenLayer\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Running step 0: raw - OpenLayer\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:37 | Step 0 completed\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Step 0 completed\n"
     ]
    }
   ],
   "source": [
    "# Run your pipeline\n",
    "pipeline.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "0306f127-5485-4bb2-88b1-7a64db9e2f8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.images_layer.ImagesLayer object at 0x713f031bdea0&gt;</pre><div>\n",
       "            <div class='ppy-h2 ppy-images-step-header' onclick='toggleMetadata(0, \"mau\")'>\n",
       "                Step 0: raw\n",
       "                <span id='ppy-images-arrow-mau-0'\n",
       "                    class='ppy-images-toggle-arrow ppy-font-color-brown'>▼\n",
       "                </span>\n",
       "            </div>\n",
       "            <div id='ppy-images-metadata-mau-0' class='ppy-images-metadata' style='display:block;'><div class='ppy-images'>\n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-0\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:14:31\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-0' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-0'\n",
       "                src='data:image/png;base64,[encoded data, 30992 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-1\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:01\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-1' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-1'\n",
       "                src='data:image/png;base64,[encoded data, 29720 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-2\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:11\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-2' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-2'\n",
       "                src='data:image/png;base64,[encoded data, 29300 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-3\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:16:11\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-3' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-3'\n",
       "                src='data:image/png;base64,[encoded data, 30888 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-4\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:16:21\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-4' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-4'\n",
       "                src='data:image/png;base64,[encoded data, 30908 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-5\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:16:31\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-5' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-5'\n",
       "                src='data:image/png;base64,[encoded data, 30844 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-6\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:17:51\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-6' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-6'\n",
       "                src='data:image/png;base64,[encoded data, 38584 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-7\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:18:11\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-7' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-7'\n",
       "                src='data:image/png;base64,[encoded data, 34804 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-8\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:18:31\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-8' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-8'\n",
       "                src='data:image/png;base64,[encoded data, 33664 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-9\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:19:11\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-9' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-9'\n",
       "                src='data:image/png;base64,[encoded data, 39244 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-10\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:19:31\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-10' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-10'\n",
       "                src='data:image/png;base64,[encoded data, 39084 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-mau-0-11\", \"mau\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:19:51\n",
       "                <span id='ppy-images-arrow-mau-image-mau-0-11' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-mau-0-11'\n",
       "                src='data:image/png;base64,[encoded data, 38488 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            </div></div></div></div>"
      ],
      "text/plain": [
       "<paidiverpy.images_layer.ImagesLayer at 0x713f031bdea0>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# see the outputs\n",
    "pipeline.images"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18ee7750-66a8-4fcb-8815-bac10f37b1a3",
   "metadata": {},
   "source": [
    "## Create a new pipeline with one more step"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "66f8cd9c-551f-49ab-99f7-9bbd96036f92",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create a new pipeline with one more step\n",
    "open_layer_params = {\n",
    "    \"convert\": [\n",
    "        {\n",
    "            \"mode\": \"bits\",\n",
    "            \"params\": {\n",
    "                \"output_bits\": 8,\n",
    "            },\n",
    "        },\n",
    "    ],\n",
    "    \"sampling\": [{\"mode\": \"percent\", \"params\": {\"value\": 0.1}}],\n",
    "}\n",
    "pipeline_steps = [\n",
    "    (\"raw\", OpenLayer, open_layer_params),\n",
    "    (\"gray\", ColourLayer, {\"mode\": \"grayscale\"}),\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c08c1877-4107-4070-bc9b-98f62b8667a8",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('raw',\n",
       "  paidiverpy.open_layer.open_layer.OpenLayer,\n",
       "  {'convert': [{'mode': 'bits', 'params': {'output_bits': 8}}],\n",
       "   'sampling': [{'mode': 'percent', 'params': {'value': 0.1}}],\n",
       "   'name': 'raw',\n",
       "   'step_name': 'raw'}),\n",
       " ('gray',\n",
       "  paidiverpy.colour_layer.colour_layer.ColourLayer,\n",
       "  {'mode': 'grayscale', 'name': 'gray', 'step_name': 'colour'})]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Instantiate the pipeline class and see the step described in the pipeline_steps variable\n",
    "pipeline = Pipeline(\n",
    "    config_file_path=\"../config_files/config_simple.yml\",\n",
    "    steps=pipeline_steps,\n",
    ")\n",
    "pipeline.steps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "b9fb7fcb-755f-42e2-8dec-5308d7dd06b1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.pipeline.pipeline.Pipeline object at 0x713f0304fd60&gt;</pre><div>\n",
       "    <div class=\"ppy-pipeline-wrap\">\n",
       "        \n",
       "    <div id=\"ppy-pipeline-sup-general\" title=\"Click to see more information\"\n",
       "        class=\"ppy-pipeline ppy-pipeline-sup\"\n",
       "        onclick=\"showParameters('general', 'sup')\">\n",
       "        <h2 class=\"ppy-h2\">Raw</h2>\n",
       "        <h3 class=\"ppy-h3\">Type: Raw</h2>\n",
       "    </div>\n",
       "    <div class=\"ppy-pipeline-arrow\"><svg class='icon ppy-arrow-right'><use xlink:href='#arrow-right'></use></svg></div>\n",
       "            <div id=\"ppy-pipeline-sup-step-0\" title=\"Click to see more information\"\n",
       "                class=\"ppy-pipeline ppy-pipeline-sup\" onclick=\"showParameters('step-0', 'sup')\">\n",
       "                <h2 class=\"ppy-h2\">Gray</h2>\n",
       "                <h3 class=\"ppy-h3\">Type: Colour</h2>\n",
       "            </div>\n",
       "        \n",
       "    </div>\n",
       "    <div id=\"ppy-pipeline-parameters\" class=\"ppy-pipeline-parameters-all\">\n",
       "            <div id=\"ppy-pipeline-parameters-sup-step-0\"\n",
       "                class=\"ppy-pipeline-parameters ppy-pipeline-parameters-sup\"\n",
       "                style=\"display: none;\">\n",
       "                <h4 class=\"ppy-h4\">Parameters:</h4>\n",
       "                <pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"gray\"</span>\n",
       "<span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"colour\"</span>\n",
       "<span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "<span class=\"ppy-json-key\">params</span>:\n",
       "  <span class=\"ppy-json-key\">method</span>: <span class=\"ppy-json-string\">\"opencv\"</span>\n",
       "  <span class=\"ppy-json-key\">invert_colours</span>: <span class=\"ppy-json-number\">False</span>\n",
       "  <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "<span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"grayscale\"</span></pre>\n",
       "            </div>\n",
       "        \n",
       "        <div id=\"ppy-pipeline-parameters-sup-general\" class=\"ppy-pipeline-parameters ppy-pipeline-parameters-sup\"\n",
       "            style=\"display: none;\">\n",
       "            <h4 class=\"ppy-h4\">Parameters:</h4>\n",
       "            <pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">sample_data</span>: <span class=\"ppy-json-string\">\"benthic_csv\"</span>\n",
       "<span class=\"ppy-json-key\">input_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/images\"</span>\n",
       "<span class=\"ppy-json-key\">output_path</span>: <span class=\"ppy-json-string\">\"output\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_type</span>: <span class=\"ppy-json-string\">\"CSV_FILE\"</span>\n",
       "<span class=\"ppy-json-key\">image_open_args</span>: <span class=\"ppy-json-string\">\"PNG\"</span>\n",
       "<span class=\"ppy-json-key\">append_data_to_metadata</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">n_jobs</span>: <span class=\"ppy-json-number\">1</span>\n",
       "<span class=\"ppy-json-key\">track_changes</span>: <span class=\"ppy-json-number\">True</span>\n",
       "<span class=\"ppy-json-key\">rename</span>: <span class=\"ppy-json-string\">\"datetime\"</span>\n",
       "<span class=\"ppy-json-key\">sampling</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">value</span>: <span class=\"ppy-json-number\">0.1</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"percent\"</span>\n",
       "<span class=\"ppy-json-key\">convert</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">output_bits</span>: <span class=\"ppy-json-number\">8</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"bits\"</span></pre>\n",
       "        </div>\n",
       "    </div>\n",
       "    </div></div>"
      ],
      "text/plain": [
       "<paidiverpy.pipeline.pipeline.Pipeline at 0x713f0304fd60>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# See the pipeline\n",
    "pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "c4a91011-8ce3-439f-8db0-a81c2faf7bee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>{\n",
       "    &quot;general&quot;: {\n",
       "        &quot;name&quot;: &quot;raw&quot;,\n",
       "        &quot;step_name&quot;: &quot;raw&quot;,\n",
       "        &quot;sample_data&quot;: &quot;benthic_csv&quot;,\n",
       "        &quot;input_path&quot;: &quot;/home/tobfer/.paidiverpy_cache/benthic_csv/images&quot;,\n",
       "        &quot;output_path&quot;: &quot;output&quot;,\n",
       "        &quot;metadata_path&quot;: &quot;/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv&quot;,\n",
       "        &quot;metadata_type&quot;: &quot;CSV_FILE&quot;,\n",
       "        &quot;image_open_args&quot;: &quot;PNG&quot;,\n",
       "        &quot;append_data_to_metadata&quot;: &quot;/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv&quot;,\n",
       "        &quot;n_jobs&quot;: 1,\n",
       "        &quot;track_changes&quot;: true,\n",
       "        &quot;rename&quot;: &quot;datetime&quot;,\n",
       "        &quot;sampling&quot;: [\n",
       "            {\n",
       "                &quot;name&quot;: &quot;sampling&quot;,\n",
       "                &quot;step_name&quot;: &quot;sampling&quot;,\n",
       "                &quot;test&quot;: false,\n",
       "                &quot;params&quot;: {\n",
       "                    &quot;value&quot;: 0.1,\n",
       "                    &quot;raise_error&quot;: false\n",
       "                },\n",
       "                &quot;mode&quot;: &quot;percent&quot;\n",
       "            }\n",
       "        ],\n",
       "        &quot;convert&quot;: [\n",
       "            {\n",
       "                &quot;name&quot;: &quot;convert&quot;,\n",
       "                &quot;step_name&quot;: &quot;convert&quot;,\n",
       "                &quot;test&quot;: false,\n",
       "                &quot;params&quot;: {\n",
       "                    &quot;output_bits&quot;: 8,\n",
       "                    &quot;raise_error&quot;: false\n",
       "                },\n",
       "                &quot;mode&quot;: &quot;bits&quot;\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    &quot;steps&quot;: [\n",
       "        {\n",
       "            &quot;name&quot;: &quot;gray&quot;,\n",
       "            &quot;step_name&quot;: &quot;colour&quot;,\n",
       "            &quot;test&quot;: false,\n",
       "            &quot;params&quot;: {\n",
       "                &quot;method&quot;: &quot;opencv&quot;,\n",
       "                &quot;invert_colours&quot;: false,\n",
       "                &quot;raise_error&quot;: false\n",
       "            },\n",
       "            &quot;mode&quot;: &quot;grayscale&quot;\n",
       "        }\n",
       "    ]\n",
       "}</pre><div><pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">general</span>:\n",
       "  <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "  <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "  <span class=\"ppy-json-key\">sample_data</span>: <span class=\"ppy-json-string\">\"benthic_csv\"</span>\n",
       "  <span class=\"ppy-json-key\">input_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/images\"</span>\n",
       "  <span class=\"ppy-json-key\">output_path</span>: <span class=\"ppy-json-string\">\"output\"</span>\n",
       "  <span class=\"ppy-json-key\">metadata_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv\"</span>\n",
       "  <span class=\"ppy-json-key\">metadata_type</span>: <span class=\"ppy-json-string\">\"CSV_FILE\"</span>\n",
       "  <span class=\"ppy-json-key\">image_open_args</span>: <span class=\"ppy-json-string\">\"PNG\"</span>\n",
       "  <span class=\"ppy-json-key\">append_data_to_metadata</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv\"</span>\n",
       "  <span class=\"ppy-json-key\">n_jobs</span>: <span class=\"ppy-json-number\">1</span>\n",
       "  <span class=\"ppy-json-key\">track_changes</span>: <span class=\"ppy-json-number\">True</span>\n",
       "  <span class=\"ppy-json-key\">rename</span>: <span class=\"ppy-json-string\">\"datetime\"</span>\n",
       "  <span class=\"ppy-json-key\">sampling</span>:\n",
       "    - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "      <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "      <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "      <span class=\"ppy-json-key\">params</span>:\n",
       "        <span class=\"ppy-json-key\">value</span>: <span class=\"ppy-json-number\">0.1</span>\n",
       "        <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "      <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"percent\"</span>\n",
       "  <span class=\"ppy-json-key\">convert</span>:\n",
       "    - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "      <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "      <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "      <span class=\"ppy-json-key\">params</span>:\n",
       "        <span class=\"ppy-json-key\">output_bits</span>: <span class=\"ppy-json-number\">8</span>\n",
       "        <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "      <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"bits\"</span>\n",
       "<span class=\"ppy-json-key\">steps</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"gray\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"colour\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">method</span>: <span class=\"ppy-json-string\">\"opencv\"</span>\n",
       "      <span class=\"ppy-json-key\">invert_colours</span>: <span class=\"ppy-json-number\">False</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"grayscale\"</span></pre></div></div>"
      ],
      "text/plain": [
       "{\n",
       "    \"general\": {\n",
       "        \"name\": \"raw\",\n",
       "        \"step_name\": \"raw\",\n",
       "        \"sample_data\": \"benthic_csv\",\n",
       "        \"input_path\": \"/home/tobfer/.paidiverpy_cache/benthic_csv/images\",\n",
       "        \"output_path\": \"output\",\n",
       "        \"metadata_path\": \"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv\",\n",
       "        \"metadata_type\": \"CSV_FILE\",\n",
       "        \"image_open_args\": \"PNG\",\n",
       "        \"append_data_to_metadata\": \"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv\",\n",
       "        \"n_jobs\": 1,\n",
       "        \"track_changes\": true,\n",
       "        \"rename\": \"datetime\",\n",
       "        \"sampling\": [\n",
       "            {\n",
       "                \"name\": \"sampling\",\n",
       "                \"step_name\": \"sampling\",\n",
       "                \"test\": false,\n",
       "                \"params\": {\n",
       "                    \"value\": 0.1,\n",
       "                    \"raise_error\": false\n",
       "                },\n",
       "                \"mode\": \"percent\"\n",
       "            }\n",
       "        ],\n",
       "        \"convert\": [\n",
       "            {\n",
       "                \"name\": \"convert\",\n",
       "                \"step_name\": \"convert\",\n",
       "                \"test\": false,\n",
       "                \"params\": {\n",
       "                    \"output_bits\": 8,\n",
       "                    \"raise_error\": false\n",
       "                },\n",
       "                \"mode\": \"bits\"\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"steps\": [\n",
       "        {\n",
       "            \"name\": \"gray\",\n",
       "            \"step_name\": \"colour\",\n",
       "            \"test\": false,\n",
       "            \"params\": {\n",
       "                \"method\": \"opencv\",\n",
       "                \"invert_colours\": false,\n",
       "                \"raise_error\": false\n",
       "            },\n",
       "            \"mode\": \"grayscale\"\n",
       "        }\n",
       "    ]\n",
       "}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# See the updated configuration file\n",
    "pipeline.config"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "0131f808-2a6a-40e0-beb7-41726f5c638a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:40 | Processing images using 1 cores\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Processing images using 1 cores\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:40 | Running step 0: raw - OpenLayer\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Running step 0: raw - OpenLayer\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:41 | Step 0 completed\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Step 0 completed\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:41 | Running step 1: gray - ColourLayer\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Running step 1: gray - ColourLayer\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 16:48:41 | Step 1 completed\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Step 1 completed\n"
     ]
    }
   ],
   "source": [
    "# Run your pipeline\n",
    "pipeline.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "eae8f427-3e91-49c9-976b-8606b3917571",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.images_layer.ImagesLayer object at 0x713f1c699e40&gt;</pre><div>\n",
       "            <div class='ppy-h2 ppy-images-step-header' onclick='toggleMetadata(0, \"qtr\")'>\n",
       "                Step 0: raw\n",
       "                <span id='ppy-images-arrow-qtr-0'\n",
       "                    class='ppy-images-toggle-arrow ppy-font-color-brown'>▼\n",
       "                </span>\n",
       "            </div>\n",
       "            <div id='ppy-images-metadata-qtr-0' class='ppy-images-metadata' style='display:block;'><div class='ppy-images'>\n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-0-0\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:14:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-0-0' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-0-0'\n",
       "                src='data:image/png;base64,[encoded data, 29796 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-0-1\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-0-1' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-0-1'\n",
       "                src='data:image/png;base64,[encoded data, 30432 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-0-2\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:18:31\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-0-2' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-0-2'\n",
       "                src='data:image/png;base64,[encoded data, 33664 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-0-3\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:19:31\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-0-3' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-0-3'\n",
       "                src='data:image/png;base64,[encoded data, 39084 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-0-4\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:20:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-0-4' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-0-4'\n",
       "                src='data:image/png;base64,[encoded data, 44804 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            </div></div>\n",
       "            <div class='ppy-h2 ppy-images-step-header' onclick='toggleMetadata(1, \"qtr\")'>\n",
       "                Step 1: gray\n",
       "                <span id='ppy-images-arrow-qtr-1'\n",
       "                    class='ppy-images-toggle-arrow ppy-font-color-brown'>▼\n",
       "                </span>\n",
       "            </div>\n",
       "            <div id='ppy-images-metadata-qtr-1' class='ppy-images-metadata' style='display:block;'><div class='ppy-images'>\n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-1-0\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:14:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-1-0' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-1-0'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APRiM9KiZajIxTCKYRTcUmKcBUiipAKeBTgKcBTgKcBTwKYwqJu/vUTCmkUw0wikxTgKeoqVRTgKcBThTxTgKcBTGAqMiomHNMIphFNNIKcBT1FSgU4UtOApwqQCnAUwio2GKiamEUwimEUAU4U9RUgpwpacKcKeKeKY3FRtioiKYelMNN6mgUoHepBTxTqUDNKKcKkFPUU1qhYUwimEUwimEUAUop4p608U6lxSinA1ItNbNRvzzUZFNIpjUwikxSinCpFp4pwpaUU4CpFprVE1MNNPFRsaZRS0op4qQU4UtKKcKkWkbpUZFRmo2phFMNJSinCnipB0pwpaWnCpFpGqNqiY0w1GTTTSUopwpwNSCnCnClFPFSLTCaYaiPNRtTDTTTaUU6nCng08U4U6nCpFqImkPNRE80xqYx5pppKKWninA04Gng04U8VItQZFNJphNRmm000lLSilBp2acDTwacDUi1KtVc0hNMJphNNptGaAaXNKDSg04Gng08GpFqVTVTdTCaQmmMabmkJpM80Zpc0uaXNOBpympBUimpVNU+KaTTSaYTTc0Z4pKM0ZpwNLmlB5p4PNSA1IpqVTX//Z'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-1-1\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-1-1' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-1-1'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/AO+4IphAzRt9qAuKdtyelOC4oxSHpSYpRS4p2KcBingU8ClxVHnbnPenomak2Adqbto20uOKQ00ikpRThTqcop4pwFPxVALzVhF4pSQKTGRxSbcU0jFJikIpvSlxzThSinrUgFOAp4FU1X5hU2MCm45o6GlxxTW6Uw0hpvelFKKXvT1qUU8DmngVAq04j5aj6UEcUCmmmGkpKUUtFPWpRTxUgqHFBplDUe9Mam4puKTFOFLikxT1GKlWnipBUZ70w02kpaY1NpOooxTgKKTvTxUi08VItRMRmmZyeTRSdqM0xqaaBS0tJSd6eKetPFSCosZOaaaO1IabmkamGlFFOFFJSinjinqakHNNPSmHpTe9IxpmaCabQKdS0UUop1KOalWmlqYTTc01jTM0tJ3pQKd0FIaKWlFOpQakU1AXpAxI5ozTWNMzTs96TvTlpc0hNGaUGnZpaUU9TVMsQaA1OBzQ1N707PFAoFOzSE0lOBpwpRS08GqR60dDxT1pSKb3opQaXNJmlzSZpwpQacDS5pQar0mOacvFLTe9JmlBoNGaM0Zpc0oNPB556UZozUK470E80A0760hpAKOlGaTNLmkzRmnA07NGaM1//9k='\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-1-2\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:18:31\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-1-2' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-1-2'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/ANRh3qN1xioSBmm4Gf5VMoA7VKF3DIppQ1IgGKlwOtPAzinbBijZxSqvNSYwKTbTwOKzgeeeKjJJYimOMHgVCTz7VNGC1TqCBjvT9ueKcFCjFPVM05V5FSgUu3ApQtBFKB+dOxWPyDT1XJJ71HIpz0poU7uOODUsan0zUqKec1IFOadtyacgPIqVVGDT1HrTitG3FIRQBTgOlZO3kU/7opoGeTRsbNWIoTipRFg0vl0pTAoxUgHFOA4p2MGgim0CngVkrnr1+tLjJ5/lT1XLVKF56VOi808LzTivFMYYpoHNPA46Yp+OKBRTT1pQKcKy41zUojzyalSLBzUgjGakRcU/b3pCKYRmkAxTxS0goNJTgKcBWXFknFXEQdTUgXNSBeKAKWmk0gXNGMUhoP8AOgCgik71IKdWdCmMMQDxVleTUyrxmn44xTaGpMUAYFI3SkpMc0tFFOFKDVMCpkFTqOBTjTDSYpfxozTDSUcZpaKKcKMc1VXBNTrxxipVNKaKQ02kOMUlNJoBpQaWilpcnNQINp4qROTmpe1JnmlzxSU00maaTTTQDTs0tLS0gNQqwJx+eakQ4b2qTdikznml3dqQmkzTSaTNIaSnZ4pw6Uo46UZpBUSALk+1OXk+1O60bsUBs0FuKQGg9abn86OcU0dKdmnZpwNGaBUI5HWlzjpS7qZvOcU4NRnnNLn0pAaAc0E8UzNKDT88UuaUHFJk4qPv0ozjmmM2elNXcTkfpTxn0NPA4oxxRg0injmlPSmUvanA0pNGaQninxomNzk/QUkqoD8pyKquRnGaWNFZXYsFwOAc80xdxfHOewxVoAqoBznHenZNOPC5qMkDtQWwucdaYDzzS5HXFAYUbucHqKN1N3c1/9k='\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-1-3\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:19:31\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-1-3' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-1-3'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APO0qZRhqsLx1qVRnFTgcdKkVQeaei8U9kwO3akK84/OlxTcYPTrTABz2oC8ZqJhk1ER19aiYZ5qgvvU6gZqyvzLU0Y4AIqZRx7mnkEJgU9R8vPelyT1p4U7eeuO1IVIBNNIymaTbimt1x2qNvpULr8w96jYcVTWMcZPNSKBU0Q6j3qdRk8dqnjGakOMUqDsafjBzT15we1BXOc0ioNuKTZ6Uxl4qBumKjZeaideD6VT4AFSoAeKnRflb3qZR+tTR8LT8ZGTUijNJ959uOPWn4IXApUOVGevvR6UvamP0qEoASaicAH3+tQydKzkfJ561OjD8atI2Dipl6inhSScdKk9qkHGM9DTmXjNOX5utJjLDHShxtYZPBpHOAKZu4NNPIPtVd/ve9QvWXHirEY+bmrCj5ye1WY+RmrSD5aRBlivrU/HA70dFxQnCfWnAcAikkHK+1RMKYDzTDnkDqKiYc8jmoX6msxByCKsJngirMa8gfnU6fLJtxwatKQELEdO+KfCoDFs5ParCxZKk9c0xxksO4NJjaMD0zTlGB7Un3uaj28mo9u0dc0xjtBOO1MfBBGearP61RRQBzxVmONSQR37VaUAN/OnqcgZxUyY6E1Ii7cDPSplk3qCOcdeKkYAtk96aQCBz1o4FMyD+dBK889Kh6r61GSN3NV3f5iB1FRSd6oovTntVhUKqGHYdDVlGG0GphtKqR0NTRqDyKchYSYP4VOhGMdvSnZ7egqMnC5J6UoO5c+o4pgakY4B9ajJx9KhJ+YkVXkH7zPt0pr/AHSapIcj6dasqxx8w4+tPTmrCnggelSKTjqRVjduA9RT4yxUgnv0x2p2R2pMjGO9Mzz1pG6g1GSc89CcUnrzUJbBOahduTwfemP0rPifH0JzVpWzjoKkU96mjapd+OKmRqcZGUHb1+lSICoyT15prMe1NZsDjrS7vlqMnI6d6aW4qN/unP5VGeVBqGQkHnoKzIXVgGUgjOMiraEdzUgcU8OFGBTxKM9alSbnr3qwj7jxUrvhFBxmmM1C8kE0gOSwpozkg1Gwxx60xx8mCeQOaY0oK5xwKikPHPeuesYUhYyK7HjYwI4zwcj+X51qK52gVIG96fv5z6VDJKVyc0QXG8cetaUUny1PkkgnpSkFjUgfAOeoqEtzk8D1ozlSaTkj3pgYP16VDKvGVxiqxYsuKyrdRFCFzk45Pqaso35VIrZpXfAqtJJnvSQPhvxrWhkBFW1YkVMki7ST3FAwSTimsyq2B0pTjoOKjdwDgcVAzjHNRGQdCRiodwYnHTNYgkIwM1MJcc05ZsGr40vUJ7cXEVv50bdPJdXJ/BST359KrSaTqyNg6Ze/hA2P5VXaK5tWP2i3liwcHzEK4PpzViK6AxzVyPUFUYyDUgv1IAyOKmjvAeA1P85GGc0LNzjNMkkyODioHlA/E1DI65HXr2oLr24qbS9J0SKxjvPEN9cQCbmCC1A8wr/eOQcA9vpUHiHT9MsLiCXRtQ+22EyZVnwJEYdVYcEHoeg61gtKWk8tGA9T6VsaLYWV1a6jJe6hFAYLdmjQK5ZmyADwu3GSOpBOcY7io9tOk8VvAJmuWxiJUOWJHGO5Jz6Voagl7pFhYtJJew3syOssFzC6gR5GzbuXlTye45HcGmnxRrcIETThCqqoUwoMKMEcbfTH1q83iGO2is5LrTtKu2uIQ8gFqqmEh2XbwecqobnH3h2HMc/iPSJdyf8ACORKhOdyTbG65GMJwOox6EelO1PU7GHTLQwaPDAt3D5wYylygV2QrnAzny8/RvXmsyy1W1huS11ZGaItkKJnXbxgDqeO5zk5A5Azndl1bTpLGK5k0h0DZSJipCvtXn5lZQxyVzgev0FFNW054yxsJvORMKFm+R27lh1Axk8H0pl/IkMz25t5Iri3Yxz8/KCDjJwSOuBkNgnp2zSaXimGWv/Z'\n",
       "                class='ppy-images-img'/></div>\n",
       "            \n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-qtr-1-4\", \"qtr\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:20:51\n",
       "                <span id='ppy-images-arrow-qtr-image-qtr-1-4' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-qtr-1-4'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APK1/rUgHNPUcCpUwyggdRnmpAM8nrSgVIBk0vUZ70u2jac5FNK5bIPA6imMOx70hFROpxwaZ/D0qJh7Uka7mwCBgU8DnmpQP84qRAD34qQYP1xSqGzliOvH0xUgXr60vXk/ypQQwypBGeaRyVxtGecNz0FL0GMVEwJUjOD7ig+mMmomxwRyDjpUZAx71Ew5qNOxqVAMinopDdOOtToCV+YY4p4WnY5BGcdPapAM5yQfT3pSMDoB75oCsrFcBUXgAe1Kx6YGQTg4pCO35UhQfxKW7/Q9qjkwQSRxjkeuKjCALx+vWomwOBUTD1NRLzUyjinx81MBkZzUify96cA2/qNuOnfNSABVzzhR2GaSJ/OUvtI+cjBGKl29DjP1pAOOBigrkjFNK+x9R71E3Aye5pmDxyAfeoG3FRuPPfBqJgd2c+xFRqMVMop3IIwoIPWpkIbcCMYOKlUYUccgAU8DOAf5VIAOgxnFOAAUKOAKUDHOOlJ8wZhjA46j/PtTWJXOV4A65prfKMsOACTzURLNjONhHTvSMRjp1qFjgZ/SonGeex7VCoqWMBCdo6nJzzUq9ccYqZcAZ/Knjb1OMjPJ7CpIwRGoY/PtGcd6kA4BxxTtpDY7ijH40gyRjGPxpHIAwTyeBx3pnz+Xngtgcds1GWJLAjj2PWmN3/xqJ8HpjPpURHHSoUHPNSDoBUw4+tSDoTUoUFSMe9PTaXLYG4gAkH/Pv+dS9TzUhLZJyT/WjH5dPrTTycDIppwDxz9KY74x06dc4/yaYcZzUTfSodrKMt0yfp9PrTX456EdKrAZHUj6VMvJznj3qUfe4HtUqfqfQ1JuKqTjPOPlqRRtJx9KkB/GnjkZPrjBo4APH4U2TkAf7QOMUhyR2J7dRTG/z7UwnHP6VG3OTUTNu5zyeeOKic5Ht9arr7VMnTuRUq9Bx+dSqRyec+lSIcgEggkVKpIPHXnpTxznrj2NP7dcUvtRnnDZx7VEgIQb/v4AJ45NM3BgD0z0J4z9KYcE1GTzu74PHaojnOB1qNyOc1AvHQ81KvQ1KtPADDnOCMdcVLG3y4AOBwMnmpASBkAcc89KHQyIylgM4xlcgY/nU/Hbpj8KPwpePmAII6EjoRURO7GSPwqPEbSnn5x1z+n86aAPTJPHAqM4HPUY9cVGW57Hj0qJvu5OM+lQKQADn/61Shiep61KlPQBThmJyerdqkHBp4cAgZ/SpFbjOKcACBnI56U/dg5BprHIKnPIOe1M2qcDkAHI5ppJzTWP/wCuoZGwO+D6dKiY5GMgHtmo296qrtbng9s9qsKRxnOO1SKc/X0qTqO56Y/KnGQAgZGTQJOegwCMGpUkwu7ng9unSpPMXoDSiXv1ApQcqO2fSkbcQME4HpTW69c49KgYgjIUkoeAetIdqjaMYqORizl2LFick5PNQsRnknFUIIkVshyxB2sO2eDkGrikE5705XHFTBun0prtgknPHT2qs84DY7U9LnnvU/n5Gc5P1pUnABJPbOauRSCVF28k8/Wp5LaeOMOykKRmr+naUZ4PNbBGeP8A9VVdV09rT94B8h/SsZ3HT6daj3sc5wPTFQO/zE57etQw/JGo6nufWpS/Gc5pgk96mSX5Tzx0pJZOM5pun6ZdaxeiG3X5Qfnc9FFbuseE3021jltt8pAzJkjgAZzWAkmPWp05dBn7x2+pr0e10WCGAFY1DbcEjv3qO9sJZrYmFfmB4zxmrmm2Jh06NXADAdAOlVNTgSS3mikXIYdPp6V5zLujlKNnINN8wY6VXd93IwajVjjrmnF+Dk9qUDjpitGHRb+4gEsEayRkZzHKjEdCeAc8ZqG40vUol2y2dyhLbQTGQGPoD+ddv4R00abaEzArMxy4YYwfTB+n6Vt386eRIANxKnAFef6poEliqPCd5Y8oOvNN0bRri9uyZD5ccLDcT1J7Y/KvSrZB5YjHCgYGTVyNF2gcUkxWMBex71iTSo0zIeAOK5jVdJid3eNBvIwFHb396yJtFuB/quoH3W4/+tWVNE8LskqlWHBBrd0nRdEisI7zxHqFxbifmG3tQDKV/vHIIAOOPX1qv4h0vTdPuYpdG1IX2n3CAo7YEkbA8qw6g8A5wMg1jKTv2K4yepPatnRtPs7u01GW81COA28DNGgRyxbIAPC7cZOOSCScY7inJayiaO3hSV7l8ERKhLNkZGO5z9K0b5b/AEXT7HdPf215Mr+bbzRyR7UyNm3IGQeTwSOR70n/AAlGtW48ozlNqqApiXgADHb0ArQbxVNbrZzXVvYXb3EIdx5ABgIdlxweSVUNzj7wGAByS+MrNn+XRhGpOSUuCjE9jwvHU+vX2q5f+LJLewtJYLNYRdwGYM0pcxhXZCO2fuZz6GqFh4zmgnJuojMhbIHmsuOMDueOckeuOR33ZPGEMtnFcT2FzHG+VicJkHaOcNuAJ5Hb/AZo8VWkiSYsJDLt+U+YcO2erDqOMngn+tOi1OKPUDaXcLpNC5ildvuqwIXJxkDJ4zuIzWgYUWYMeCeTVPXNKhvLMzKgEqjg461//9k='\n",
       "                class='ppy-images-img'/></div>\n",
       "            </div></div></div></div>"
      ],
      "text/plain": [
       "<paidiverpy.images_layer.ImagesLayer at 0x713f1c699e40>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# See the ouput images\n",
    "pipeline.images"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "ed54281f-361b-45ce-aea0-7406a37ff037",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.images_layer.ImagesLayer object at 0x713f1c699e40&gt;</pre><div>\n",
       "            <div class='ppy-h2 ppy-images-step-header' onclick='toggleMetadata(0, \"oyh\")'>\n",
       "                Step 0: raw\n",
       "                <span id='ppy-images-arrow-oyh-0'\n",
       "                    class='ppy-images-toggle-arrow ppy-font-color-brown'>▼\n",
       "                </span>\n",
       "            </div>\n",
       "            <div id='ppy-images-metadata-oyh-0' class='ppy-images-metadata' style='display:block;'><div class='ppy-images'>\n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-oyh-0-0\", \"oyh\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:51\n",
       "                <span id='ppy-images-arrow-oyh-image-oyh-0-0' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-oyh-0-0'\n",
       "                src='data:image/png;base64,[encoded data, 30432 characters]'\n",
       "                class='ppy-images-img'/></div>\n",
       "            </div></div>\n",
       "            <div class='ppy-h2 ppy-images-step-header' onclick='toggleMetadata(1, \"oyh\")'>\n",
       "                Step 1: gray\n",
       "                <span id='ppy-images-arrow-oyh-1'\n",
       "                    class='ppy-images-toggle-arrow ppy-font-color-brown'>▼\n",
       "                </span>\n",
       "            </div>\n",
       "            <div id='ppy-images-metadata-oyh-1' class='ppy-images-metadata' style='display:block;'><div class='ppy-images'>\n",
       "        <div>\n",
       "            <p onclick='toggleImage(\"image-oyh-1-0\", \"oyh\")' class=\"ppy-images-image-p\" >\n",
       "                Image: 2018-06-11T04:15:51\n",
       "                <span id='ppy-images-arrow-oyh-image-oyh-1-0' class='ppy-images-toggle-arrow ppy-font-color-brown'>▼</span>\n",
       "            </p>\n",
       "        \n",
       "            <img id='image-oyh-1-0'\n",
       "                src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCACAAIABAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/AO+4IphAzRt9qAuKdtyelOC4oxSHpSYpRS4p2KcBingU8ClxVHnbnPenomak2Adqbto20uOKQ00ikpRThTqcop4pwFPxVALzVhF4pSQKTGRxSbcU0jFJikIpvSlxzThSinrUgFOAp4FU1X5hU2MCm45o6GlxxTW6Uw0hpvelFKKXvT1qUU8DmngVAq04j5aj6UEcUCmmmGkpKUUtFPWpRTxUgqHFBplDUe9Mam4puKTFOFLikxT1GKlWnipBUZ70w02kpaY1NpOooxTgKKTvTxUi08VItRMRmmZyeTRSdqM0xqaaBS0tJSd6eKetPFSCosZOaaaO1IabmkamGlFFOFFJSinjinqakHNNPSmHpTe9IxpmaCabQKdS0UUop1KOalWmlqYTTc01jTM0tJ3pQKd0FIaKWlFOpQakU1AXpAxI5ozTWNMzTs96TvTlpc0hNGaUGnZpaUU9TVMsQaA1OBzQ1N707PFAoFOzSE0lOBpwpRS08GqR60dDxT1pSKb3opQaXNJmlzSZpwpQacDS5pQar0mOacvFLTe9JmlBoNGaM0Zpc0oNPB556UZozUK470E80A0760hpAKOlGaTNLmkzRmnA07NGaM1//9k='\n",
       "                class='ppy-images-img'/></div>\n",
       "            </div></div></div></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipeline.images.show(image_number=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f94540f4-3e10-4b8d-82f8-5f125517578b",
   "metadata": {},
   "source": [
    "## Export pipeline to configuration file"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "45e87ff9-f463-4371-8321-27afad0285f0",
   "metadata": {},
   "source": [
    "After creating the pipeline, you can export it to a configuration file and reuse it"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "ef6497b6-9186-47cb-971a-dc1386150867",
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline.export_config(\"new_config.yml\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "bb48175a-ddc4-4188-acfd-c434eeb1560c",
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline = Pipeline(config_file_path=\"new_config.yml\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "9cd9a700-25c6-4a25-88e3-91c63d76ac34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"arrow-right\" viewBox=\"0 0 330 330\">\n",
       "  <path id=\"XMLID_222_\" d=\"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001\n",
       "\tc-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213\n",
       "\tC82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606\n",
       "\tC255,161.018,253.42,157.202,250.606,154.389z\"/>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying Paidiverpy objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --ppy-font-color: var(--jp-content-font-color, rgba(0, 0, 0, 1));\n",
       "  --ppy-font-color-brown: var(--jp-content-font-color-brown, brown);\n",
       "  --ppy-font-color-olive: var(--jp-content-font-color-olive, olive);\n",
       "  --ppy-font-color-teal: var(--jp-content-font-color-teal, teal);\n",
       "  --ppy-font-color-blue: var(--jp-content-font-color-blue, blue);\n",
       "  --ppy-font-color-gray: var(--jp-content-font-color-gray, gray);\n",
       "  --ppy-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --ppy-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --ppy-background-color: var(--jp-layout-color, white);\n",
       "  --ppy-background-color2: var(--jp-layout-color3, rgba(212, 212, 212, 0.15));\n",
       "}\n",
       "\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --ppy-font-color: rgba(255, 255, 255, 1);\n",
       "  --ppy-font-color-brown: brown;\n",
       "  --ppy-font-color-olive: olive;\n",
       "  --ppy-font-color-teal: teal;\n",
       "  --ppy-font-color-blue: blue;\n",
       "  --ppy-font-color-gray: gray;\n",
       "  --ppy-border-color: #1f1f1f;\n",
       "  --ppy-disabled-color: #515151;\n",
       "  --ppy-background-color: #111111;\n",
       "}\n",
       "\n",
       ".ppy-background-color {\n",
       "  background-color: var(--ppy-background-color) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color-brown {\n",
       "  color: var(--ppy-font-color-brown) !important;\n",
       "}\n",
       "\n",
       ".ppy-font-color {\n",
       "  color: var(--ppy-font-color) !important;\n",
       "}\n",
       ".ppy-h2 {\n",
       "  font-size: 20px !important;\n",
       "}\n",
       ".ppy-h3 {\n",
       "  font-size: 13px !important;\n",
       "}\n",
       ".ppy-p {\n",
       "  font-size: 10px;\n",
       "}\n",
       ".ppy-p-error {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "  font-weight: bold;\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".ppy-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-wrap{\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".ppy-pipeline {\n",
       "  float:left;\n",
       "  cursor: pointer;\n",
       "  padding: 10px;\n",
       "  width: max-content;\n",
       "  height: 150px;\n",
       "  margin: 10px;\n",
       "  border: 1px solid #000;\n",
       "  text-align: center;\n",
       "  /* line-height: 80px; */\n",
       "}\n",
       "\n",
       ".ppy-pipeline-clear-fix {\n",
       "  clear: both;\n",
       "}\n",
       "\n",
       ".ppy-pipeline-parameters-all {\n",
       "  padding: 10px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-step-header {\n",
       "  cursor: pointer;\n",
       "  font-weight: bold;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       ".ppy-images-metadata {\n",
       "  margin-left: 20px;\n",
       "  margin-bottom: 10px;\n",
       "}\n",
       ".ppy-images {\n",
       "  display: flex;\n",
       "  flex-wrap: wrap;\n",
       "  gap: 10px;\n",
       "  margin-left: 20px;\n",
       "}\n",
       "\n",
       ".ppy-show-more-button, .ppy-hide-button {\n",
       "  margin-left: 20px;\n",
       "  background-color: #007bff;\n",
       "  color: white;\n",
       "  border: none;\n",
       "  padding: 5px 10px;\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pipeline-arrow {\n",
       "  float:left;\n",
       "  width: 50px;\n",
       "  height: 80px;\n",
       "  margin: 10px;\n",
       "  text-align: center;\n",
       "  line-height: 80px;\n",
       "}\n",
       "\n",
       ".ppy-images-img{\n",
       "  display: block;\n",
       "  max-width: 200px;\n",
       "  margin: 10px;\n",
       "}\n",
       "\n",
       ".ppy-images-toggle-arrow {\n",
       "  cursor: pointer;\n",
       "  margin-left: 5px;\n",
       "}\n",
       "\n",
       ".ppy-images-image-p {\n",
       "  cursor: pointer;\n",
       "}\n",
       "\n",
       ".ppy-arrow-right {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-json-block {\n",
       "  font-family: monospace;\n",
       "  background: var(--ppy-background-color);\n",
       "  padding: 1em;\n",
       "  border-radius: 6px;\n",
       "}\n",
       ".ppy-json-key {\n",
       "  color: var(--ppy-font-color-brown);\n",
       "}\n",
       ".ppy-json-string {\n",
       "  color: var(--ppy-font-color-olive);\n",
       "}\n",
       ".ppy-json-number {\n",
       "  color: var(--ppy-font-color-teal);\n",
       "}\n",
       ".ppy-json-bool {\n",
       "  color: var(--ppy-font-color-blue);\n",
       "}\n",
       ".ppy-json-null {\n",
       "  color: var(--ppy-font-color-gray);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-title-0 {\n",
       "  font-size: 30px;\n",
       "}\n",
       "\n",
       ".ppy-pn-title-1 {\n",
       "  font-size: 20px;\n",
       "}\n",
       ".ppy-pn-title-2 {\n",
       "  font-size: 17px;\n",
       "}\n",
       ".ppy-pn-title-3 {\n",
       "  font-size: 14px;\n",
       "}\n",
       ".ppy-pn-title-4 {\n",
       "  font-size: 12px;\n",
       "}\n",
       "\n",
       ".ppy-pn-bold {\n",
       "  font-weight: bold;\n",
       "}\n",
       ".ppy-pn-italic {\n",
       "  font-style: italic;\n",
       "}\n",
       ".ppy-pn-description {\n",
       "  font-size: 14px;\n",
       "  margin-bottom: 1px;\n",
       "}\n",
       "\n",
       ".bk-root {\n",
       "  width: 100% !important;\n",
       "  max-width: 100% !important;\n",
       "  box-sizing: border-box;\n",
       "}\n",
       "\n",
       "input, .bk-input, .bk-input-group {\n",
       "  margin-top: 0px;\n",
       "  margin-bottom: 3px;\n",
       "  padding-top: 0px;\n",
       "  padding-bottom: 0px;\n",
       "}\n",
       "\n",
       ".ppy-pn-header-button .bk-btn {\n",
       "  background: none !important;\n",
       "  border: none !important;\n",
       "  font-weight: bold;\n",
       "  font-size: 16px;\n",
       "  text-align: left;\n",
       "  padding-left: 0;\n",
       "  cursor: pointer;\n",
       "  box-shadow: none !important;\n",
       "  color: black;\n",
       "}\n",
       "\n",
       ".ppy-pn-danger-modal{\n",
       "  border: 2px solid red;\n",
       "  border-radius: 10px;\n",
       "  box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);\n",
       "}\n",
       "\n",
       ".ppy-pn-config-form{\n",
       "  padding: 10px;\n",
       "  margin-top: 10px;\n",
       "  margin-bottom: 10px;\n",
       "  background-color: var(--ppy-background-color2);\n",
       "  border-radius: 5px;\n",
       "  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n",
       "}\n",
       "\n",
       "\n",
       ".ppy-pn-align-right {\n",
       "  display: flex;\n",
       "  justify-content: flex-end;\n",
       "}\n",
       "</style><script>function toggleMetadata(stepIndex, randomId) {\n",
       "  var metadata = document.getElementById(\"ppy-images-metadata-\" + randomId + \"-\" + stepIndex);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + stepIndex);\n",
       "  if (metadata.style.display === \"none\") {\n",
       "      metadata.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      metadata.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function toggleImage(imageId, randomId) {\n",
       "  var img = document.getElementById(imageId);\n",
       "  var arrow = document.getElementById(\"ppy-images-arrow-\" + randomId + \"-\" + imageId);\n",
       "  if (img.style.display === \"none\") {\n",
       "      img.style.display = \"block\";\n",
       "      arrow.innerHTML = \"▼\";\n",
       "      arrow.classList.remove(\"ppy-font-color\");\n",
       "      arrow.classList.add(\"ppy-font-color-brown\");\n",
       "  } else {\n",
       "      img.style.display = \"none\";\n",
       "      arrow.innerHTML = \"►\";\n",
       "      arrow.classList.remove(\"ppy-font-color-brown\");\n",
       "      arrow.classList.add(\"ppy-font-color\");\n",
       "  }\n",
       "}\n",
       "function showMore(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"flex\";\n",
       "  showMoreButton.style.display = \"none\";\n",
       "  hideButton.style.display = \"inline-block\";\n",
       "}\n",
       "function hide(stepIndex) {\n",
       "  var moreImages = document.getElementById(\"ppy-more-images-\" + stepIndex);\n",
       "  var showMoreButton = document.getElementById(\"ppy-show-more-button-\" + stepIndex);\n",
       "  var hideButton = document.getElementById(\"ppy-hide-button-\" + stepIndex);\n",
       "  moreImages.style.display = \"none\";\n",
       "  showMoreButton.style.display = \"inline-block\";\n",
       "  hideButton.style.display = \"none\";\n",
       "}\n",
       "\n",
       "\n",
       "function showParameters(id, randomId) {\n",
       "  var currentTarget = document.getElementById('ppy-pipeline-' + randomId + '-' + id);\n",
       "  var square = document.getElementsByClassName('ppy-pipeline-' + randomId);\n",
       "  var allParams = document.getElementsByClassName('ppy-pipeline-parameters-' + randomId);\n",
       "  var selectedParams = document.getElementById('ppy-pipeline-parameters-' + randomId + '-' + id);\n",
       "  var idWasVisible = false;\n",
       "  if (selectedParams) {\n",
       "      var idWasVisible = selectedParams.style.display === 'block';\n",
       "  }\n",
       "  for (var i = 0; i < square.length; i++) {\n",
       "      square[i].classList.remove('ppy-font-color-brown');\n",
       "      square[i].classList.add('ppy-font-color');\n",
       "  }\n",
       "  for (var i = 0; i < allParams.length; i++) {\n",
       "      allParams[i].style.display = 'none';\n",
       "  }\n",
       "  // Show the selected parameter section\n",
       "  if (selectedParams) {\n",
       "      if (idWasVisible) {\n",
       "          selectedParams.style.display = 'none';\n",
       "          currentTarget.classList.remove('ppy-font-color-brown');\n",
       "          currentTarget.classList.add('ppy-font-color');\n",
       "      } else {\n",
       "          selectedParams.style.display = 'block';\n",
       "          currentTarget.classList.remove('ppy-font-color');\n",
       "          currentTarget.classList.add('ppy-font-color-brown');\n",
       "      }\n",
       "  }\n",
       "}\n",
       "\n",
       "hljs.highlightAll();\n",
       "</script><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js\"></script><script>hljs.highlightAll();</script><pre class='ppy-text-repr-fallback'>&lt;paidiverpy.pipeline.pipeline.Pipeline object at 0x713f0304eb90&gt;</pre><div>\n",
       "    <div class=\"ppy-pipeline-wrap\">\n",
       "        \n",
       "    <div id=\"ppy-pipeline-hvy-general\" title=\"Click to see more information\"\n",
       "        class=\"ppy-pipeline ppy-pipeline-hvy\"\n",
       "        onclick=\"showParameters('general', 'hvy')\">\n",
       "        <h2 class=\"ppy-h2\">Raw</h2>\n",
       "        <h3 class=\"ppy-h3\">Type: Raw</h2>\n",
       "    </div>\n",
       "    <div class=\"ppy-pipeline-arrow\"><svg class='icon ppy-arrow-right'><use xlink:href='#arrow-right'></use></svg></div>\n",
       "            <div id=\"ppy-pipeline-hvy-step-0\" title=\"Click to see more information\"\n",
       "                class=\"ppy-pipeline ppy-pipeline-hvy\" onclick=\"showParameters('step-0', 'hvy')\">\n",
       "                <h2 class=\"ppy-h2\">Gray</h2>\n",
       "                <h3 class=\"ppy-h3\">Type: Colour</h2>\n",
       "            </div>\n",
       "        \n",
       "    </div>\n",
       "    <div id=\"ppy-pipeline-parameters\" class=\"ppy-pipeline-parameters-all\">\n",
       "            <div id=\"ppy-pipeline-parameters-hvy-step-0\"\n",
       "                class=\"ppy-pipeline-parameters ppy-pipeline-parameters-hvy\"\n",
       "                style=\"display: none;\">\n",
       "                <h4 class=\"ppy-h4\">Parameters:</h4>\n",
       "                <pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"gray\"</span>\n",
       "<span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"colour\"</span>\n",
       "<span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "<span class=\"ppy-json-key\">params</span>:\n",
       "  <span class=\"ppy-json-key\">method</span>: <span class=\"ppy-json-string\">\"opencv\"</span>\n",
       "  <span class=\"ppy-json-key\">invert_colours</span>: <span class=\"ppy-json-number\">False</span>\n",
       "  <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "<span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"grayscale\"</span></pre>\n",
       "            </div>\n",
       "        \n",
       "        <div id=\"ppy-pipeline-parameters-hvy-general\" class=\"ppy-pipeline-parameters ppy-pipeline-parameters-hvy\"\n",
       "            style=\"display: none;\">\n",
       "            <h4 class=\"ppy-h4\">Parameters:</h4>\n",
       "            <pre class=\"ppy-json-block\"><span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"raw\"</span>\n",
       "<span class=\"ppy-json-key\">sample_data</span>: <span class=\"ppy-json-string\">\"benthic_csv\"</span>\n",
       "<span class=\"ppy-json-key\">input_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/images\"</span>\n",
       "<span class=\"ppy-json-key\">output_path</span>: <span class=\"ppy-json-string\">\"output\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_path</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">metadata_type</span>: <span class=\"ppy-json-string\">\"CSV_FILE\"</span>\n",
       "<span class=\"ppy-json-key\">image_open_args</span>: <span class=\"ppy-json-string\">\"PNG\"</span>\n",
       "<span class=\"ppy-json-key\">append_data_to_metadata</span>: <span class=\"ppy-json-string\">\"/home/tobfer/.paidiverpy_cache/benthic_csv/metadata/appended_metadata_benthic_csv.csv\"</span>\n",
       "<span class=\"ppy-json-key\">n_jobs</span>: <span class=\"ppy-json-number\">1</span>\n",
       "<span class=\"ppy-json-key\">track_changes</span>: <span class=\"ppy-json-number\">True</span>\n",
       "<span class=\"ppy-json-key\">rename</span>: <span class=\"ppy-json-string\">\"datetime\"</span>\n",
       "<span class=\"ppy-json-key\">sampling</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"sampling\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">value</span>: <span class=\"ppy-json-number\">0.1</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"percent\"</span>\n",
       "<span class=\"ppy-json-key\">convert</span>:\n",
       "  - <span class=\"ppy-json-key\">name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">step_name</span>: <span class=\"ppy-json-string\">\"convert\"</span>\n",
       "    <span class=\"ppy-json-key\">test</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">params</span>:\n",
       "      <span class=\"ppy-json-key\">output_bits</span>: <span class=\"ppy-json-number\">8</span>\n",
       "      <span class=\"ppy-json-key\">raise_error</span>: <span class=\"ppy-json-number\">False</span>\n",
       "    <span class=\"ppy-json-key\">mode</span>: <span class=\"ppy-json-string\">\"bits\"</span></pre>\n",
       "        </div>\n",
       "    </div>\n",
       "    </div></div>"
      ],
      "text/plain": [
       "<paidiverpy.pipeline.pipeline.Pipeline at 0x713f0304eb90>"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "d8bb8d75-6852-44d9-85b6-94a8c3ba0e06",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 13:31:51 | Processing images using 1 cores\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Processing images using 1 cores\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 13:31:51 | Running step 0: raw - OpenLayer\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Running step 0: raw - OpenLayer\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n",
      "WARNING:root:Failed to convert the image to 8 bits: Unsupported output bits or image already within provided format: 8\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 13:31:52 | Step 0 completed\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Step 0 completed\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 13:31:52 | Running step 1: gray - ColourLayer\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Running step 1: gray - ColourLayer\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[92m☁ paidiverpy ☁  |       INFO | 2025-09-11 13:31:52 | Step 1 completed\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:paidiverpy:Step 1 completed\n"
     ]
    }
   ],
   "source": [
    "pipeline.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "38c52e9d-d9fd-4b9d-9b70-c150c7c992c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>XResolution</th>\n",
       "      <th>YResolution</th>\n",
       "      <th>ExposureTime</th>\n",
       "      <th>FNumber</th>\n",
       "      <th>ISO</th>\n",
       "      <th>image-datetime</th>\n",
       "      <th>MaxApertureValue</th>\n",
       "      <th>WhiteBalance</th>\n",
       "      <th>FocusPosition</th>\n",
       "      <th>...</th>\n",
       "      <th>temperature_c</th>\n",
       "      <th>positioning_ok</th>\n",
       "      <th>attitude_ok</th>\n",
       "      <th>depth_ok</th>\n",
       "      <th>altitude_ok</th>\n",
       "      <th>X</th>\n",
       "      <th>phototime</th>\n",
       "      <th>flag</th>\n",
       "      <th>point</th>\n",
       "      <th>filename</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>436</td>\n",
       "      <td>300</td>\n",
       "      <td>300</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>8</td>\n",
       "      <td>200</td>\n",
       "      <td>2018-06-11 04:15:21</td>\n",
       "      <td>2.828427</td>\n",
       "      <td>FLASH</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1.4697</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2018-06-11 04:15:21</td>\n",
       "      <td>0</td>\n",
       "      <td>POINT (-153.6053176 11.25169125)</td>\n",
       "      <td>2018-06-11T04:15:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>454</td>\n",
       "      <td>300</td>\n",
       "      <td>300</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>8</td>\n",
       "      <td>200</td>\n",
       "      <td>2018-06-11 04:18:21</td>\n",
       "      <td>2.828427</td>\n",
       "      <td>FLASH</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1.4557</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2018-06-11 04:18:21</td>\n",
       "      <td>0</td>\n",
       "      <td>POINT (-153.60529078 11.251633)</td>\n",
       "      <td>2018-06-11T04:18:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>455</td>\n",
       "      <td>300</td>\n",
       "      <td>300</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>8</td>\n",
       "      <td>200</td>\n",
       "      <td>2018-06-11 04:18:31</td>\n",
       "      <td>2.828427</td>\n",
       "      <td>FLASH</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1.4606</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2018-06-11 04:18:31</td>\n",
       "      <td>0</td>\n",
       "      <td>POINT (-153.60528577 11.25163374)</td>\n",
       "      <td>2018-06-11T04:18:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>474</td>\n",
       "      <td>300</td>\n",
       "      <td>300</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>8</td>\n",
       "      <td>200</td>\n",
       "      <td>2018-06-11 04:21:41</td>\n",
       "      <td>2.828427</td>\n",
       "      <td>FLASH</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1.4385</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2018-06-11 04:21:41</td>\n",
       "      <td>0</td>\n",
       "      <td>POINT (-153.60513384 11.25165041)</td>\n",
       "      <td>2018-06-11T04:21:41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>477</td>\n",
       "      <td>300</td>\n",
       "      <td>300</td>\n",
       "      <td>0.016667</td>\n",
       "      <td>8</td>\n",
       "      <td>200</td>\n",
       "      <td>2018-06-11 04:22:11</td>\n",
       "      <td>2.828427</td>\n",
       "      <td>FLASH</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>1.4326</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2018-06-11 04:22:11</td>\n",
       "      <td>0</td>\n",
       "      <td>POINT (-153.60511554 11.25165272)</td>\n",
       "      <td>2018-06-11T04:22:11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 37 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    ID  XResolution  YResolution  ExposureTime  FNumber  ISO  \\\n",
       "0  436          300          300      0.016667        8  200   \n",
       "1  454          300          300      0.016667        8  200   \n",
       "2  455          300          300      0.016667        8  200   \n",
       "3  474          300          300      0.016667        8  200   \n",
       "4  477          300          300      0.016667        8  200   \n",
       "\n",
       "       image-datetime  MaxApertureValue  WhiteBalance  FocusPosition  ...  \\\n",
       "0 2018-06-11 04:15:21          2.828427  FLASH                    17  ...   \n",
       "1 2018-06-11 04:18:21          2.828427  FLASH                    17  ...   \n",
       "2 2018-06-11 04:18:31          2.828427  FLASH                    17  ...   \n",
       "3 2018-06-11 04:21:41          2.828427  FLASH                    17  ...   \n",
       "4 2018-06-11 04:22:11          2.828427  FLASH                    17  ...   \n",
       "\n",
       "   temperature_c  positioning_ok  attitude_ok  depth_ok  altitude_ok   X  \\\n",
       "0         1.4697               1            1         1            1 NaN   \n",
       "1         1.4557               1            1         1            1 NaN   \n",
       "2         1.4606               1            1         1            1 NaN   \n",
       "3         1.4385               1            1         1            1 NaN   \n",
       "4         1.4326               1            1         1            1 NaN   \n",
       "\n",
       "             phototime  flag                              point  \\\n",
       "0  2018-06-11 04:15:21     0   POINT (-153.6053176 11.25169125)   \n",
       "1  2018-06-11 04:18:21     0    POINT (-153.60529078 11.251633)   \n",
       "2  2018-06-11 04:18:31     0  POINT (-153.60528577 11.25163374)   \n",
       "3  2018-06-11 04:21:41     0  POINT (-153.60513384 11.25165041)   \n",
       "4  2018-06-11 04:22:11     0  POINT (-153.60511554 11.25165272)   \n",
       "\n",
       "              filename  \n",
       "0  2018-06-11T04:15:21  \n",
       "1  2018-06-11T04:18:21  \n",
       "2  2018-06-11T04:18:31  \n",
       "3  2018-06-11T04:21:41  \n",
       "4  2018-06-11T04:22:11  \n",
       "\n",
       "[5 rows x 37 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipeline.get_metadata()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "60ac0f96-0e29-4df7-9083-8245a63fb5c8",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
