Chromatic aberration is a form of aberration in color optical devices that produces undesirable color fringes along borders within images. It is becoming a more critical problem these days as digital cameras are getting smaller, while the number of picture elements is increasing. We propose a novel method for detecting and eliminating chromatic aberration using image processing. We first analyze the color behavior on edges that do not show chromatic aberration and propose a range limitation for color difference signals. When pixels violate the preceding condition, they can be considered as color fringes caused by chromatic aberration. Corrected pixel values are generated to eliminate the chromatic aberrations. The proposed algorithm corrects both lateral and longitudinal aberration in an image, and experimental results are provided to demonstrate its efficacy.