Recoloring an image
Sometimes it is necessary to perform modifications on the image based on the values of particular pixels. Of course, this is possible, and you will learn how to do it in this recipe.
As an example, you will create an application that recolors all light parts of the image to black by analyzing the values of the following pixels. If the R (red), G (green), and B (blue) values are in the range [175, 255], the pixel is recolored to black.
Getting ready
To step through this recipe, you only need the automatically generated project.
How to do it...
To prepare an example that loads an image and recolors light parts of it, perform the following steps:
Install the
WriteableBitmapEx
library using the NuGet Package Manager.Add the
Image.jpg
file to theAssets
directory.Place the
Image
control where the modified photo will be shown on the page by adjusting the content of theMainPage.xaml
file, as follows:<Page (...)> <Grid> <Image ...