1. A method of representing a digital pathology image programmed in a controller in a device comprising: a. implementing, with the device, stain separation to separate a stain including at least one color component; b. resampling the at least one color component based on importance; c. encoding the resampled color component into an encoded color component; and d. combining the encoded color component and stain vector information to generate a compressed image.