Create RGB image from class probability/fraction layer

Create an RGB image from a class fraction layer or class probability layer.The RGB pixel color of a single pixel is given by the weighted mean of the given category colors.The weights are given by class fractions/probabilities (i.e. values between 0 and 1). For example, pure pixels with cover fractions of 1 appear in its pure category color. A mixed-pixel with a 50% fractions in two categories colored in red and green,appears in a dull yellow ( 0.5 x (255, 0, 0) + 0.5 x (0, 255, 0) = (127, 127, 0) ).

Usage:

  1. Open the algorithm from the processing toolbox.

  2. Select a calss probability/fraction layer and define a colour scheme from a categorized layer, then click run.

    ../../../../_images/class_fraction_to_rgb.png
  3. The output raster can be found under Rasters in the Data Source Panel

    ../../../../_images/class_fraction_to_rgb_result.png

Parameters

Class probability/fraction layer [raster]

A class fraction layer or class probability layer used as weights for calculating final pixel colors.

Colors [string]

Comma separated list of hex-color strings (e.g. ‘#FF0000’ for red) representing (pure) category colors, one color for each band in the given class probability/fraction layer. If not specified, colors have to be specified by a categorized layer (Colors from categorized layer).

Colors from categorized layer [layer]

A categorized layer with (pure) category colors, one category for each band in the given class probability/fraction layer. If not specified, colors have to be specified by list (Colors).

Outputs

Output RGB image [rasterDestination]

Raster file destination.

Command-line usage

>qgis_process help enmapbox:CreateRgbImageFromClassProbabilityfractionLayer:

----------------
Arguments
----------------

probability: Class probability/fraction layer
    Argument type:  raster
    Acceptable values:
            - Path to a raster layer
colors: Colors (optional)
    Argument type:  string
    Acceptable values:
            - String value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
colorsLayer: Colors from categorized layer (optional)
    Argument type:  layer
    Acceptable values:
            - Path to a vector, raster or mesh layer
outputRGBImage: Output RGB image
    Argument type:  rasterDestination
    Acceptable values:
            - Path for new raster layer

----------------
Outputs
----------------

outputRGBImage: <outputRaster>
    Output RGB image