Tips for choosing a cache image format

We often receive questions about which image format is most appropriate for ArcGIS Server map
caches. In response we recently added the following information to the topic
Choosing Cache Properties
in the ArcGIS Server 9.3 Web Help.

Your choice of cache image format is important because it determines the size on disk
of the tiles, the image quality, and the ability to make the tile background

Below is a summary of the available image formats and their appropriate uses.

  • PNG8 – Use this format for overlay services that need to have a
    transparent background, such as roads and boundaries. PNG 8 creates tiles of
    very small size on disk with no loss of information. However, you should use a
    different PNG format if your map contains more than 256 colors. Imagery,
    hillshades, gradient fills, transparency, and the antialiasing caching option
    can easily push your map over 256 colors.
  • PNG24 – You can use this format for overlay services, such as roads and
    boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG
    8). Do not use PNG 24 if your tiles will be viewed in Internet Explorer version
    6 or previous.
  • PNG32 – Use this format for overlay services, such as roads and
    boundaries, that have more than 256 colors. This format creates larger tiles
    than PNG 24, but the tiles are fully supported in all browsers.
  • JPEG – Use this format for base map services that have large color
    variation and do not need to have a transparent background. For example, raster
    imagery tends to work well with JPEG.

    JPEG is a lossy image format. It attempts to selectively remove data without
    affecting the appearance of the image. This can cause very small tile sizes on
    disk, but if your map contains vector linework or labels, it may produce too
    much “noise” or blurry area around the lines. If this is the case, you can
    attempt to raise the Compression value from the default of 75. A higher value
    such as 90 may balance an acceptable quality of linework with the small tile
    size benefit of the JPEG.

    It’s up to you to decide what image quality you consider acceptable. If you are
    willing to accept a minor amount of noise in the images, you may save large
    amounts of disk space by choosing JPEG. The smaller tile size also means the
    browser can download the tiles faster.

Before committing to an image format for a large cache, build a small cache of a
representative area of your map and examine the tile quality and performance in
a test application. If you’ll be working with multiple caches, build a small
test cache for each and add them to a test application to make sure they
overlay as expected. This will allow you to make adjustments before you create
the entire cache.

To make a small test cache you can do any of the following:

  • Set a custom data frame extent to a small area in your source map document and
    run Manage Map Server Cache Tiles.
  • Run Manage Map Server Cache Tiles and in the tool interface, edit the extent
    rectangle to be a small area.
  • Use the editing tools in ArcMap to create a new feature class consisting of a
    small rectangle around the area you want to test. Then select the option at the
    bottom of the Manage Map Server Cache Tiles tool that allows you to create
    tiles based on the boundary of a feature class.

Contributed by Sterling Quinn of the ArcGIS Server software development team

This entry was posted in Services and tagged , . Bookmark the permalink.

Leave a Reply


  1. sterlingdq says:

    @Carol- A 9.3 map service is designed to be compatible with a cache that was built at 9.2. Not sure what is causing the transparency problem you’re seeing- it’s probably more about how the 9.3 client is interpreting the image. What client are you using that causes different appearance in 9.2 vs. 9.3? Can you explain in more detail “the background is not transparent in the cached PNG images but it is transparent when you preview the map service or the web application.”?


  2. SBLGIS38 says:

    Informative post.thanks for sharing
    Lidar mapping services

  3. sterlingdq says:

    @Jeff- When a user connects to a cached service they typically hit the SOC briefly and from then on they get the tiles directly out of the cache directory. In most cases it’s sufficient to have one configuration of your service and one cache directory.

    A very large deployment (like ArcGIS Online) might have the cache duplicated on several servers, but this is partly to facilitate failover and update workflows. Unless you have thousands of users depending on your cache night and day, it’s probably not worth the trouble.

  4. sterlingdq says:

    @trangdt – JPEG was added as an option at ArcGIS Server 9.2, Service Pack 1. The additional image formats become available in the caching tools once you apply the service pack.

  5. offermann says:

    @sterlingdq: Regarding JPEG Quality, you wrote “raise the Compression value”, where is the right lever to change jpg compression for the ArcGIS Server (9.3)?

    btw: is the compression value a server-sided parameter or is there a way to specifiy the value in each request?

    Best regards, Stefan

  6. sterlingdq says:

    @stefan- The ArcGIS Online team uses a value of 90 for vector-based maps. For raster maps you could probably get away with 75 or lower. The number actually refers to compression quality, so a higher number means less compression. In all cases, build a small test cache and examine the quality to make sure it’s right for you.

    The compression quality value is only used when creating tiles on the server. It’s not a thing that a client can specify on each request.

  7. sterlingdq says:

    @Lars- Do these two maps (base and overlay) use the same tiling scheme? Are the projection and scales common to both services? I can imagine overlay problems if there’s a mismatch.

  8. huttarl says:

    Thanks, Sterling. I think a mismatched tiling scheme is probably the issue. I just watched an online seminar where I learned that the tiling schemes have to match. I’m recreating the cache on our own map service to match the tiling scheme of the arcgis online basemap service. Hopefully that will fix the problem.

    Would be great if the AGS Javascript API (and similar) would throw an error or warning if you try to load two cached layers in the same map with different tiling schemes.