[OpenLayers-Users] Applying filters to WMS-C images
Olivier Terral
olivier at geomatic.ch
Fri Jun 22 06:06:46 PDT 2012
Hi Laurent ,
I don't know what is your constraints in this project but if you use WMS and a Raster layer may be you should have look to SLD spec.
I know you can do that with geoserver : http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/rasters.html
and probably with all others WMS server that manages RatserSymbolizer and ColorMap.
Le 22 juin 2012 à 12:31, Laurent BAEY a écrit :
> Hi,
>
> I want to be able to use filters on images from a WMS-C layer (e.g.
> grayscale filter) and I want it cross browser.
>
> For now, I use this css properties, with a class I add on the tileloaded
> event :
>
> /* Chrome 19+ */
> -webkit-filter: grayscale(1);
> /* IE */
> -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)"
> filter: 'progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)';
> filter: gray();
> /* FF 3.5+ */
> filter: url("./resources.svg#desaturate");
>
> with resources.svg as follow :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <svg version="1.1"
> baseProfile="full"
> xmlns="http://www.w3.org/2000/svg">
> <filter id="desaturate">
> <feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0
> 0.3333 0.3333 0.3333 0 0
> 0.3333 0.3333 0.3333 0 0
> 0 0 0 1 0"/>
> </filter>
> </svg>
>
> This svg filter doen't work on images with chrome < 19 and safari, it
> needs to be an <image> svg element to work.
>
> Has anybody managed to display a WMS layer in a svg <image> element ? Or
> maybe grayscale images with any other method ?
>
> Note that I can't use the canvas method with the OL 2.11 version I have to
> use. (tile.getCanvasContext() doesn't exist)
>
> Thanks
>
> Laurent
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
Olivier Terral
GEOMATIC Ingénierie SA
Société du groupe Ringier
Chemin des Croisettes 26
1066 Epalinges
www.geomatic.ch
www.thevirtualcity.ch
Tél:: +41 (21) 651 30 00
Fax: +41 (21) 651 30 09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120622/2f1adc38/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.gif
Type: image/gif
Size: 5116 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120622/2f1adc38/attachment-0001.gif>
More information about the Users
mailing list