[Geoserver-devel] [JIRA] (GEOS-7236) RasterSymbolizer: Interpretation of GammaValue inverted

Michael Scholz created an issue

GeoServer / BugGEOS-7236

RasterSymbolizer: Interpretation of GammaValue inverted

Issue Type:

BugBug

Affects Versions:

2.8.0

Assignee:

Unassigned

Components:

Documentation

Created:

08/Oct/15 6:34 PM

Environment:

Ubuntu 14.04 Server x64, Oracle Java 1.7, Native JAI

Labels:

SLD RasterSymbolizer gamma contrast

Priority:

MediumMedium

Reporter:

Michael Scholz

The current 2.8 and 2.9 documentations state that “<GammaValue> is a scaling factor that adjusts the brightness of the image. A value less than one (1) darkens the image, and a value greater than one (1) brightens it. The default is 1 (no change).” but I observe an inverted behaviour using this custom raster style on common imagery rgb-rasters:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
 xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" 
 xmlns="http://www.opengis.net/sld" 
 xmlns:ogc="http://www.opengis.net/ogc" 
 xmlns:xlink="http://www.w3.org/1999/xlink" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>raster_contrast</Name>
    <UserStyle>
      <Title>Raster Contrast Enhancement</Title>
      <Abstract>Raster style with custom contrast adjustment</Abstract>
      <FeatureTypeStyle>
        <Rule>
          <Name>rule1</Name>
          <Title>Opaque Raster</Title>
          <Abstract>A raster with 100% opacity and custom contrast</Abstract>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
            <ChannelSelection>
              <RedChannel>
                <SourceChannelName>1</SourceChannelName>
                <ContrastEnhancement>
                  <Normalize>
                    <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                    <VendorOption name="minValue">33</VendorOption>
                    <VendorOption name="maxValue">227</VendorOption>
                  </Normalize>
                  <GammaValue>0.6</GammaValue>
                </ContrastEnhancement>
              </RedChannel>
              <GreenChannel>
                <SourceChannelName>2</SourceChannelName>
                <ContrastEnhancement>
                  <Normalize>
                    <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                    <VendorOption name="minValue">44</VendorOption>
                    <VendorOption name="maxValue">225</VendorOption>
                  </Normalize>
                  <GammaValue>0.6</GammaValue>
                </ContrastEnhancement>                
              </GreenChannel>
              <BlueChannel>
                <SourceChannelName>3</SourceChannelName>
                <ContrastEnhancement>
                  <Normalize>
                    <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                    <VendorOption name="minValue">46</VendorOption>
                    <VendorOption name="maxValue">227</VendorOption>
                  </Normalize>
                  <GammaValue>0.6</GammaValue>
                </ContrastEnhancement>                
              </BlueChannel>
            </ChannelSelection>            
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

To brighten the image I have to use 0.6 which is less than 1.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v7.0.0-OD-07-011#70107-sha1:db940e9)

Atlassian logo