Hi,

Mapniks *-gamma-method defaults to "power" which means the transform pow(x, 
gamma) is applied to the original pixel value. I'd guess this is done before 
merging the color value to draw and the value currently stored in the pixel 
buffer. It's described as "producing slightly smoother line". I think 
technically this results in color values that are more nearby which might mean 
they computationally collapse to the same quantization value or are at least 
better compressable and therefore result in smaller image files. But might be 
wrong...

Greets, Andreas 

-----Ursprüngliche Nachricht-----
Von: Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi> 
Gesendet: Montag, 17. Mai 2021 16:14
An: Eichner, Andreas - SID <andreas.eich...@sid.sachsen.de>; Mapserver-Users 
(mapserver-users@lists.osgeo.org) <mapserver-users@lists.osgeo.org>
Betreff: Re: [mapserver-users] differing image size with different mapserver 
versions

Hi,

Does it mean that Mapnik is using the many settings called *-gamma with range 
0-1 for a shortcut to adjust both the gamma and corresponding gamma method by 
the same http://mapnik.org/mapnik-reference/?

The goal of this thread is not actually to turn of antialiasing but to create 
smaller files and decreasing the antialiasing effect could probably do that. 
The original sample image "mapserv64.png" is antialiased to my eyes. Do you 
think that adjusting the gamma value alone could have an effect on the file 
size?

-Jukka Rahkonen-


-----Alkuperäinen viesti-----
Lähettäjä: Eichner, Andreas - SID <andreas.eich...@sid.sachsen.de> 
Lähetetty: maanantai 17. toukokuuta 2021 16.53
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi>; 
Mapserver-Users (mapserver-users@lists.osgeo.org) 
<mapserver-users@lists.osgeo.org>
Aihe: AW: [mapserver-users] differing image size with different mapserver 
versions

Hi Jukka,

as a result of the discussion IMO Erik created a patch to be able to switch 
AGGs anti-aliasing on and off using the ANTIALIAS keyword. This was merged by 
Even Rouault in https://github.com/MapServer/MapServer/pull/6225
It originally worked IMHO only for lines styles. But GAMMA is __not__ the way 
to turn anti-aliasing off.

Greets, Andreas

-----Ursprüngliche Nachricht-----
Von: mapserver-users <mapserver-users-boun...@lists.osgeo.org> Im Auftrag von 
Rahkonen Jukka (MML)
Gesendet: Montag, 17. Mai 2021 15:26
An: Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi>; Mapserver-Users 
(mapserver-users@lists.osgeo.org) <mapserver-users@lists.osgeo.org>
Betreff: Re: [mapserver-users] differing image size with different mapserver 
versions

Hi,

 

Here is a long thread about turning off antialias 
http://osgeo-org.1560.x6.nabble.com/Draw-roads-WITHOUT-anti-aliasing-td5338614.html
 
<http://osgeo-org.1560.x6.nabble.com/Draw-roads-WITHOUT-anti-aliasing-td5338614.html>
 .

 

I had the same wrong idea about gamma=0 back then but perhaps gamma=0.01 could 
work.

 

-Jukka Rahkonen-

 

Lähettäjä: mapserver-users <mapserver-users-boun...@lists.osgeo.org> Puolesta 
Rahkonen Jukka (MML)
Lähetetty: maanantai 17. toukokuuta 2021 16.06
Vastaanottaja: Mapserver-Users (mapserver-users@lists.osgeo.org) 
<mapserver-users@lists.osgeo.org>
Aihe: Re: [mapserver-users] differing image size with different mapserver 
versions

 

Hi,

 

(Re-sent as edited to mailing list because the body was originally too long.

 

Are you sure about “I actually found that 6.4 produced small, aliased images 
with both the GD and AGG drivers”.  Originally the AGG library could only do 
anti-aliasing and that affected also Mapserver 5 
https://lists.osgeo.org/pipermail/mapserver-users/2007-September/025467.html 
<https://lists.osgeo.org/pipermail/mapserver-users/2007-September/025467.html> .

 

I guess that Mapnik folks have since that added support for controlling 
anti-aliasing with gamma setting http://mapnik.org/mapnik-reference/.

I can see that gamma can be used also with Mapserver 
https://www.mapserver.org/mapfile/outputformat.html

 

Have a try with gamma=0. However, Even wrote that turning off antialiasing is 
possible only in master, so perhaps gamma=0 does not work.

 

The documentation for Mapserver 5 tells that “All ANTIALIAS keywords are now 
ignored". But the keyword still appears in quite a many places:

https://mapserver.org/search.html?q=antialias

 

Would it be time to remove them as well as now not useful references to GD 
renderer (removed by RFC 99 in 2013)?

 

-Jukka Rahkonen-

 

 

Lähettäjä: mapserver-users <mapserver-users-boun...@lists.osgeo.org 
<mailto:mapserver-users-boun...@lists.osgeo.org> > Puolesta Richard Greenwood
Lähetetty: maanantai 17. toukokuuta 2021 15.26
Kopio: mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> 
Aihe: Re: [mapserver-users] differing image size with different mapserver 
versions

 

Thanks for the suggestions. The consensus seems to be that anti-aliasing is 
causing the increased size. The documentation here 
<https://mapserver.org/output/antialias.html>  says "Since version 6.0, 
MapServer will produce aliased output for the “gd/” drivers, and antialiased 
output for the “agg/” and “cairo/” ones" and it's also mentioned here 
<https://lists.osgeo.org/pipermail/mapserver-users/2012-April/072011.html>  in 
Thomas Bonfort's reply. I actually found that 6.4 produced small, aliased 
images with both the GD and AGG drivers and regardless of my ANTIALIAS 
true/false setting. 

 

Would anyone consider re-enabling the ANTIALIAS true/false option?

 

Thanks,

Rich

 

 

 

 

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to