This is modified from here - 1 year old today. Edit: tomorrow. Two regular expressions added :- $hImage2 = _ImageColorRegExpReplace($hImage, "(FFFFFFFF", "000000FF"); Change white to black. and $hImage2 = _ImageColorRegExpReplace($hImage, "(?i)([E-F][0-9A-F]){3}FF", "000000FF"); Change almost white to black. The second RegExpReplace replaces slight shades of white. ; #include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <Misc.au3>