A computer based method and system for compressing digital hyperspectral or multispectral image data. The method includes initially reducing the plurality of spectral bands of the hyperspectral data to a smaller number of spectral bands using principal component analysis, determining an optimum compression ratio for each of the smaller number of spectral bands for use in a wavelet transform, and subsequently compressing the smaller number of spectral bands spatially using the wavelet transform with the optimum compression ratios.