#include <GDIPlus.au3>
$t = TimerInit()
_GDIPlus_Startup()
$ImagePath = "image.jpg"
$hBitmap = _GDIPlus_BitmapCreateFromFile($ImagePath)
$Width = _GDIPlus_ImageGetWidth($hBitmap)
$Height = _GDIPlus_ImageGetHeight($hBitmap)
Global $aColors[] = [0x970000,0x009700,0x00008D] ; if $iR>0x96 or $iG>0x96 or $iB>0x8C =>
$hIA = _GDIPlus_ImageAttributesCreate()
$hNewImg = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $Width, $Height, $GDIP_PXF32PARGB)
_GDIPlus_BitmapDispose($hBitmap)
For $i = 0 To 2
$hBufImg = _GDIPlus_BitmapCreateFromScan0($Width, $Height)
$hBufGra = _GDIPlus_ImageGetGraphicsContext($hBufImg)
_GDIPlus_GraphicsClear($hBufGra, 0xFFFFFFFF) ; => then _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, 0xFFFFFFFF)
_GDIPlus_ImageAttributesSetColorKeys($hIA, 0, True, $aColors[$i], 0xFFFFFFFF)
_GDIPlus_GraphicsDrawImageRectRect($hBufGra, $hNewImg, 0, 0, $Width, $Height, 0, 0, $Width, $Height, $hIA)
_GDIPlus_ImageDispose($hNewImg)
_GDIPlus_GraphicsDispose($hBufGra)
$hNewImg = _GDIPlus_BitmapCloneArea($hBufImg, 0, 0, $Width, $Height, $GDIP_PXF32PARGB)
_GDIPlus_ImageDispose($hBufImg)
Next
_GDIPlus_ImageAttributesDispose($hIA)
_GDIPlus_ImageSaveToFile($hNewImg,"Result.jpg")
_GDIPlus_BitmapDispose($hNewImg)
_GDIPlus_Shutdown()
ConsoleWrite(TimerDiff($t) & @CRLF)