In this paper, we propose a bit allocation method for 2D compression of hyperspectral images to enhance classification performance. First, we select a number of classes from original hyperspectral images. It is noted that the classes can be automatically selected by applying an unsupervised segmentation method. Then, we apply a feature extraction method and determine discriminately dominant feature vectors. By examining the feature vectors, we determine the discriminant usefulness of each spectral band. Finally, based on the discriminant usefulness of the spectral bands, we determine bit allocation of each spectral band. Experimental results show that it is possible to enhance the discriminant information at the expense of PSNR. Depending on applications, one can either minimize the mean squared error or choose to preserve the classification capability of the hyperspectral images.