I repeated the experiment with larger files. Very interesting. At the 500 MB or larger size, JPEG2000 rivals ECW in speed, and the speed difference from TIFF diminishes.

This seems to bear out a theory I had that TIFF is best for images up to 1 GB, but above that, a wavelet-based compressor is more appropriate as the disk seeks become more expensive than the CPU time. I can't test with input larger than 500 MB, due to ECW's licensing restrictions, so if anyone does have a licensed unlimited-size ECW compressor, and cares to repeat this experiment, I would love to hear about it.


*** SETUP

The data is USGS DOQQs (black-n-white) of San Francisco, California. Several DOQQs were downloaded and merged into a single GeoTIFF using gdal_merge.py. Then gdal_translate was used to create ECW and JPEG2000 equivalents.

All images use the same projection: EPSG 26910, aka UTM zone 10N with NAD83 datum.
The spatial extent observed is:
   543577.000 4150151.000 555545.000 4192431.000

A mapfile is created specifying three layers, named TIFF, ECW, and JPEG2000, each one reading from the corresponding raster. No reprojection is being done in the mapfile.


*** STORAGE SPACE

TIFF, 483 MB
ECW, 98 MB
JPEG2000, 114 MB

Obviously, both ECW and JPEG2000 provide significant benefits over TIFF as far as storage space.


*** RUNTIME PERFORMANCE

# full view of the region
shp2img -m mapfile.map -l ECW     -o ecw-fullview.png
Time: 3.076s
shp2img -m mapfile.map -l JPEG2000 -o jpeg2000-fullview.png
Time: 3.075s
shp2img -m mapfile.map -l TIFF    -o tiff-fullview.png
Time: 0.480s

# one square kilometer. that's 1/480 of the full square area
shp2img -m mapfile.map -l ECW -e 549561 4150150 550561 4151150 -o ecw-1km.png
Time: 3.077s
shp2img -m mapfile.map -l JPEG2000 -e 549561 4150150 550561 4151150 -o jpeg2000-1km.png
Time: 3.073s
shp2img -m mapfile.map -l TIFF -e 549561 4150150 550561 4151150 -o tiff-1km.png
Time: 1.065s

As with the experiment with smaller files, we see that TIFF is a significantly faster format than the other two. However, the time difference has shrunk from 4:1 to about 1.7:1

Strangely, JPEG2000's speed is not the same as it was with the other experiment, despite repeated checks and re-runs. At the 500 MB file size range, JPEG2000's speed closely rivals that of ECW -- JPEG2000 seems to run faster on this trial, by some margin. (no reprojection in either experiment, very odd)



*** IMAGE QUALITY

https://www.cartograph.com/~gregor/formats2/ecw-fullview.png
https://www.cartograph.com/~gregor/formats2/jpeg2000-fullview.png
https://www.cartograph.com/~gregor/formats2/tiff-fullview.png

https://www.cartograph.com/~gregor/formats2/ecw-1km.png
https://www.cartograph.com/~gregor/formats2/jpeg2000-1km.png
https://www.cartograph.com/~gregor/formats2/tiff-1km.png

As with the other experiment, the wavelet-based ECW and JPEG2000 formats lost some degree of fine detail. However, this loss of detail manifested gracefully as a "smoothing" effect of otherwise grainy features.

Reply via email to