Skip to content
HALOWERK

Image Processing

pnm sample quantization error

Portable raster quantization predicts the maximum and RMS round-trip sample error after conversion to a chosen target maxval. Use it when an agent needs precision loss before reducing sample depth.

POST https://bild.halowerk.com/v1/pnm-sample-quantization-error

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
pnmstringYes
target_maxintegerNo
Show full input schema
{
  "type": "object",
  "properties": {
    "pnm": {
      "type": "string",
      "maxLength": 45000,
      "minLength": 1
    },
    "target_max": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65535
    }
  },
  "required": [
    "pnm"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "pnm": "P3\n# tile swatch\n3 2\n15\n0 0 0 15 0 0 0 15 0\n0 0 15 15 15 15 15 0 0"
}

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": {
        "max_error": {
          "type": "number"
        },
        "rms_error": {
          "type": "number"
        },
        "changed_samples": {
          "type": "integer"
        }
      },
      "required": [
        "max_error",
        "rms_error",
        "changed_samples"
      ]
    },
    "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 →