Skip to main content
added 20 characters in body
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Octave, 37 31 3126 bytes

This function performs a morphological dilationmorphological erosion on the Astan (1-b) part of the "image" using conv2 imdilateimerode, and then uses some arithmetic to make all three areas different symbols. Thanks @LuisMendo for -5 bytes!

@(b)imdilate(12*b-imerode(b,ones(3))-1+2*b 

Try it online!Try it online!

Octave, 37 31 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)imdilate(1-b,ones(3))-1+2*b 

Try it online!

Octave, 37 31 26 bytes

This function performs a morphological erosion on the Astan (1-b) part of the "image" using conv2 imerode, and then uses some arithmetic to make all three areas different symbols. Thanks @LuisMendo for -5 bytes!

@(b)2*b-imerode(b,ones(3)) 

Try it online!

added 5 characters in body
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Octave, 37 2931 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)b+2*imdilateimdilate(1-b,ones(3))-1+2*b 

Try it online!Try it online!

Convolution is the key to success.

Octave, 37 29 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)b+2*imdilate(1-b,ones(3)) 

Try it online!

Convolution is the key to success.

Octave, 37 31 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)imdilate(1-b,ones(3))-1+2*b 

Try it online!

added 6 characters in body
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Octave, 3737 29 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 conv2imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)b+2*(conv2b+2*imdilate(1-b,ones(3),'same')>0) 

Try it online!Try it online!

Convolution is the key to success.

Octave, 37 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2, and then uses some arithmetic to make all three areas different symbols.

@(b)b+2*(conv2(1-b,ones(3),'same')>0) 

Try it online!

Convolution is the key to success.

Octave, 37 29 bytes

This function performs a morphological dilation on the Astan (1-b) part of the "image" using conv2 imdilate, and then uses some arithmetic to make all three areas different symbols.

@(b)b+2*imdilate(1-b,ones(3)) 

Try it online!

Convolution is the key to success.

Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253
Loading