gradient

Description

Convert a mono image to an RGB gradient image for better visibility. If the "insetinto" input has an image AND there is a valid ROI in the mono image, the image will be inset into the RGB of the insetinto image. NOTE: if you change the "insetinto" image's RGB mapping you may need to "run all" to see the the change reflected.

Ignores DQ and uncertainty

The gradient widget has the following behaviour:

  • click and drag to move a colour point
  • doubleclick to delete an existing colour point
  • doubleclick to add a new colour point
  • right click to edit an existing colour point

Node parameters:

  • gradient: utils.Gradient object containing gradient info
  • colour: (r,g,b) [0:1] colour of text and border for in-image legend
  • legendrect: (x,y,w,h) rectangle for in-image legend
  • vertical: true if vertical legend
  • fontscale: size of font
  • thickness: border thickness
  • legendPos: string describing position:
    • 'In image', 'Top margin', 'Bottom margin', 'Left margin', 'Right margin', 'None' These are also defined as constants LEFT_MARGIN... IN_IMAGE (and None)

Connections

Inputs

Index Name Type Desc
0 mono img (none)
1 background img (none)

Outputs

Index Name Type Desc
0 (none) img (none)

Parameters

gradientgradient: list (ordered)x: float (default 0.0)x
colourcolour (ordered)r: int or float (default 0.0)The red component 0-1
g: int or float (default 0.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
preset: string (topo, grey, viridis, magma, plasma, inferno, cividis, mako, turbo, rocket) (default None)preset
colourlegend colour (ordered)r: int or float (default 1.0)The red component 0-1
g: int or float (default 1.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
legendrectlegend rectangle if in image (ordered)x: integer (default 0)The x coordinate of the top left corner
y: integer (default 0)The y coordinate of the top left corner
w: integer (default 100)The width of the rectangle
h: integer (default 20)The height of the rectangle
vertical: boolean (default False)is legend vertical?
fontscale: float (default 10.0)size of legend font
thickness: float (default 1.0)thickness of legend border
legendPos: string (Left margin, Right margin, Top margin, Bottom margin, In image, None) (default 'In image')legend location
normbackground: boolean (default False)normalise background
sigfigs: integer (default 6)significant figures

Automatically generated by generate_autodocs.py

Date: 2025-02-17T16:09:18.986731