Patent ID: 7616811

Claim:
A method in a digital image processing chain in a device for adjusting a colour balance comprising: inputting to the device value-sets of colour components R, G, B which have been formed by imaging a subject by pixels, forming component-specific histograms from the value-sets of the colour components, forming cumulative histograms from the component-specific histograms, defining an illumination colour corresponding to at least one colour component from the cumulative histograms, defining a gain factor adjusting the colour balance for at least two colour components using a target colour and the defined illumination colour, defining from an essentially flat area of a colour curve at the ends of the cumulative histograms a common point h i , at which colour-component wise pixel-intensity values C i , C i+1 , corresponding to consecutive points h i , h i+1 , meet criteria conditions set for at least one colour component defined from the essentially flat area of the colour curve at the ends of the cumulative histograms, and setting the colour-component wise intensity value C i , corresponding to a common point h i for the at least one colour component to correspond to the illumination colour.