[mapserver-users] Recoloring a raster...

Steve Lime sdlime at gmail.com
Thu Sep 16 12:16:58 PDT 2021


No, you didn't misunderstand, that's what I was looking for (duh)...
However, I get really inconsistent behavior using that method. Partially
because upon closer inspection my RGB has more than 6 colors
(anti-aliasing). Still large blocks of pixels don't match when using an
expression like ([red] = 255 AND [green] = 0 AND [blue] = 0) even though
they should, based on inspection with a tool like Photoshop. I figured out
a workaround.

On Thu, Sep 16, 2021 at 12:26 PM Daniel Morissette <dmorissette at mapgears.com>
wrote:

> Maybe I misunderstood the question, is it not what raster class
> expressions are for?
>
> https://mapserver.org/input/raster.html#classifying-rasters
>
>    CLASS
>      NAME "red -> blue"
>      EXPRESSION ([red] = 255 AND [green] = 0 AND [blue] = 0)
>      STYLE
>        COLOR 0 0 255
>      END
>    END
>
>
> On 2021-09-16 12:46, Steve Lime wrote:
> > Hi all: I think this is possible. What's the easiest/best way to recolor
> > a raster image, so for example, turning all pixels of 255 0 0 to 0 0
> > 255? There are only 6 colors in the input image I need to deal with.
> >
> > --Steve
> >
> > _______________________________________________
> > MapServer-users mailing list
> > MapServer-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
>
> --
> Daniel Morissette
> Mapgears Inc
> T: +1 418-696-5056 #201
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210916/719262ae/attachment.htm>


More information about the MapServer-users mailing list