<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Richard,<br></div><div><br></div><div>In your OUTPUTFORMAT declaration maybe try setting the DRIVER to <b>AGG/PNG8</b><br></div><div>Also IMAGEMODE PC256 was only for GD support that was removed in 7.0. Try IMAGEMODE RGB (or RGBA if you want transparency). <br></div><div><br></div><div>Seth<br></div><div><br></div><div>--<br></div><div id="sig62266145"><div class="signature">web:http://geographika.co.uk<br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div><br></div><div>On Sat, May 15, 2021, at 8:00 PM, Richard Greenwood wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div>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. <br></div><div><span class="font" style="font-family:monospace;"> CLASS<br> STYLE<br> COLOR 255 255 208<br> ANTIALIAS ON<br> END<br> END</span></div><div>Again, thank you for your suggestions.<br></div><div>Rich<br></div></div><div><br></div><div class="qt-gmail_quote"><div dir="ltr" class="qt-gmail_attr">On Sat, May 15, 2021 at 11:21 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div><div>A<span>ctually, 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.</span> <br></div><p><span>Looking more closely at </span><span><span>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.</span></span><br></p><div>Le 15/05/2021 à 19:07, Richard
Greenwood a écrit :<br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Even, <br></div><div><br></div><div>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. <br></div><div><br></div><div>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. <br></div><div><br></div><div>In any case, thanks again.<br></div><div>Rich<br></div><div><br></div><div><br></div></div><div><br></div><div class="qt-gmail_quote"><div dir="ltr" class="qt-gmail_attr">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:<br></div><blockquote class="qt-gmail_quote"><div><p>Richard,<br></p><p>your 6.4 image is a interlaced PNG, whereas the 7.6 is
a non-interlaced one.<br></p><p>I see in the git history a relevant commit:<br></p><p><br></p><div>$ git show 9984b39cc8f74d60eb240728df660a172a118aad<br></div><div> commit 9984b39cc8f74d60eb240728df660a172a118aad<br></div><div> Author: Thomas Bonfort <a href="mailto:thomas.bonfort@gmail.com" target="_blank"><thomas.bonfort@gmail.com></a><br></div><div> Date: Sun Oct 5 15:59:44 2008 +0000<br></div><div> <br></div><div> rgba_png: don't interlace by default<br></div><div> <br></div><div> <br></div><div> 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<br></div><div> <br></div><div> diff --git a/maprgbapng.c b/maprgbapng.c<br></div><div> index 105d8d61..c3615edd 100644<br></div><div> --- a/maprgbapng.c<br></div><div> +++ b/maprgbapng.c<br></div><div> @@ -357,10 +357,13 @@ int
msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx *ctx,
outputFormatObj *form<br></div><div> int bot_idx, top_idx;<br></div><div> int remap[256];<br></div><div> int reqcolors = atoi(msGetOutputFormatOption(
format, "QUANTIZE_COLORS", "256"));<br></div><div> + const char *interlace;<br></div><div> ms_png_info info;<br></div><div> info.width = gdImageSX(img);<br></div><div> info.height = gdImageSY(img);<br></div><div> - if( strcasecmp("ON", msGetOutputFormatOption(
format, "INTERLACE", "ON" )) == 0 )<br></div><div> + interlace = msGetOutputFormatOption( format,
"INTERLACE", "OFF" );<br></div><div> + if( strcasecmp("ON", interlace) == 0 ||
strcasecmp("YES", interlace) == 0<br></div><div> + || strcasecmp("1", interlace) == 0)<br></div><div> info.interlaced=1;<br></div><div> else<br></div><div> info.interlaced=0;<br></div><p><br></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.<br></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.<br></p><p>Even<br></p><p><br></p><div>Le 15/05/2021 à 17:43, Richard Greenwood a écrit :<br></div><blockquote type="cite"><div dir="ltr"><div>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. <br></div><div><div><br></div><div><div>OUTPUTFORMAT<br></div><div> NAME "png-test"<br></div><div> DRIVER "AGG/PNG" # GD driver is same (6.4 only)<br></div><div> MIMETYPE "image/png; mode=8bit"<br></div><div> IMAGEMODE PC256<br></div><div> FORMATOPTION "QUANTIZE_FORCE=on"<br></div><div> FORMATOPTION "QUANTIZE_COLORS=256"<br></div><div> EXTENSION "png"<br></div><div> # TRANSPARENT on or off makes little difference<br></div><div> END<br></div></div><div><br></div><div><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?<br></div><div><br></div><div>Thanks,<br></div><div>Rich<br></div></div><div><br></div><div>-- <br></div><div> <br></div><div dir="ltr"><div dir="ltr"><div>Richard W. Greenwood, PLS<br></div><div> <a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><br></div></div></div></div><div><br></div><pre>_______________________________________________
mapserver-users mailing list
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
<br></pre></blockquote><pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.<br></pre></div></blockquote></div><div><br></div><div><br></div><div>-- <br></div><div> <br></div><div dir="ltr"><div dir="ltr"><div>Richard W. Greenwood, PLS<br></div><div> <a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><br></div></div></div></div></blockquote><pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.<br></pre></div></blockquote></div><div><br></div><div><br></div><div>-- <br></div><div dir="ltr" class="qt-gmail_signature"><div dir="ltr"><div>Richard W. Greenwood, PLS<br></div><div><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><br></div></div></div><div>_______________________________________________<br></div><div>mapserver-users mailing list<br></div><div><a href="mailto:mapserver-users%40lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></body></html>