Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factorize the Min and Max value settings group #3447

Merged
merged 5 commits into from Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 78 additions & 85 deletions source/docs/user_manual/working_with_raster/raster_properties.rst
Expand Up @@ -120,9 +120,21 @@ Multiband color

With the multiband color renderer, three selected bands from the image will be
rendered, each band representing the red, green or blue component that will be
used to create a color image. You can choose several :guilabel:`Contrast
enhancement` methods: 'No enhancement', 'Stretch to MinMax', 'Stretch and clip
to MinMax' and 'Clip to min max'.
used to create a color image. QGIS automatically fetches for each band its
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
:guilabel:`Min` and :guilabel:`Max` values over the whole raster and scale
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
the coloring accordingly but you can control the values range with the help
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
of the :ref:`Min/Max Value Settings <minmaxvalues>` section.

A :guilabel:`Contrast enhancement` method can also be applied to the values:
'No enhancement', 'Stretch to MinMax', 'Stretch and clip to MinMax' and 'Clip to min max'.

.. index:: Contrast enhancement

.. note:: **Contrast enhancement**

When adding GRASS rasters, the option *Contrast enhancement* will always be
set automatically to *stretch to min max*, regardless of if this is set to
another value in the QGIS general options.

.. _figure_raster_multiband:

Expand All @@ -131,38 +143,15 @@ to MinMax' and 'Clip to min max'.

Raster Symbology - Multiband color rendering

This selection offers you a wide range of options to modify the appearance
of your raster layer. First of all, you have to get the data range from your
image. This can be done by choosing the :guilabel:`Extent` and pressing
:guilabel:`Load`. QGIS can |radioButtonOn| :guilabel:`Estimate (faster)` the
:guilabel:`Min` and :guilabel:`Max` values of the bands or use the
|radioButtonOff| :guilabel:`Actual (slower)` :guilabel:`Accuracy`.

Now you can scale the colors with the help of the :guilabel:`Load min/max values`
section. A lot of images have a few very low and high data. These outliers can be
eliminated using the |radioButtonOn| :guilabel:`Cumulative count cut` setting.
The standard data range is set from 2% to 98% of the data values and can be adapted
manually. With this setting, the gray character of the image can disappear.
With the scaling option |radioButtonOff| :guilabel:`Min/max`, QGIS creates a color
table with all of the data included in the original image (e.g., QGIS creates
a color table with 256 values, given the fact that you have 8 bit bands).
You can also calculate your color table using the |radioButtonOff| :guilabel:`Mean
+/- standard deviation x` |selectNumber|.
Then, only the values within the standard deviation or within multiple standard deviations
are considered for the color table. This is useful when you have one or two cells
with abnormally high values in a raster grid that are having a negative impact on
the rendering of the raster.

All calculations can also be made for the |radioButtonOff| :guilabel:`Current` extent.


.. tip:: **Viewing a Single Band of a Multiband Raster**

If you want to view a single band of a multiband
image (for example, Red), you might think you would set the Green and Blue
bands to "Not Set". But this is not the correct way. To display the Red band,
set the image type to 'Singleband gray', then select Red as the band to use
for Gray.
bands to :guilabel:`Not Set`. But this is not the correct way. To display the Red band,
set the image type to :ref:`Singleband gray <singleband_gray>`, then select Red
as the :guilabel:`Gray band` to use.


.. _paletted:

Expand All @@ -183,26 +172,19 @@ The label appears in the legend of the raster layer then.

Raster Symbology - Paletted Rendering

.. index:: Contrast enhancement

**Contrast enhancement**

.. note::
When adding GRASS rasters, the option *Contrast enhancement* will always be
set automatically to *stretch to min max*, regardless of if this is set to
another value in the QGIS general options.

.. _singleband_gray:

Singleband gray
...............

This renderer allows you to render a single band layer with a :guilabel:`Color gradient`:
'Black to white' or 'White to black'. You can define a :guilabel:`Min`
and a :guilabel:`Max` value by choosing the :guilabel:`Extent` first and
then pressing :guilabel:`Load`. QGIS can |radioButtonOn| :guilabel:`Estimate (faster)`
the :guilabel:`Min` and :guilabel:`Max` values of the bands or use the
|radioButtonOff| :guilabel:`Actual (slower)` :guilabel:`Accuracy`.
This renderer allows you to render a single band layer with a :guilabel:`Color
gradient`: 'Black to white' or 'White to black'. You can define a range of values
to color other than the default :guilabel:`Min` and :guilabel:`Max` values of the
whole raster, thanks to the :ref:`Min/Max Value Settings <minmaxvalues>` option.

Again, a :guilabel:`Contrast enhancement` method can be applied to the values:
'No enhancement', 'Stretch to MinMax', 'Stretch and clip to MinMax' and 'Clip to min max'.

.. _figure_raster_gray:

