Imaging mass spectrometry (IMS) shows great potential for the rapid mapping of protein localization and for detecting of sizeable differences in protein expression. However, data processing remains challenging due to the difficulty of analyzing high dimensionality, the fact that the number of predictors is significantly larger than the number of observations, and the need to consider both spectral and spatial information in order to represent the advantage of IMS technology. Ideally one would like to efficiently analyze all acquired data to find trace features based on both spectral and spatial patterns. Therefore, biomarker selection from IMS data is a problem of global optimization. A recently developed regularization and variable selection method, elastic net (EN), produces a sparse model with admirable prediction accuracy and can be an effective tool for IMS data processing. In this paper, we incorporate a spatial penalty term into the EN model and develop a new tool for IMS data biomarker selection and classification. A comprehensive IMS data processing software package, called EN4IMS, is also presented. The results of applying our method to both simulated and real data show that the EN4IMS algorithm works efficiently and effectively for IMS data processing: producing a more precise listing of selected peaks, helping confirmation of new potential biomarkers discovery, and providing more accurate classification results. Copyright © 2010 John Wiley & Sons, Ltd.