Solving the color constancy problem in many applications implies the understanding of chromatic adaptation. The Retinex theory justifies chromatic adaptation, as well as other color illusions, on visual perception principles. Based on the above theory, we have derived an algorithm to solve the color constancy problem and to simulate chromatic adaptation. The evaluation of the results depends on the kind of applications considered. Since our purpose is to contribute to the problem of color rendering for photorealistic image synthesis, we have devised a specific test approach. A virtual ‘‘Mondrian’’ patchwork has been created by applying a rendering algorithm with a photorealistic light model to generate images under different light sources. Trichromatic values of the computer generated patches are the input data for the Retinex algorithm, computing new color corrected patches. The Euclidean and the ?E94 * distances in the CIELAB space, between the original and Retinex color corrected trichromatic values, have been calculated. A preliminary analysis of the just noticeable difference has also been done on some colors compared to the closest MacAdam ellipses. Our work shows that the Retinex computational model is very well suited to solve the color constancy problem without any a priori information on the illuminant spectral distribution.