Expand All @@ -212,19 +194,6 @@ the :guilabel:`Min` and :guilabel:`Max` values of the bands or use the
Raster Symbology - Singleband gray rendering


With the :guilabel:`Load min/max values` section, scaling of the color table
is possible. Outliers can be eliminated using the |radioButtonOn| :guilabel:`Cumulative
count cut` setting.
The standard data range is set from 2% to 98% of the data values and can
be adapted manually. With this setting, the gray character of the image can disappear.
Further settings can be made with |radioButtonOff| :guilabel:`Min/max` and
|radioButtonOff| :guilabel:`Mean +/- standard deviation x` |selectNumber|.
While the first one creates a color table with all of the data included in the
original image, the second creates a color table that only considers values
within the standard deviation or within multiple standard deviations.
This is useful when you have one or two cells with abnormally high values in
a raster grid that are having a negative impact on the rendering of the raster.

.. index:: Color map, Color interpolation, Discrete
.. _label_colormaptab:

Expand All @@ -242,35 +211,12 @@ You can also create individual color maps for the single bands here.
Raster Symbology - Singleband pseudocolor rendering


Three types of color interpolation are available:

#. Discrete
#. Linear
#. Exact
Using a :guilabel:`Band` of the layer and its :ref:`values range set <minmaxvalues>`,
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
three types of color :guilabel:`Interpolation` are available:

You can choose the band on which QGIS will render the layer, then define
a :guilabel:`Min` and :guilabel:`Max` value.

Defining :guilabel:`Min/Max` values can be done with the help of the :guilabel:`Load min/max values` section.
A lot of images have a few very low and high data. These outliers can be eliminated
using the |radioButtonOn| :guilabel:`Cumulative count cut` setting. The standard
data range is set from 2% to 98% of the data values and can be adapted manually.

With this setting, the gray character of the image can disappear.
With the scaling option |radioButtonOn| :guilabel:`Min/max`, QGIS creates a color
table with all of the data included in the original image (e.g., QGIS creates a
color table with 256 values, given the fact that you have 8 bit bands).
You can also calculate your color table using the |radioButtonOn| :guilabel:`Mean +/-
standard deviation x` |selectNumber|.
Then, only the values within the standard deviation or within multiple standard deviations
are considered for the color table.

In the next part, :guilabel:`Interpolation` allows you to choose which
interpolation mode to use between:

* Discrete (a <= symbol appears in the value column);
* Linear;
* Exact (an equal symbol appears in the Value column);
* Discrete (a <= symbol appears in the value column)
* Linear
* Exact (an equal symbol appears in the Value column)

The :guilabel:`Color ramp` drop down list lists the color ramp in your QGIS. You
can add a new one, edit or save the one you changed. The name of the color ramp
Expand Down Expand Up @@ -300,6 +246,53 @@ defined color table for other sessions.
The |checkbox| :guilabel:`Clip out of range values` allows QGIS to not render pixel
greater than the :guilabel:`Max` value.


.. _minmaxvalues:

Setting the min and max values
..............................

By default, QGIS reports the :guilabel:`Min` and :guilabel:`Max` values of the band(s)
of the raster. A lot of images have a few very low and high data which can have a
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
negative impact on the rendering of the raster. The :ref:`Min/Max Value Settings
<minmaxvalues>` menu helps you control the values to render.

.. _figure_raster_minmaxvalues:

.. figure:: img/rasterMinMaxValues.png
:align: center

Raster Symbology - Min and Max Value Settings


Available options are:

* |radioButtonOff| :guilabel:`User defined`: Allows to manually override the default
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
:guilabel:`Min` and :guilabel:`Max` values of the band(s)
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
* |radioButtonOff| :guilabel:`Cumulative count cut`: Removes the outliers data.
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
The standard data range of the data values is set from ``2%`` to ``98%`` and can
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
be adapted manually. With this setting, the gray character of the image can disappear.
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
* |radioButtonOn| :guilabel:`Min/max`: Creates a color table with all of the
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
data included in the image (e.g., QGIS creates a color table with 256 values,
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
given the fact that you have 8 bit bands).
DelazJ marked this conversation as resolved.
Show resolved Hide resolved
* |radioButtonOff| :guilabel:`Mean +/- standard deviation x`: Creates a color
table that only considers values within the standard deviation or within multiple
standard deviations. This is useful when you have one or two cells with abnormally
high values in a raster grid that are having a negative impact on the rendering
of the raster.

Calculations of the min and max values of the bands are made based on the:

* :guilabel:`Statistics extent`: it can be :guilabel:`Whole raster`,
:guilabel:`Current canvas` or :guilabel:`Updated canvas`
* and the :guilabel:`Accuracy`, which can be either :guilabel:`Estimate (faster)`
or :guilabel:`Actual (slower)`.

.. note:: For some settings, you may need to press the :guilabel:`Apply` button of
the layer properties dialog in order to display the actual min and max values
in the widgets.


Color rendering
---------------

Expand Down