Region of interest (ROI) based image compression can offer a high image-compression ratio along with high quality in the important regions of the image. For many applications, stable compression quality is required for both the ROIs and the images. However, image compression does not consider information specific to the application and cannot meet this requirement well. This paper proposes an application-oriented ROI-based image-compression method using bit-allocation optimization. Unlike typical methods that define bit-rate parameters empirically, the proposed method adjusts the bit-rate parameters adaptively to both images and ROIs. First, an application-dependent optimization model is constructed. The relationship between the compression parameters and the image content is learned from a training image set. Image redundancy is used to measure the compression capability of image content. Then, during compression, the global bit rate and the ROI bit rate are adjusted in the images and ROIs, respectively—supported by the application-dependent information in the optimization model. As a result, stable compression quality is assured in the applications. Experiments with two different applications showed that quality deviation in the reconstructed images decreased, verifying the effectiveness of the proposed method.