those artifacts are most likely due to jpeg compression. you can force the output to be aliased and contain only your requested colors by hand crafting a special palette; search the docs for "formatoption + palette" Thomas
Le mer. 1 août 2018 à 16:32, Luke Wendling <[email protected]> a écrit : > Mapserver version 7.1 > > Hi, To create a bitmask image (for computer vision model training), I'm > creating a mapserver vector layer with TYPE POLYGON and setting the map > IMAGECOLOR as 0 0 0. The Layer config is > CLASS > STYLE > COLOR 255 255 255 > ANTIALIAS false > > However the resulting raster image has gray spots as shown below: > > [image: image.png] > > I'm less concerned about the outer edge (maybe antialiasing?) and more > interested in the inner gray areas. Can anyone help explain what's > happening or give pointers on how to create a proper bitmask (all black or > white)? > > Full mapfile is below > > > MAP > NAME valid > STATUS ON > PROJECTION > "init=epsg:4326" > END > > IMAGECOLOR 0 0 0 > > # Register the image/tiff format so we can return 4 band images. > OUTPUTFORMAT > NAME GEOTIFF > DRIVER "GDAL/GTiff" > MIMETYPE "image/tiff" > IMAGEMODE BYTE > EXTENSION "tif" > FORMATOPTION "ALPHA=UNSPECIFIED" > FORMATOPTION "TILED=YES" > {# FORMATOPTION "COMPRESS=JPEG" #} > END > > CONFIG "AWS_ACCESS_KEY_ID" "{{ AWS_ACCESS_KEY_ID }}" > CONFIG "AWS_SECRET_ACCESS_KEY" "{{ AWS_SECRET_ACCESS_KEY }}" > CONFIG "DEFAULT_REGION" "{{ DEFAULT_REGION }}" > > WEB > METADATA > "wms_title" "Slingshot WMS Server" > "wms_onlineresource" "{{ wms_onlineresource }}" > "wms_enable_request" "GetCapabilities GetMap GetFeatureInfo" > "wms_srs" "EPSG:4326 EPSG:3857" > END > END > > {% for layer in layers %} > # =========== {{layer.title}} =========== > {% if layer.is_vector %} > LAYER > NAME "{{ layer.name }}" > STATUS ON > TYPE POLYGON > {{ layer_params(layer) }} > CONNECTIONTYPE POSTGIS > CONNECTION "host={{db.host}} port={{db.port}} dbname={{db.name}} user={{db > .user}} password={{db.password}}" > {% if 'sql' in layer.metadata.mapserver %} > DATA "geometry from ({{ layer.metadata.mapserver.sql }}) as geometry > using unique id" > {% else %} > DATA "geometry from (select v.geometry, v.id from images_vector v inner > join images_provider p on (v.source_id = p.id) where p.name = '{{ layer. > metadata.provider }}') as geometry using unique id" > {% endif %} > PROJECTION > "init=epsg:4326" > END > CLASS > STYLE > COLOR 255 255 255 > ANTIALIAS false > END > END > END > {% endif %} > {% endfor %} > > END > > _______________________________________________ > mapserver-users mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________ mapserver-users mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/mapserver-users
