Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Eichner, Andreas - SID
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)  
Gesendet: Montag, 17. Mai 2021 16:14
An: Eichner, Andreas - SID ; Mapserver-Users 
(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  
Lähetetty: maanantai 17. toukokuuta 2021 16.53
Vastaanottaja: Rahkonen Jukka (MML) ; 
Mapserver-Users (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  Im Auftrag von 
Rahkonen Jukka (MML)
Gesendet: Montag, 17. Mai 2021 15:26
An: Rahkonen Jukka (MML) ; Mapserver-Users 
(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  Puolesta 
Rahkonen Jukka (MML)
Lähetetty: maanantai 17. toukokuuta 2021 16.06
Vastaanottaja: Mapserver-Users (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 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 actuall

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Rahkonen Jukka (MML)
Good news.

There seems to be more to fix in the documentation about ANTIALIAS but who 
understands how it works now in master with lines, polygons, and labels?

-Jukka Rahkonen-

Lähettäjä: Richard Greenwood 
Lähetetty: maanantai 17. toukokuuta 2021 17.11
Vastaanottaja: Eichner, Andreas - SID 
Kopio: Rahkonen Jukka (MML) ; 
Mapserver-Users (mapserver-users@lists.osgeo.org) 

Aihe: Re: [mapserver-users] differing image size with different mapserver 
versions

Progress! Using Andreas' suggestion:

changing the typedef in line 91 of mapagg.cpp from
  typedef mapserver::renderer_scanline_aa_solid 
renderer_scanline;
to
  typedef mapserver::renderer_scanline_bin_solid 
renderer_scanline;

My test image went from 127kB down to 23.3kB!

Rich

On Mon, May 17, 2021 at 7:58 AM Eichner, Andreas - SID 
mailto:andreas.eich...@sid.sachsen.de>> wrote:
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 
mailto:mapserver-users-boun...@lists.osgeo.org>>
 Im Auftrag von Rahkonen Jukka (MML)
Gesendet: Montag, 17. Mai 2021 15:26
An: Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>;
 Mapserver-Users 
(mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>) 
mailto: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 
mailto: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<mailto:mapserver-users@lists.osgeo.org>) 
mailto: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 
mailto:mapserver-users-boun...@lists.osgeo.org>
 
<mailto: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> 
<mailto: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
mapse

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Rahkonen Jukka (MML)
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  
Lähetetty: maanantai 17. toukokuuta 2021 16.53
Vastaanottaja: Rahkonen Jukka (MML) ; 
Mapserver-Users (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  Im Auftrag von 
Rahkonen Jukka (MML)
Gesendet: Montag, 17. Mai 2021 15:26
An: Rahkonen Jukka (MML) ; Mapserver-Users 
(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  Puolesta 
Rahkonen Jukka (MML)
Lähetetty: maanantai 17. toukokuuta 2021 16.06
Vastaanottaja: Mapserver-Users (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 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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Richard Greenwood
Progress! Using Andreas' suggestion:




*changing the typedef in line 91 of mapagg.cpp from  typedef
mapserver::renderer_scanline_aa_solid renderer_scanline;to
typedef mapserver::renderer_scanline_bin_solid
renderer_scanline;*

My test image went from 127kB down to 23.3kB!

Rich

On Mon, May 17, 2021 at 7:58 AM Eichner, Andreas - SID <
andreas.eich...@sid.sachsen.de> wrote:

> 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  Im Auftrag
> von Rahkonen Jukka (MML)
> Gesendet: Montag, 17. Mai 2021 15:26
> An: Rahkonen Jukka (MML) ;
> 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 
> 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  <mailto:mapserver-users-boun...@lists.osgeo.org> > Puolesta Richard
> Greenwood
> Lähetetty: maanantai 17. toukokuuta 2021 15.26
> Kopio: mapserver-users@lists.osgeo.org  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
>


-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Eichner, Andreas - SID
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  Im Auftrag von 
Rahkonen Jukka (MML)
Gesendet: Montag, 17. Mai 2021 15:26
An: Rahkonen Jukka (MML) ; Mapserver-Users 
(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  Puolesta 
Rahkonen Jukka (MML)
Lähetetty: maanantai 17. toukokuuta 2021 16.06
Vastaanottaja: Mapserver-Users (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 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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Richard Greenwood
On Mon, May 17, 2021 at 7:05 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> Are you sure about “I actually found that 6.4 produced small, aliased
> images with both the GD and AGG drivers”.
>

Yes, I just tested again. In 6.4 I get identical (visually and size) images
with:
   OUTPUTFORMAT
  DRIVER "AGG/PNG" or "GD/PNG".
  . . .

Interestingly, "GD/PNG" does not throw an error in mapserver 7.6 or main
(MapServer 7.7).


> 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
> .
>
>
>
> 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.
>

I tried
   OUTPUTFORMAT
  FORMATOPTION "GAMMA=0"
   . . .

I see no difference in the output image in 7.7 (main) or 7.6 or 6.4. Is my
syntax correct?


>
>  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)?
>

>From my testing it seems that <=6.4 is aliased and >=7.0 is antialiased
regardless of ANTIALIAS options.


> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* mapserver-users  
> *Puolesta
> *Richard Greenwood
> *Lähetetty:* maanantai 17. toukokuuta 2021 15.26
> *Kopio:* 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
>


-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Rahkonen Jukka (MML)
Hi,

Here is a long thread about turning off antialias 
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  Puolesta 
Rahkonen Jukka (MML)
Lähetetty: maanantai 17. toukokuuta 2021 16.06
Vastaanottaja: Mapserver-Users (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.

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 
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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Rahkonen Jukka (MML)
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.

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 
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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Richard Greenwood
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




On Mon, May 17, 2021 at 3:40 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* mapserver-users  
> *Puolesta
> *Seth G
> *Lähetetty:* maanantai 17. toukokuuta 2021 11.27
> *Vastaanottaja:* Richard Greenwood 
> *Kopio:* mapserver-users@lists.osgeo.org
> *Aihe:* Re: [mapserver-users] differing image size with different
> mapserver versions
>
>
>
> Hi Richard,
>
>
>
> In your OUTPUTFORMAT declaration maybe try setting the DRIVER to
> *AGG/PNG8*
>
> Also  IMAGEMODE PC256 was only for GD support that was removed in 7.0. Try
> IMAGEMODE RGB (or RGBA if you want transparency).
>
>
>
> Seth
>
>
>
> --
>
> web:http://geographika.co.uk
>
> twitter: @geographika
>
>
>
>
>
> On Sat, May 15, 2021, at 8:00 PM, Richard Greenwood wrote:
>
> 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.
>
>   CLASS
> STYLE
>   COLOR 255 255 208
>   ANTIALIAS ON
> END
>   END
>
> Again, thank you for your suggestions.
>
> Rich
>
>
>
> On Sat, May 15, 2021 at 11:21 AM Even Rouault 
> wrote:
>
> 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.
>
> 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.
>
> Le 15/05/2021 à 19:07, Richard Greenwood a écrit :
>
> Even,
>
>
>
> 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.
>
>
>
> 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
> https://www.mapserver.org/mapfile/outputformat.html seems to suggest.
>
>
>
> In any case, thanks again.
>
> Rich
>
>
>
>
>
>
>
> On Sat, May 15, 2021 at 9:59 AM Even Rouault 
> wrote:
>
> Richard,
>
> your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced
> one.
>
> I see in the git history a relevant commit:
>
>
>
> $ git show 9984b39cc8f74d60eb240728df660a172a118aad
>
> commit 9984b39cc8f74d60eb240728df660a172a118aad
>
> Aut

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Rahkonen Jukka (MML)
Hi,

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.

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.

-Jukka Rahkonen-

Lähettäjä: mapserver-users  Puolesta 
Seth G
Lähetetty: maanantai 17. toukokuuta 2021 11.27
Vastaanottaja: Richard Greenwood 
Kopio: mapserver-users@lists.osgeo.org
Aihe: Re: [mapserver-users] differing image size with different mapserver 
versions

Hi Richard,

In your OUTPUTFORMAT declaration maybe try setting the DRIVER to AGG/PNG8
Also  IMAGEMODE PC256 was only for GD support that was removed in 7.0. Try 
IMAGEMODE RGB (or RGBA if you want transparency).

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Sat, May 15, 2021, at 8:00 PM, Richard Greenwood wrote:
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.
  CLASS
STYLE
  COLOR 255 255 208
  ANTIALIAS ON
END
  END
Again, thank you for your suggestions.
Rich

On Sat, May 15, 2021 at 11:21 AM Even Rouault 
mailto:even.roua...@spatialys.com>> wrote:
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.

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.
Le 15/05/2021 à 19:07, Richard Greenwood a écrit :
Even,

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.

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 https://www.mapserver.org/mapfile/outputformat.html seems to 
suggest.

In any case, thanks again.
Rich



On Sat, May 15, 2021 at 9:59 AM Even Rouault 
mailto:even.roua...@spatialys.com>> wrote:

Richard,

your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced one.

I see in the git history a relevant commit:


$ git show 9984b39cc8f74d60eb240728df660a172a118aad
commit 9984b39cc8f74d60eb240728df660a172a118aad
Author: Thomas Bonfort 
<mailto:thomas.bonf...@gmail.com>
Date:   Sun Oct 5 15:59:44 2008 +

rgba_png: don't interlace by default


git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960 
7532c77e-422f-0410-93f4-f0b67bdd69e2

diff --git a/maprgbapng.c b/maprgbapng.c
index 105d8d61..c3615edd 100644
--- a/maprgbapng.c
+++ b/maprgbapng.c
@@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx 
*ctx, outputFormatObj *form
 int bot_idx, top_idx;
 int remap[256];
 int reqcolors = atoi(msGetOutputFormatOption( format, "QUANTIZE_COLORS", 
"256"));
+const char *interlace;
 ms_png_info info;
 info.width = gdImageSX(img);
 info.height = gdImageSY(img);
-if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE", "ON" )) 
== 0 )
+interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );
+if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", interlace) == 0
+|| strcasecmp("1", interlace) == 0)
 info.interlaced=1;
 else
 info.interlaced=0;



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.

From what I can see in the doc, the interlacing mode was remove

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-17 Thread Seth G
Hi Richard,

In your OUTPUTFORMAT declaration maybe try setting the DRIVER to *AGG/PNG8*
Also  IMAGEMODE PC256 was only for GD support that was removed in 7.0. Try 
IMAGEMODE RGB (or RGBA if you want transparency). 

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Sat, May 15, 2021, at 8:00 PM, Richard Greenwood wrote:
> 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. 
>   CLASS
> STYLE
>   COLOR 255 255 208
>   ANTIALIAS ON
> END
>   END
> Again, thank you for your suggestions.
> Rich
> 
> On Sat, May 15, 2021 at 11:21 AM Even Rouault  
> wrote:
>> 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. 
>> 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.

>> Le 15/05/2021 à 19:07, Richard Greenwood a écrit :
>>> Even, 
>>> 
>>> 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. 
>>> 
>>> 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 https://www.mapserver.org/mapfile/outputformat.html 
>>> seems to suggest. 
>>> 
>>> In any case, thanks again.
>>> Rich
>>> 
>>> 
>>> 
>>> On Sat, May 15, 2021 at 9:59 AM Even Rouault  
>>> wrote:
 Richard,

 your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced 
 one.

 I see in the git history a relevant commit:

 

 $ git show 9984b39cc8f74d60eb240728df660a172a118aad
 commit 9984b39cc8f74d60eb240728df660a172a118aad
 Author: Thomas Bonfort 
 Date:   Sun Oct 5 15:59:44 2008 +
 
 rgba_png: don't interlace by default
 
 
 git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960 
 7532c77e-422f-0410-93f4-f0b67bdd69e2
 
 diff --git a/maprgbapng.c b/maprgbapng.c
 index 105d8d61..c3615edd 100644
 --- a/maprgbapng.c
 +++ b/maprgbapng.c
 @@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx 
 *ctx, outputFormatObj *form
  int bot_idx, top_idx;
  int remap[256];
  int reqcolors = atoi(msGetOutputFormatOption( format, 
 "QUANTIZE_COLORS", "256"));
 +const char *interlace;
  ms_png_info info;
  info.width = gdImageSX(img);
  info.height = gdImageSY(img);
 -if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE", 
 "ON" )) == 0 )
 +interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );
 +if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", interlace) 
 == 0
 +|| strcasecmp("1", interlace) == 0)
  info.interlaced=1;
  else
  info.interlaced=0;
 

 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.

 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.

 Even

 

 Le 15/05/2021 à 17:43, Richard Greenwood a écrit :
