Patent ID: 7236191

Claim:
A method for processing an image, which comprises at least a first component and a second component, wherein first pixels having information of the first component are located at least partly in different locations than second pixels having information of the second component, and wherein an interpolation of the first component is performed for a pixel having information of other than the first component, wherein the method comprises: determining an average value of neighboring pixels having said information of the first component; determining a second order gradient of neighboring pixels having said information of the second component; determining a portion of said second order gradient to be added to said average value based on at least a value of said second order gradient, wherein if the second order gradient is greater than a predefined threshold value, said portion of the second order gradient is attenuated by a gain value that is based on at least the first component and the second component neighbour value differences; adding to the average value said portion of said second order gradient for the interpolation of said first component.