You can also adjust the Saturation prior to using the Magic Wand.
I haven't used GIMP or Irfanview, but Photoshop and Paintshop have the same features.
Increasing or decreasing the background saturation will eliminate "artifacts" when selecting the background color with Magic Wand.