> 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. 
> 
> OUTPUTFORMAT
>   NAME "png-test"
>   DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
>   MIMETYPE "image/png; mode=8bit"
>   IMAGEMODE PC256
>   FORMATOPTION "QUANTIZE_FORCE=on"
>   FORMATOPTION "QUANTIZE_COLORS=256"
>   EXTENSION "png"
>   # TRANSPARENT on or off makes little difference
> END
> 
> MapServer 6.4  is 90kB, MapServer 
> 7.6  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?
> 
> Thanks,
> Rich
> 
> -- 
> 
> 

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Richard Greenwood
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.
  CLASS
STYLE
  COLOR 255 255 208
  ANTIALIAS ON
END
  END
Again, thank you for your suggestions.
Rich

On Sat, May 15, 2021 at 11:21 AM Even Rouault 
wrote:

> 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.
>
> 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.
> Le 15/05/2021 à 19:07, Richard Greenwood a écrit :
>
> Even,
>
> 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.
>
> 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
> https://www.mapserver.org/mapfile/outputformat.html seems to suggest.
>
> In any case, thanks again.
> Rich
>
>
>
> On Sat, May 15, 2021 at 9:59 AM Even Rouault 
> wrote:
>
>> Richard,
>>
>> your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced
>> one.
>>
>> I see in the git history a relevant commit:
>>
>> $ git show 9984b39cc8f74d60eb240728df660a172a118aad
>> commit 9984b39cc8f74d60eb240728df660a172a118aad
>> Author: Thomas Bonfort 
>> 
>> Date:   Sun Oct 5 15:59:44 2008 +
>>
>> rgba_png: don't interlace by default
>>
>>
>> git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960
>> 7532c77e-422f-0410-93f4-f0b67bdd69e2
>>
>> diff --git a/maprgbapng.c b/maprgbapng.c
>> index 105d8d61..c3615edd 100644
>> --- a/maprgbapng.c
>> +++ b/maprgbapng.c
>> @@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img,
>> gdIOCtx *ctx, outputFormatObj *form
>>  int bot_idx, top_idx;
>>  int remap[256];
>>  int reqcolors = atoi(msGetOutputFormatOption( format,
>> "QUANTIZE_COLORS", "256"));
>> +const char *interlace;
>>  ms_png_info info;
>>  info.width = gdImageSX(img);
>>  info.height = gdImageSY(img);
>> -if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE",
>> "ON" )) == 0 )
>> +interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );
>> +if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", interlace)
>> == 0
>> +|| strcasecmp("1", interlace) == 0)
>>  info.interlaced=1;
>>  else
>>  info.interlaced=0;
>>
>> 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.
>>
>> 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.
>>
>> Even
>>
>>
>> Le 15/05/2021 à 17:43, Richard Greenwood a écrit :
>>
>> 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.
>>
>> OUTPUTFORMAT
>>   NAME "png-test"
>>   DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
>>   MIMETYPE "image/png; mode=8bit"
>>   IMAGEMODE PC256
>>   FORMATOPTION "QUANTIZE_FORCE=on"
>>   FORMATOPTION "QUANTIZE_COLORS=256"
>>   EXTENSION "png"
>>   # TRANSPARENT on or off makes little difference
>> END
>>
>> MapServer 6.4  is 90kB, MapServer
>> 7.6  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?
>>
>> Thanks,
>> Rich
>>
>> --
>> Richard W. Greenwood, PLS
>> www.greenwoodmap.com
>>
>> ___
>> mapserver-users mailing 
>> listmapserver-users@lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>> -- http://www.spatialys.com
>> My software is free, but my time generally not.
>>
>>
>
> --
> Richard W. Greenwood, PLS
> www.greenwoodmap.com
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
>

