Copy of Image

I want to take an image and convert all colors to white leaving only the black pixels. I wrote the following code

using Images

pix=“”

for pixel in pix

2 Likes

An interesting guessing game! My guess:

using Images, TestImages

cat1 = testimage("chelsea")

cat2 = map(p -> Gray(p) > 0.2 ? colorant"white" : 
   colorant"black",  cat1)

mosaicview(cat1, cat2)

You can probably write a better “colour-detecting” function than this though. :slight_smile:

3 Likes

Sorry folks, Somehow a partial thought got posted. Not exactly sure how but please ignore.