Android Question Replace Color in a Bitmap


Active Member
Licensed User
Longtime User
Hey Community,
My question is very simple. Is it possible to replace a color with another in one bitmap? I found already a way to remove a color but no way to replace something...

Thanks for answers

Peter Simpson

Licensed User
Longtime User
Hello @chrjak,
You need the RSImageProcessing Library. The code below will replace the color Black with the color Red in a jpg. Please look at the attached file. The bottom half of the image is actually black.

'RSImageProcessing library needed

    Dim rsie As RSImageEffects   

    Dim ImageViewTemp As ImageView

    Dim BitmapTemp As Bitmap
        BitmapTemp.Initialize(File.DirAssets, "Image1.jpg")
        BitmapTemp = rsie.ReplaceColor(BitmapTemp, Colors.Black, Colors.Red)

    ImageViewTemp.Bitmap = BitmapTemp
    Activity.AddView(ImageViewTemp, 0dip, 0dip, 100%x, 100%y)


    7.2 KB · Views: 176
Last edited:
Upvote 0


Active Member
Licensed User
Longtime User
wow, thank you all so much!
That helped me really!

@simpson I knew there is somewhere i function :D i already red over this some months before
@Fusseldieb and @derez thanks so much! Now I know how to do a great animation ;)

Thanks again!
Upvote 0