Skip to content
HALOWERK

Image Processing

indexed png nearest opaque swatch

PNG palette matching finds the closest fully opaque palette entry by squared distance in encoded RGB bytes. Use it when an agent needs a deterministic solid-colour substitution.

POST https://bild.halowerk.com/v1/indexed-png-nearest-opaque-swatch

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
pngstringYes
colorstringYes
Show full input schema
{
  "type": "object",
  "properties": {
    "png": {
      "type": "string",
      "maxLength": 64000,
      "minLength": 1
    },
    "color": {
      "type": "string",
      "pattern": "^#?[0-9a-fA-F]{6}$"
    }
  },
  "required": [
    "png",
    "color"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "png": "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAElBMVEUAAAASZZTpoBQbjEsbjEuWoKqG5LLQAAAABnRSTlMA//+AgP+Nc6qqAAAAGElEQVR4nGNgYGRkYGBkYmIEEswgJiMDAAC7ABLWpWFfAAAAAElFTkSuQmCC",
  "color": "#116699"
}

Result & documentation

Show published result schema
{
  "type": "object",
  "required": [
    "measured_at",
    "source",
    "data",
    "limitations"
  ],
  "properties": {
    "measured_at": {
      "type": "string"
    },
    "source": {
      "type": "object",
      "required": [
        "reference",
        "retrieved_at"
      ],
      "properties": {
        "reference": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "index": {
          "type": [
            "integer",
            "null"
          ]
        },
        "rgb": {
          "type": [
            "string",
            "null"
          ]
        },
        "squared_distance": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "index",
        "rgb",
        "squared_distance"
      ]
    },
    "limitations": {
      "type": "string"
    }
  }
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-20 UTC.

More endpoints in this hub

All endpoints in this hub →