# Remove a specific color (black) within an image [closed]

I need the image to be totally blank, so the black must disappear

• ConstantImage[1, ImageDimensions[image]]? May 15 '18 at 3:38
• You should really rephrase the title (please avoid uppercase) and explain better what you need. My best interpretation is below. May 15 '18 at 18:52
• I bet there is a question with the same image about something at least closely related. Hard to find though.
– Kuba
May 15 '18 at 19:39
• Possible duplicate of Eliminate the black color of the “W” so that it is equal to the “S” using Mathematica?. May 16 '18 at 2:25

Remove the white lines in the S with a vertical opening

Opening[i, {{1}, {1}, {1}}]


Remove the small black lines with a closing

Closing[%, 4]


Create a mask by inverting the colors and shrinking inside the boundary of the S with a 1 pixel erosion

mask = Erosion[1 - %, 1]


i + mask

• +1, That is what I though OP meant, but when I read the tittle again, op said clearly to BLANK ALL THE IMAGE :) I have feeling one needs to be extra psychic these days to answer questions at stackexchange. May 15 '18 at 19:11
• @juanmuñoz: MMA 10 didn't support arithmetic operators on images yet. You can convert the images to matrices, perform arithmetic on those, then convert back to image. So e.g. instead of img1 + img2 use Image[ImageData[img1]+ImageData[img2]] - or upgrade to MMA 11 May 16 '18 at 6:11