[MapProxy] 8 bit mixed cache
Rahkonen Jukka (MML)
jukka.rahkonen at maanmittauslaitos.fi
Thu Apr 14 02:00:58 PDT 2016
As far as I know JPEG supports only 1-band or 3-band images. Thus 8-bit colour JPEG does not exist and setting image mode to palette before JPEG conversion still leads into 3-band, 24-bit JPEG. What GIMP does in test 3 is to write a single band black-and-white image.
I do not know if it is possible to configure MapProxy to save tiles as single band JPEG.
dirk thalheim wrote:
> ah yes, I almost forgot about YCbCr. As we have no color information in the images, I was wondering if we can reduce the file size. So in theory we don't need the components Cb and Cr.
I did some testing with Gimp and got following results for a 512x512 pixel image:
1. exported as png: 56,1 KB
2. exported as jpeg 80%: 11,5 KB
3. set image mode to grayscale and then export as jpeg 80%: 9,3 KB 4. set image mode to palette (256 colors) and then export as jpeg 80%: 11,5 KB 5. same as 4 but with 4:2:2 chroma subsampling: 10,5 KB
6 same as 4 but 4:2:0 chroma subsampling: 10,0 KB
I'm not sure what Gimp really does in the third test but this was the best result. It's not much, but applied to the number of tiles in our cache it could save some GB.
I guess in MapProxy there are no options available to do that.
Kind regards, Dirk
Von: Oliver Tonnhofer [mailto:olt at omniscale.de]
Gesendet: Mittwoch, 13. April 2016 15:55
An: Thalheim, Dirk <dirk.thalheim at bkg.bund.de>
Cc: mapproxy at lists.osgeo.org
Betreff: Re: [MapProxy] 8 bit mixed cache
I'm not sure what you are trying to accomplish. JPEG images are normally stored as YCbCr and not RGB.
You can reduce the jpeg_quality if you want to reduce the file size.
Oliver Tonnhofer | Omniscale GmbH & Co KG | http://omniscale.com
OpenStreetMap WMS and tile services | http://maps.omniscale.com
> On 05.04.2016, at 16:06, dirk.thalheim at bkg.bund.de wrote:
> Hello list,
> I’m trying to generate a cache which contains only images with 256 colors. Is there a way to create a mixed cache with mapproxy using only 8 bit images for both png and jpeg? It could save some disk space. I tried already several image format settings in the mapproxy yaml config, but it seems to affect only the png files. The jpegs I inspected after seeding had 24 bit.
> Kind regards,
> MapProxy mailing list
> MapProxy at lists.osgeo.org
MapProxy mailing list
MapProxy at lists.osgeo.org
More information about the MapProxy