OPF
SpecDefinition referenceView source

Image Recolor

Color treatment for the image pixels. Luminance uses Rec. 601 weights (0.299, 0.587, 0.114) on sRGB values.

Metadata

Definition
#/$defs/ImageRecolor
Form
2 alternative forms (oneOf)
Source
spec/schemas/opf.schema.json

Field index

This definition uses the forms or value constraints below.

oneOf 1 · const

Replace each pixel with its luminance, exported as native a:grayscl.

Exact constraints for oneOf 1
oneOf 1 schema
{
  "type": "string",
  "const": "grayscale",
  "description": "Replace each pixel with its luminance, exported as native a:grayscl."
}

oneOf 2 · object

Duotone: map each pixel's luminance linearly from dark to light, exported as native a:duotone.

FieldTypeReq.DefaultDescription
darkref:ColorRefyes—Color at luminance 0.
dark · Named choices (see schema for other values and constraints)
"accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"
lightref:ColorRefyes—Color at luminance 1.
light · Named choices (see schema for other values and constraints)
"accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"

dark

typeref:ColorRefrequiredyesdefault—

Color at luminance 0.

dark · Named choices (see schema for other values and constraints)
"accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"

light

typeref:ColorRefrequiredyesdefault—

Color at luminance 1.

light · Named choices (see schema for other values and constraints)
"accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"
Exact constraints for oneOf 2
oneOf 2 schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "dark",
    "light"
  ],
  "properties": {
    "dark": {
      "$ref": "#/$defs/ColorRef",
      "description": "Color at luminance 0."
    },
    "light": {
      "$ref": "#/$defs/ColorRef",
      "description": "Color at luminance 1."
    }
  },
  "description": "Duotone: map each pixel's luminance linearly from dark to light, exported as native a:duotone."
}
Complete definition constraints
Exact schema constraints
{
  "oneOf": [
    {
      "type": "string",
      "const": "grayscale",
      "description": "Replace each pixel with its luminance, exported as native a:grayscl."
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dark",
        "light"
      ],
      "properties": {
        "dark": {
          "$ref": "#/$defs/ColorRef",
          "description": "Color at luminance 0."
        },
        "light": {
          "$ref": "#/$defs/ColorRef",
          "description": "Color at luminance 1."
        }
      },
      "description": "Duotone: map each pixel's luminance linearly from dark to light, exported as native a:duotone."
    }
  ],
  "description": "Color treatment for the image pixels. Luminance uses Rec. 601 weights (0.299, 0.587, 0.114) on sRGB values."
}
value · Named choices (see schema for other values and constraints)
"grayscale"