img_to_rgb — 2D bridge op

• Data kinds: image → rgbimage

• Call: fullseye.apply(img, "img_to_rgb", a=0.5, b=0.5) (the 2-D model is one image plus two scalar knobs a,b∈[0,1])

img_to_rgb: input → output

*The figure is the actual output on a synthetic 128×128 input. Left: input, right: output. Point clouds are drawn as a top-down scatter (brightness = z), 1-D series as a line plot, volumes as the maximum-intensity projection along z, videos as the middle frame, complex images as magnitude; return values that are not pictures are shown as the values themselves.*

Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):

▸ img_to_rgb: knob a sweep (docs site)

Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):

▸ img_to_rgb: knob b sweep (docs site)

On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):

▸ img_to_rgb: other inputs (docs site)

*The 4th column is a colour (H,W,3) input. This op handles colour without crossing channels (it does not convolve the colour channel as a third spatial axis).*

Usage

Give a gray image a hue and saturation, producing an (H,W,3) RGB image (sort rgbimage).

Built in the form of the dichromatic reflection model (diffuse = coloured, specular = white):

mix = (1 - sat) + sat * chroma, chroma = HSV(hue, 1, 1), spec = clip((gray - 0.75) / 0.25, 0, 1) ** 2, rgb = gray * (mix * (1 - spec) + spec). In other words, dark to mid-tone pixels are coloured by the hue, and the further a pixel's brightness exceeds 0.75, the more it returns to white (achromatic). With saturation 0 it is a grey with 3 equal channels (the input itself, regardless of spec). Every channel is at or below the input, so the range stays within [0,1].

• a → hue hue = a (red at 0, green at 1/3, blue at 2/3, back to red at 1).

• b → saturation sat = b (coloured only halfway at b=0.5).

• Returns: (H, W, 3) float64.

• The specular knee SPECULAR_KNEE = 0.75 is fixed (not made a knob).

Why specular is included (measured 2026-09-07): with simple colouring gray * mix the bright parts also become a saturated colour of the same hue, and the "achromatic highlights" that tb_specular_coefficient_map / tb_specular_diffuse_split / tb_specular_free_transform look at did not exist on even 1 pixel, so the specular coefficient was all 0 and the figure pitch black. The synthesis input side satisfies the family's assumption (dichromatic).

Where to use: tb_rgb_to_quaternion (→ qimage, the entry to the quaternion colour ops), tb_specular_free_transform / tb_wetness / tb_sensor_capture. It does not reproduce the colours of natural images (a single-hue synthesis).

Detailed usage guide

• gallery2d_bridge family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Try it in Studio

The program below has been verified to run (same input as the figure). In Studio's help this block becomes buttons that load and run it on the spot.

img_to_rgb 0.50 0.50

▸ Load this pipeline  ·  Load & run

Runnable examples (verified samples that actually call this op)

• gallery2d_bridge — py -3.11 examples/gallery2d_bridge.py

Ops the type connects to (they accept rgbimage as input)

identity · tb_wetness · tb_sensor_capture · tb_specular_diffuse_split · tb_specular_coefficient_map · tb_specular_free_transform · tb_rgb_to_quaternion

Same category (bridge)

img_to_points · img_to_keypoints · img_to_signal · img_to_projection_profile · img_to_counts · img_to_matrix · img_to_video · img_to_volume


*Provenance: ops.py — 2D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.