-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org

Re: [mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Lars Schylberg

Hi,

When I look at the images it seems like the 7.6 have anti-aliasing but 
the 6.4 does not have it.  The 7.6 is more fuzzy and the 6.4 image You 
could that the river is not as smooth.


/Lars S.

Den 2021-05-15 kl. 17:43, skrTo ev Richard Greenwood:
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.


OUTPUTFORMAT
  NAME "png-test"
  DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
  MIMETYPE "image/png; mode=8bit"
  IMAGEMODE PC256
  FORMATOPTION "QUANTIZE_FORCE=on"
  FORMATOPTION "QUANTIZE_COLORS=256"
  EXTENSION "png"
  # TRANSPARENT on or off makes little difference
END

MapServer 6.4  is 90kB, 
MapServer 7.6  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?


Thanks,
Rich

--
Richard W. Greenwood, PLS
www.greenwoodmap.com 

___
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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Even Rouault
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.


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.


Le 15/05/2021 à 19:07, Richard Greenwood a écrit :

Even,

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.


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 
https://www.mapserver.org/mapfile/outputformat.html 
 seems to suggest.


In any case, thanks again.
Rich



On Sat, May 15, 2021 at 9:59 AM Even Rouault 
mailto:even.roua...@spatialys.com>> wrote:


Richard,

your 6.4 image is a interlaced PNG, whereas the 7.6 is a
non-interlaced one.

I see in the git history a relevant commit:

$ git show 9984b39cc8f74d60eb240728df660a172a118aad
commit 9984b39cc8f74d60eb240728df660a172a118aad
Author: Thomas Bonfort 

Date:   Sun Oct 5 15:59:44 2008 +

    rgba_png: don't interlace by default


    git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960

7532c77e-422f-0410-93f4-f0b67bdd69e2

diff --git a/maprgbapng.c b/maprgbapng.c
index 105d8d61..c3615edd 100644
--- a/maprgbapng.c
+++ b/maprgbapng.c
@@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img,
gdIOCtx *ctx, outputFormatObj *form
 int bot_idx, top_idx;
 int remap[256];
 int reqcolors = atoi(msGetOutputFormatOption( format,
"QUANTIZE_COLORS", "256"));
+    const char *interlace;
 ms_png_info info;
 info.width = gdImageSX(img);
 info.height = gdImageSY(img);
-    if( strcasecmp("ON", msGetOutputFormatOption( format,
"INTERLACE", "ON" )) == 0 )
+    interlace = msGetOutputFormatOption( format, "INTERLACE",
"OFF" );
+    if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES",
interlace) == 0
+    || strcasecmp("1", interlace) == 0)
 info.interlaced=1;
 else
 info.interlaced=0;

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.

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.

