Opened 13 years ago

Last modified 13 years ago

#4017 new enhancement

Expose more png compression options

Reported by: tbonfort Owned by: tbonfort
Priority: normal Milestone: 6.2 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc:

Description

The wms shootout has shown that png compression options have a big influence on perceived performance, without necessarily causing larger image sizes.

One notable png optimization is to set png filtering to PNG_FILTER_NONE in these cases:

  • quantized png
  • when output is vector (i.e. no rasters) data

more testing should be done to assess the impact on raster images, but in any case png is not a good choice for this kind of data.

This ticket will track the addition of an additional FORMATOPTION allowing the user to set which png filters are applied. The default will be to not set any filter.

Change History (4)

comment:1 by tbonfort, 13 years ago

patch for mapimageio.c:

  • mapimageio.c

     
    263263   if (!png_ptr)
    264264      return (MS_FAILURE);
    265265
     266   png_set_compression_level(png_ptr, compression);
     267   png_set_filter(png_ptr,0,PNG_FILTER_NONE);
     268
    266269   info_ptr = png_create_info_struct(png_ptr);
    267270   if (!info_ptr)
    268271   {
     
    281284   else
    282285      png_set_write_fn(png_ptr,info, png_write_data_to_buffer, png_flush_data);
    283286   
    284    png_set_compression_level(png_ptr, compression);
    285287   
    286288   if (rb->data.palette.num_entries <= 2)
    287289    sample_depth = 1;
     
    450452        if (!png_ptr)
    451453            return (MS_FAILURE);
    452454       
     455        png_set_compression_level(png_ptr, compression);
     456        png_set_filter(png_ptr,0,PNG_FILTER_NONE);
    453457        info_ptr = png_create_info_struct(png_ptr);
    454458        if (!info_ptr)
    455459        {
     
    473477        else
    474478            color_type = PNG_COLOR_TYPE_RGB;
    475479       
    476         png_set_compression_level(png_ptr, compression);
    477480        png_set_IHDR(png_ptr, info_ptr, rb->width, rb->height,
    478481                     8, color_type, PNG_INTERLACE_NONE,
    479482                     PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);

comment:2 by tbonfort, 13 years ago

This modification should also be applied to MapCache

comment:3 by tbonfort, 13 years ago

applied to mapcache in r12539

comment:4 by tbonfort, 13 years ago

applied to mapserver in r12547

Note: See TracTickets for help on using tickets.