# 3.4.5.9. Edit raster¶

Edit raster

This tab allows for the direct editing of pixel values in a raster. Only pixels beneath ROI polygons or vector polygons are edited.

WARNING: the input raster is directly edited; it is recommended to create a backup copy of the input raster before using this tool in order to prevent data loss.

This tool can rapidly edit large rasters, especially when editing polygons are small, because pixel values are edited directly. In addition, the SCP Edit Toolbar is available for easing the raster editing using multiple values.

## 3.4.5.9.1. Edit raster¶

• Select the input raster : select a raster (already loaded in QGIS);
• : refresh layer list;

## 3.4.5.9.2. Edit raster values¶

• Edit values using ROI polygons: if checked, raster is edited using temporary ROI polygons in the map;
• Edit values using a vector : if checked, raster is edited using all the polygons of selected vector;
• : refresh layer list;

## 3.4.5.9.3. Edit options¶

• Use the value field of the vector : if checked, raster is edited using the selected vector (in Edit values using a vector) and the polygon values of selected vector field;
• Use constant value : if checked, raster is edited using the selected constant value;
• Use expression : if checked, raster is edited according to the entered expression; the expression must contain one or more where; accepted variable are raster representing the input raster value and vector representing the vector value if selected; the following example expression where(raster == 1, 2, raster) is already entered, which sets 2 where raster equals 1, and leaves unchanged the values where raster is not equal to 1;
• : undo the last raster edit (available only when using ROI polygons);
• RUN : edit the raster;