Palette Index Bounds Audit
Audit signed integer palette-index bounds without rejecting the whole observation or mutating index data.
Description
Audit signed integer palette-index bounds without rejecting the whole observation or mutating index data.
A declared palette size defines the valid zero-based index interval. A diagnostic can preserve every invalid occurrence.
When to use this tool
Audit signed integer palette-index bounds without rejecting the whole observation or mutating index data.
- Prepare the supplied paletteSize, indexes fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter paletteSize, indexes. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.violations. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require paletteSize from 0 to 128 and integer indexes within plus or minus one billion. Report each source position with a value below zero or at least paletteSize.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| paletteSize | palette size. | Integer from 0 to 128 inclusive |
| indexes | indexes. | List of finite numbers; at most 128 entries |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.violations | Source positions or records that fail the specific screen above; an empty list means no such violation. |
{
"input": {
"paletteSize": 2,
"indexes": [
0,
2,
-1
]
},
"output": {
"result": {
"violations": [
{
"index": 1,
"value": 2
},
{
"index": 2,
"value": -1
}
]
}
}
} Limitations and assumptions
- This audits numeric bounds without loading a palette or image. A false bound match is reported rather than repairing the index.
- Palette records contain string id/name and exactly four RGBA bytes from zero through 255; at most 128 records are accepted. Duplicate IDs or names remain allowed unless this operation explicitly audits or rejects them.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Lists are limited to 128 entries. JSON text must meet bounded size and depth checks, and numeric outputs beyond the safe finite magnitude are rejected. Exact large integers use decimal strings.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Use actual rendering or a color-managed workflow when comparing perceived color and transparency. Index changes need corresponding updates to their consumers; name and role checks do not establish visual accessibility.
References
Similar or alternative tools
- Palette Adjacent Repeat Audit
Audit adjacent exact RGBA palette repeats, excluding RGB-only matches whose alpha differs; caller ordering is preserved.
- Palette Alpha Presence Summary
Count transparent, opaque and partially transparent RGBA palette byte entries; no compositing or color-space conversion.