Saturday, February 26, 2011

Image Quality vs Size: Download Wait Time

When creating images for the web (or any application for that matter) it is always important to consider the quality of images compared to the intended purpose. For example, why bother loading a high quality thumbnail when the it can be displayed as low, or very low?

Because XC Skies is heavily image based, we are extremely sensitive to how to balance readable imagery on the threshold of smallest size. Consider this panel of collapsed tile images. Each image is composed of these layers in order: terrain base layer, contour of height above ground parameter, and a road overlay.

Click on Image to enlarge

Images with varying degrees of shading are best represented as JPEG images. Simple images with discrete colors (such as the road overlay or simple XC Skies parameter overlays) are best viewed in PNG or GIF image formats. The size of an image varies significantly depending on its content. A quick visual review of the above panel shows the same collapsed image tile as a JPEG from highest quality of 100 to very low of 10. File sizes range from 70KB to 3KB (kilobytes).

What's important is to note that between qualities of 100 and 80, the image is nearly identical in readability and sharpness of roads and labeling. The size difference is 70KB - 18KB = 52KB of unneeded image data. Depending on your needs of extracting information from the image data, you might say that a quality of 70 is acceptable, which gains an additional 4KB advantage.

Let's put this in a simple perspective.

Assume we're looking at a map with 9 tiles (each of with 256 x 256 pixel dimension size) loaded in a map frame on XC Skies. This is a viewing area of 768 x 768 pixels--plenty of room to view soaring potentials. Let's do some math.

First let's assume we're sitting at an airport hangar or competition headquarters with a wireless network with a not-so-good connection to the internet, as is almost always the case. We want to refresh the map to check the latest updates from the last model run. For this case, we'll use an effective download speed of 20KB per second (that's generous if there are 10 users on a single wireless node).

Consider these two scenarios:

Quality of image at 100: 70KB * 9 = 630KB. Download time of 31.5 seconds. After 10 seconds I'm getting annoyed...

Quality of image at 70: 14KB * 9 = 126KB. Download time of 6.3 seconds. Now that's better!

Without collapsing images, we would be downloading a total of 27 images--3 sets of 9 tiles (base terrain, XC Skies layer, and roads overlay). An average total size for 27 tile images in XC Skies Maps is around 320KB depending on the scene. Collapsing down to 9 images results in 188KB. That's a 41% decrease in images size.

More examples and usage ideas will be posted later.

No comments: