Skip to main content
Glama

lrgb_combine

Merges a grayscale luminance view into an RGB image to sharpen detail while preserving its original colors, with optional linear fit for consistency.

Instructions

Replace the lightness of an RGB view with a grayscale L view using LRGBCombination, in place on the RGB view. Only the L channel is enabled, so the RGB view keeps its own color channels. lightness and saturation are LRGBCombination's transfer-function midtones balances mL and mc (0.5 leaves that component unchanged). When linear_fit_reject_high is given, the call also runs LinearFit on the L view (modified in place, ahead of the combination) against a temporary luminance image 0.2126 R + 0.7152 G + 0.0722 B of the RGB view; when it is omitted, no LinearFit runs. Chrominance noise reduction and highlight clipping are left at PixInsight's defaults.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
l_idYesGrayscale luminance view ID with the same dimensions as rgb_id
rgb_idYesRGB color view ID (modified in place)
lightnessYesMidtones balance of the lightness transfer function (LRGBCombination mL), 0 to 1
saturationYesMidtones balance of the saturation transfer function (LRGBCombination mc), 0 to 1
linear_fit_reject_highNoLinearFit rejectHigh for the fit of L to the RGB luminance; omitted = no LinearFit

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite no annotations, the description discloses key behaviors: in-place modification of the RGB view, the conditional LinearFit on the L view (with a modified-in-place note), the effect of lightness/saturation values (0.5 leaves unchanged), and that chrominance noise reduction and highlight clipping remain at defaults. This is thorough and goes beyond basic parameter descriptions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and well-structured, with each sentence adding new information. It front-loads the primary purpose, then clarifies channel behavior, parameter semantics, conditional logic, and defaults. No repetition or fluff; all parts contribute to understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool without an output schema, the description covers the operation, side effects, and parameter behavior thoroughly. However, it does not explicitly state what the tool returns or whether it returns a modified view or a status. Given its in-place nature, this is a minor gap, but with no output schema, a note on return behavior would make it fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While schema coverage is 100%, the description adds significant meaning beyond the schema. It explains the relationship of lightness and saturation to mL/mc, the neutral value 0.5, and provides a detailed explanation of the optional linear_fit_reject_high parameter (what it does, what it fits against, and the coefficient formula). This is invaluable for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Replace the lightness of an RGB view with a grayscale L view') and the specific process (LRGBCombination). It is unambiguous about the operation and distinguishes it from generic combine tools by describing the in-place modification and the L channel handling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the operation but does not explicitly state when to use this tool over alternatives. It mentions conditional behavior for the optional parameter, but no direct comparison to sibling tools (e.g., combine_channels, run_pixelmath). Usage context is implied through the detailed description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.