<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.font
{mso-style-name:font;}
span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;}
span.Shkpostityyli23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I made a few tests with IrfanView and Gimp and it seems that the both images are antialized but the mapserv76 version is more fine-grained. The mapserv64 version has also less unique
colors, 217 vs 250 colors. Saving the mapserv76 image with IrfanView or Gimp by using different settings does not reduce the file size much so the image obviously really has more details. Interlace mode (adam7) in Gimp made the image even bigger.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">The visual quality of mapserv76.png is not so much better that it would justify the doubled file size. At least the area with dense rectangles on the right look better in mapserv64.png.
But I fear that for any systematic further studies you should prepare a test case with source data and mapfile. There are very many small rectangles in the image and it may be that different antializing near the narrow black lines makes the difference. It
would be interesting to test the output size with more typical maps.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> mapserver-users <mapserver-users-bounces@lists.osgeo.org>
<b>Puolesta </b>Seth G<br>
<b>Lähetetty:</b> maanantai 17. toukokuuta 2021 11.27<br>
<b>Vastaanottaja:</b> Richard Greenwood <richard.greenwood@gmail.com><br>
<b>Kopio:</b> mapserver-users@lists.osgeo.org<br>
<b>Aihe:</b> Re: [mapserver-users] differing image size with different mapserver versions<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Richard,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In your OUTPUTFORMAT declaration maybe try setting the DRIVER to
<b>AGG/PNG8</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Also IMAGEMODE PC256 was only for GD support that was removed in 7.0. Try IMAGEMODE RGB (or RGBA if you want transparency).
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Seth<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
</div>
<div id="sig62266145">
<div>
<p class="MsoNormal">web:http://geographika.co.uk<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">twitter: @geographika<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On Sat, May 15, 2021, at 8:00 PM, Richard Greenwood wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" id="qt">
<div>
<div>
<p class="MsoNormal">I built from main and tested with ANTIALIAS ON and ANTIALIAS OFF. Assuming that my mapfile syntax below is correct, there is no difference in size and the resulting PNG is still approximately 3x larger than the MapServer 6.4 one.
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="font"><span style="font-family:"Courier New""> CLASS</span></span><span style="font-family:"Courier New""><br>
<span class="font"> STYLE</span><br>
<span class="font"> COLOR 255 255 208</span><br>
<span class="font"> ANTIALIAS ON</span><br>
<span class="font"> END</span><br>
<span class="font"> END</span></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Again, thank you for your suggestions.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Rich<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">On Sat, May 15, 2021 at 11:21 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Actually, I just tried to open mapserv64.png with gimp, and export it as a non-interlaced or interlaced PNG. And the non-interlaced version is 60 kB vs 96 kB for interlaced. So interlacing vs non-interlacing isn't the cause here.
<o:p></o:p></p>
</div>
<p>Looking more closely at mapserv64.png vs mapserv76.png , they are visually different. I suspect the rendering to be of higher quality in 7.6 due to anti-aliasing and perhaps better quantization to 8-bit. You could perhaps try to turn off antialiasing in
your CLASS.STYLE. This has been re-vived very recently for AGG line rendering. It is master only however.<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 15/05/2021 à 19:07, Richard Greenwood a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal">Even, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you. I had ignored the difference in the interlacing of the two images because I didn't think it would have affected the size. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The maprgbapng.c file no longer exists in MapServer 6.4 or 7.6. There is an "if ( interlaced ..." code block in mapoutput.c that is the same in 6.4 and 7.6. I tried forcing it ON and rebuilding 7.6 but the output image still is not interlaced.
Maybe that code is just a left over. Or maybe AGG doesn't support interlacing as
<a href="https://www.mapserver.org/mapfile/outputformat.html" target="_blank">https://www.mapserver.org/mapfile/outputformat.html</a> seems to suggest. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In any case, thanks again.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Rich<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">On Sat, May 15, 2021 at 9:59 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p>Richard,<o:p></o:p></p>
<p>your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced one.<o:p></o:p></p>
<p>I see in the git history a relevant commit:<o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">$ git show 9984b39cc8f74d60eb240728df660a172a118aad<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">commit 9984b39cc8f74d60eb240728df660a172a118aad<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Author: Thomas Bonfort <a href="mailto:thomas.bonfort@gmail.com" target="_blank">
<thomas.bonfort@gmail.com></a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Date: Sun Oct 5 15:59:44 2008 +0000<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> rgba_png: don't interlace by default<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> git-svn-id: <a href="http://svn.osgeo.org/mapserver/trunk@7960" target="_blank">
http://svn.osgeo.org/mapserver/trunk@7960</a> 7532c77e-422f-0410-93f4-f0b67bdd69e2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">diff --git a/maprgbapng.c b/maprgbapng.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">index 105d8d61..c3615edd 100644<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">--- a/maprgbapng.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+++ b/maprgbapng.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">@@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx *ctx, outputFormatObj *form<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> int bot_idx, top_idx;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> int remap[256];<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> int reqcolors = atoi(msGetOutputFormatOption( format, "QUANTIZE_COLORS", "256"));<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ const char *interlace;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> ms_png_info info;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> info.width = gdImageSX(img);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> info.height = gdImageSY(img);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE", "ON" )) == 0 )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", interlace) == 0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">+ || strcasecmp("1", interlace) == 0)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> info.interlaced=1;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> else<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> info.interlaced=0;<o:p></o:p></p>
</div>
<p><o:p> </o:p></p>
<p>But this predates 6.4 release by several years, so this doesn't explain why you see a different behavior, unless something in 6.4 still turned on interlacing on in that configuration.<o:p></o:p></p>
<p>From what I can see in the doc, the interlacing mode was removed in the 7.0 release when GD went off, so I don't think you can do much. I guess that could be re-added but would require some coding.<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">Le 15/05/2021 à 17:43, Richard Greenwood a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">I get significantly different image sizes between MapServer 6.4 and 7.6 with the same output format definition. I've tried many variations of the following.
<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">OUTPUTFORMAT<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> NAME "png-test"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> DRIVER "AGG/PNG" # GD driver is same (6.4 only)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> MIMETYPE "image/png; mode=8bit"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> IMAGEMODE PC256<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> FORMATOPTION "QUANTIZE_FORCE=on"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> FORMATOPTION "QUANTIZE_COLORS=256"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> EXTENSION "png"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # TRANSPARENT on or off makes little difference<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">END<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://greenwoodmap.com/mapserv64.png" target="_blank">MapServer 6.4</a> is 90kB,
<a href="https://greenwoodmap.com/mapserv76.png" target="_blank">MapServer 7.6</a> is 320kB. Any suggestions as to how I can get my MapServer 7.6 image sizes down closer to what I'm getting in MapServer 6.4?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Rich<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Richard W. Greenwood, PLS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>mapserver-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Richard W. Greenwood, PLS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Richard W. Greenwood, PLS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal">_______________________________________________<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">mapserver-users mailing list<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="mailto:mapserver-users%40lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>