Skip to content
Permalink
Browse files

fix formula in brightnesscontrast filter for rasters with opacity (fix

  • Loading branch information
alexbruy authored and nyalldawson committed Jul 10, 2020
1 parent 4713c7a commit 81518f962e981726ddd132fce91842b430230f85
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/raster/qgsbrightnesscontrastfilter.cpp
@@ -183,7 +183,7 @@ int QgsBrightnessContrastFilter::adjustColorComponent( int colorComponent, int a
double adjustedColor = colorComponent / alphaFactor;

// Make sure to return a premultiplied color
return alphaFactor * qBound( 0., std::pow( ( ( ( ( ( ( adjustedColor / 255.0 ) - 0.5 ) * contrastFactor ) + 0.5 ) * 255 ) + brightness ) / 255, gammaCorrection ), 255. );
return alphaFactor * qBound( 0., 255 * std::pow( ( ( ( ( ( ( adjustedColor / 255.0 ) - 0.5 ) * contrastFactor ) + 0.5 ) * 255 ) + brightness ) / 255, gammaCorrection ), 255. );
}
}

0 comments on commit 81518f9

Please sign in to comment.
You can’t perform that action at this time.