Even


Le 15/05/2021 à 17:43, Richard Greenwood a écrit :

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.

OUTPUTFORMAT
  NAME "png-test"
  DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
  MIMETYPE "image/png; mode=8bit"
  IMAGEMODE PC256
  FORMATOPTION "QUANTIZE_FORCE=on"
  FORMATOPTION "QUANTIZE_COLORS=256"
  EXTENSION "png"
  # TRANSPARENT on or off makes little difference
END

MapServer 6.4  is 90kB,
MapServer 7.6  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?

Thanks,
Rich

-- 
Richard W. Greenwood, PLS

www.greenwoodmap.com 

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



-- 
http://www.spatialys.com  

My software is free, but my time generally not.



--
Richard W. Greenwood, PLS
www.greenwoodmap.com 


--
http://www.spatialys.com
My software is free, but my time generally not.

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


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Richard Greenwood
Even,

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.

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 https://www.mapserver.org/mapfile/outputformat.html
seems to suggest.

In any case, thanks again.
Rich



On Sat, May 15, 2021 at 9:59 AM Even Rouault 
wrote:

> Richard,
>
> your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced
> one.
>
> I see in the git history a relevant commit:
>
> $ git show 9984b39cc8f74d60eb240728df660a172a118aad
> commit 9984b39cc8f74d60eb240728df660a172a118aad
> Author: Thomas Bonfort 
> 
> Date:   Sun Oct 5 15:59:44 2008 +
>
> rgba_png: don't interlace by default
>
>
> git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960
> 7532c77e-422f-0410-93f4-f0b67bdd69e2
>
> diff --git a/maprgbapng.c b/maprgbapng.c
> index 105d8d61..c3615edd 100644
> --- a/maprgbapng.c
> +++ b/maprgbapng.c
> @@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx
> *ctx, outputFormatObj *form
>  int bot_idx, top_idx;
>  int remap[256];
>  int reqcolors = atoi(msGetOutputFormatOption( format,
> "QUANTIZE_COLORS", "256"));
> +const char *interlace;
>  ms_png_info info;
>  info.width = gdImageSX(img);
>  info.height = gdImageSY(img);
> -if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE",
> "ON" )) == 0 )
> +interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );
> +if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", interlace)
> == 0
> +|| strcasecmp("1", interlace) == 0)
>  info.interlaced=1;
>  else
>  info.interlaced=0;
>
> 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.
>
> 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.
>
> Even
>
>
> Le 15/05/2021 à 17:43, Richard Greenwood a écrit :
>
> 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.
>
> OUTPUTFORMAT
>   NAME "png-test"
>   DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
>   MIMETYPE "image/png; mode=8bit"
>   IMAGEMODE PC256
>   FORMATOPTION "QUANTIZE_FORCE=on"
>   FORMATOPTION "QUANTIZE_COLORS=256"
>   EXTENSION "png"
>   # TRANSPARENT on or off makes little difference
> END
>
> MapServer 6.4  is 90kB, MapServer
> 7.6  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?
>
> Thanks,
> Rich
>
> --
> Richard W. Greenwood, PLS
> www.greenwoodmap.com
>
> ___
> mapserver-users mailing 
> listmapserver-users@lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
>

