Fixed a bug in density gradient for color images.