Re: [Geotools-devel] Hue Rotate for Rasters

2017-07-20 Thread Torben Barsballe
On Thu, Jul 20, 2017 at 12:06 AM, Ian Turton  wrote:

> I think that how you expose this to the user depends on what you or they
> think the process is going to be used for.
>
> I lean towards the rendering transformation as I see it as a process to
> transform a raster into another one rather than an enhancement of the
> raster. But I'm not a raster expert and I've never come across this type of
> transformation before.
>
>
To provide a bit of an alternate viewpoint, in the places I have seen
hue-rotate used it has been the same type of operation as
brightness/contrast or changing the saturation. This has generally not been
in a GeoSpatial context however, just general image transformations.

Given that we are using a ContrastEnhancement for brightness / contrast, I
could completely understand using a similar Color Enhancement for hue
rotate.

That said, I'm sure a rendering transform would be fine too.

Torben
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] [JIRA] (GEOT-5786) Create functionality for Hue Rotate for rasters

2017-07-20 Thread John Schulz (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 John Schulz created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 GeoTools /  GEOT-5786  
 
 
  Create functionality for Hue Rotate for rasters   
 

  
 
 
 
 

 
Issue Type: 
  Improvement  
 
 
Assignee: 
 John Schulz  
 
 
Created: 
 20/Jul/17 3:26 PM  
 
 
Priority: 
  Medium  
 
 
Reporter: 
 John Schulz  
 

  
 
 
 
 

 
 Copied from email list conversation: To all, I am wanting to move forward with creating a proposal for an implementation to extend functionality for HueRotate and Saturation for rasters. As stated by Torben the basic idea would be to take an image and convert it to the HSV or HSL color space and rotate the hue of each pixel by the same degree across the entire image, keeping the relative appearance in tact. A good example can be found here:  http://crawlingrobotfortress.blogspot.ca/2013/06/optimizing-hue-rotation-operator.html In this discussion I believe there are two feasible approaches and was looking for any additional input in deciding the best way to move forward with the proposal. 1. Create a new rendering transformation option. This approach would be considered a raster-to-raster transformation and would require creating and executing a new process and operation/function and extending its use to the  SLD. 2. Create a new normalization process for colors similar to the Contrast Enhancement normalization, extending the RasterSymbolizer elements. I feel that this option could be implemented in a couple of different ways as well. a. Extend the algorithm vendor option to include HueRotate and Saturation algorithms for Normalize within Contrast Enhancement. b. Create a new SLD element "ColorEnhancement" to follow in a similar fashion as Contrast Enhancement and the Normalize, but specifically altering the colorspace. Any additional thoughts would be appreciated, Thanks, John  
 

  
 
 
  
 

 
 
  

Re: [Geotools-devel] Hue Rotate for Rasters

2017-07-20 Thread Ian Turton
I think that how you expose this to the user depends on what you or they
think the process is going to be used for.

I lean towards the rendering transformation as I see it as a process to
transform a raster into another one rather than an enhancement of the
raster. But I'm not a raster expert and I've never come across this type of
transformation before.

Ian

On 19 Jul 2017 18:00, "John Schulz"  wrote:

To all,

I am wanting to move forward with creating a proposal for an implementation
to extend functionality for HueRotate and Saturation for rasters.  As
stated by Torben the basic idea would be to take an image and convert it to
the HSV or HSL  color space and
rotate the hue of each pixel by the same degree across the entire image,
keeping the relative appearance in tact.  A good example can be found here:

http://crawlingrobotfortress.blogspot.ca/2013/06/optimizing-hue-rotation-
operator.html

In this discussion I believe there are two feasible approaches and was
looking for any additional input in deciding the best way to move forward
with the proposal.

1.  Create a new rendering transformation

option.  This approach would be considered a raster-to-raster
transformation and would require creating and executing a new process and
operation/function and extending its use to the  SLD.

2.  Create a new normalization process for colors similar to the Contrast
Enhancement

normalization, extending the RasterSymbolizer elements.  I feel that this
option could be implemented in a couple of different ways as well.
a. Extend the algorithm vendor option to include HueRotate and
Saturation algorithms for Normalize within Contrast Enhancement.
b. Create a new SLD element "ColorEnhancement" to follow in a similar
fashion as Contrast Enhancement and the Normalize, but specifically
altering the colorspace.

Any additional thoughts would be appreciated,

Thanks,

John

On Fri, Jul 14, 2017 at 5:49 PM, Torben Barsballe <
tbarsba...@boundlessgeo.com> wrote:

> Hi Ian,
>
> Here are a couple of references that deal with implementing Hue-Rotate:
>
> https://beesbuzz.biz/code/hsv_color_transforms.php
> http://crawlingrobotfortress.blogspot.ca/2013/06/optimizing-
> hue-rotation-operator.html
>
> The basic idea is you have an image in the HSV
>  colour space, and you change
> the increment the Hue of each pixel by some amount. This has the effect of
> "rotating" the hue of the image as a whole.
>
> It is a fairly common transform in most graphical programs (like GIMP or
> Photoshop).
>
> Torben
>
> On Fri, Jul 14, 2017 at 1:59 PM, Jody Garnett 
> wrote:
>
>> Thanks for the correction Andrea, this would be a raster-to-raster
>> rendering transform, or a new normalization algorithm.
>>
>> Ian - Hue rotate is used when an image has been produced with
>> complementary colours (in a colour wheel sense). If you can image spinning
>> the color wheel while leaving the everything in the same relative position.
>> It is used in video games for example to reuse graphic assets. Torben had a
>> good reference if we ask him.
>>
>>
>>
>>
>> --
>> Jody Garnett
>>
>> On 14 July 2017 at 13:18, Andrea Aime 
>> wrote:
>>
>>> Ian,
>>> Jody is calling them geometry transformations, but he really means
>>> rendering transformations (geometry transformation
>>> is the act of applying a function inside the geometry tag for the
>>> current vector feature, has nothing to do with rasters):
>>>
>>> http://docs.geoserver.org/stable/en/user/styling/sld/extensi
>>> ons/geometry-transformations.html
>>> http://docs.geoserver.org/stable/en/user/styling/sld/extensi
>>> ons/rendering-transform.html
>>>
>>> Cheers
>>> Andrea
>>>
>>> On Fri, Jul 14, 2017 at 9:25 PM, Ian Turton  wrote:
>>>
 Could you please expand on what hue rotate does? I'm not sure if I
 understand it well enough to decide if it is an image operation or a
 geometry operation.

 Ian

 On 14 Jul 2017 18:15, "Jody Garnett"  wrote:

 ShadedRelief was the only other thing I could think of, in SLD spec
 directly.

 We also have our geoserver specific extension for geometry
 transformations. We have to ask someone here if that can be used to
 introduce the colorSpace operation
  to
 HSV and then a bandcombine operation
  for
 the color rotation in an efficient manner for rendering.

 --
 Jody Garnett

 On 14 July 2017 at 09:04, John Schulz  wrote: