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 <dmorisse...@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@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@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to