This script converts the colors of an image, so that the foreground color (chosen, e.g., with the color picker tool) is either transformed to gray, or to the background color. The script can be used to remove color casts. The script installs itself under the menu Filters/Colors/White balance.
The documentation for the script is available at
The script works for Gimp 2.2, 2.4, and 2.6 .