-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Even Rouault

Richard,

your 6.4 image is a interlaced PNG, whereas the 7.6 is a non-interlaced one.

I see in the git history a relevant commit:

$ git show 9984b39cc8f74d60eb240728df660a172a118aad
commit 9984b39cc8f74d60eb240728df660a172a118aad
Author: Thomas Bonfort 
Date:   Sun Oct 5 15:59:44 2008 +

    rgba_png: don't interlace by default


    git-svn-id: http://svn.osgeo.org/mapserver/trunk@7960 
7532c77e-422f-0410-93f4-f0b67bdd69e2


diff --git a/maprgbapng.c b/maprgbapng.c
index 105d8d61..c3615edd 100644
--- a/maprgbapng.c
+++ b/maprgbapng.c
@@ -357,10 +357,13 @@ int msSaveImageRGBAQuantized(gdImagePtr img, 
gdIOCtx *ctx, outputFormatObj *form

 int bot_idx, top_idx;
 int remap[256];
 int reqcolors = atoi(msGetOutputFormatOption( format, 
"QUANTIZE_COLORS", "256"));

+    const char *interlace;
 ms_png_info info;
 info.width = gdImageSX(img);
 info.height = gdImageSY(img);
-    if( strcasecmp("ON", msGetOutputFormatOption( format, "INTERLACE", 
"ON" )) == 0 )

+    interlace = msGetOutputFormatOption( format, "INTERLACE", "OFF" );
+    if( strcasecmp("ON", interlace) == 0 || strcasecmp("YES", 
interlace) == 0

+    || strcasecmp("1", interlace) == 0)
 info.interlaced=1;
 else
 info.interlaced=0;

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.


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.


Even


Le 15/05/2021 à 17:43, Richard Greenwood a écrit :
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.


OUTPUTFORMAT
  NAME "png-test"
  DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
  MIMETYPE "image/png; mode=8bit"
  IMAGEMODE PC256
  FORMATOPTION "QUANTIZE_FORCE=on"
  FORMATOPTION "QUANTIZE_COLORS=256"
  EXTENSION "png"
  # TRANSPARENT on or off makes little difference
END

MapServer 6.4  is 90kB, 
MapServer 7.6  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?


Thanks,
Rich

--
Richard W. Greenwood, PLS
www.greenwoodmap.com 

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


--
http://www.spatialys.com
My software is free, but my time generally not.

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


[mapserver-users] differing image size with different mapserver versions

2021-05-15 Thread Richard Greenwood
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.

OUTPUTFORMAT
  NAME "png-test"
  DRIVER "AGG/PNG"  # GD driver is same (6.4 only)
  MIMETYPE "image/png; mode=8bit"
  IMAGEMODE PC256
  FORMATOPTION "QUANTIZE_FORCE=on"
  FORMATOPTION "QUANTIZE_COLORS=256"
  EXTENSION "png"
  # TRANSPARENT on or off makes little difference
END

MapServer 6.4  is 90kB, MapServer
7.6  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?

Thanks,
Rich

-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users