1
$\begingroup$

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

enter image description here

$\endgroup$

closed as off-topic by Alexey Popkov, Henrik Schumacher, Coolwater, Lukas Lang, corey979 May 15 '18 at 19:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Alexey Popkov, Henrik Schumacher, Coolwater, Lukas Lang
If this question can be reworded to fit the rules in the help center, please edit the question.

14
$\begingroup$

Remove the white lines in the S with a vertical opening

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

enter image description here

Remove the small black lines with a closing

Closing[%, 4]

enter image description here

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

mask = Erosion[1 - %, 1]

enter image description here

Add the mask to the original image

i + mask
(* i + Erosion[1 - Closing[Opening[i, {{1}, {1}, {1}}], 4], 1] *)

enter image description here

$\endgroup$
  • $\begingroup$ Well done, very clever! $\endgroup$ – Carl Lange May 15 '18 at 19:00
  • 1
    $\begingroup$ +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. $\endgroup$ – Nasser May 15 '18 at 19:11
  • $\begingroup$ Sorry Nasser, my english is bad, I use translator $\endgroup$ – juan muñoz May 16 '18 at 0:39
  • $\begingroup$ @Batracos , hello, it's just what I need, but it throws me an error, (mathematical use 10.4) dropbox.com/s/7laz7ni8zw6kcl5/error.png?dl=0 $\endgroup$ – juan muñoz May 16 '18 at 0:56
  • $\begingroup$ @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 $\endgroup$ – Niki Estner May 16 '18 at 6:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.