[Qgis-developer] error for QGIS tutorials in python - adding rasters to canvas

Martin Dobias wonder.sk at gmail.com
Thu Jan 31 16:11:00 EST 2008

On Jan 28, 2008 2:50 PM, Peter Ersts <ersts at amnh.org> wrote:
> But as far as the differences, one of the main difference is that the
> contrast enhancement process is done band by band and effectively
> returns one integer value between 0-255 per input pixel value while the
> shader returns three values or a "color". You could actually mimic a
> contrast enhancement for a gray scale image with a shader but not the
> other way around. In this first set of refactoring, the primary goal was
> to get the raster functionality operable and heading in a better
> direction. I had originally thought about making only one shader class
> that would do both color mapping as well as contrast enhancement;  that
> can still happen if there general consensus that it would make more sense.
> Deeper down there are some other differences. There is only one shader
> per raster layer but each band has a contrast enhancement. One of the
> reasons for this is that before there were min max values being stored
> in the QgsRasterLayer for each the red, green, blue and gray band. This
> did not work well when you have images with a lot of bands or want to
> switch between gray scale and RGB as you would have to manually reset
> the min max values along the way. Now, you can explore a single band as
> gray scale set your min max values, which are kept with the band, and
> when you switch back to RGB the min max values persist. It is very
> likely that the shader functionality will be extended so that each band
> has a shader rather than there being only one for the whole layer.

Thanks gain, I think I understand it now :)


More information about the Qgis-developer mailing list