Hi Fellas
Is it possible to change an individual colour of an image to another colour? If yes, how?
Cheers
Is it possible to change an individual colour of an image to another colour? If yes, how?
Cheers
' // Images //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%// SetMaskColor 255, 0, 255 Global imgHunter:TImage = LoadImage(foldername$ + "/suit_c1.png", MASKEDIMAGE) SetColor 255, 255, 255 SetClsColor 255, 0, 255 Cls DrawImage imgHunter, 0, 0 myPix:TPixMap = GrabPixmap(0,0,ImageWidth(imgHunter), ImageHeight(imgHunter)) For y = 0 To ImageHeight(imgHunter) - 1 For x = 0 To ImageWidth(imgHunter) - 1 argb = ReadPixel(myPix, x, y) Red = ARGB Shr 16 & 255 Green = ARGB Shr 8 & 255 blue = ARGB Shr 0 & 255 If Red = 104 And Green = 107 And Blue = 234 Then ' Brightest SetColor colorRed[0], colorGreen[0], colorBlue[0] DrawRect x, y, 1, 1 ElseIf Red = 50 And Green = 54 And Blue = 216 Then SetColor colorRed[1], colorGreen[1], colorBlue[1] DrawRect x, y, 1, 1 ElseIf Red = 39 And Green = 39 And Blue = 141 Then SetColor colorRed[2], colorGreen[2], colorBlue[2] DrawRect x, y, 1, 1 ElseIf Red = 22 And Green = 23 And Blue = 56 Then SetColor colorRed[3], colorGreen[3], colorBlue[3] DrawRect x, y, 1, 1 EndIf FlushMem Next Next SetColor colorRed[0], colorGreen[0], colorBlue[0] DrawRect ImageWidth(imgHunter) - 16, ImageHeight(imgHunter) - 16, 16, 16 my_pixmap:tpixmap=GrabPixmap(0,0,ImageWidth(imgHunter), ImageHeight(imgHunter)) SavePixmapPNG my_pixmap, "tmp.png", 0 system_ "pngcrush.exe tmp.png " + foldername$ + "/suit_c" + colorNum + ".png" DeleteFile "tmp.png"