A method is provided for compensating a failing nozzle in a printhead comprising a series of print elements with nozzles for operation in an inkjet printing process in which a colorant is applied for locally changing an optical density, thereby printing an image. The method comprises at least two compensation mechanisms, each providing a different amount of additional optical density in the environment of a missing dot in the printed image. A nozzle is recorded as a failing nozzle if the associated print element does not apply an ink dot within predetermined specifications. An environment density is determined in an environment of a missing dot associated with said failing nozzle. The environment density is compared with a predetermined threshold, and an appropriate compensation mechanism is selected from the at least two compensation mechanisms. The method is applied in an inkjet printing system for balancing under- and overcompensated optical density.