This is a nicer solution. Being an exercise I didn't bother adding comments - something I usually do (TomDoc or Yard format). Test coverage doesn't reach 100% but, again, it's just an exercise.

Some characters (B,C,G,M,O,R,W,Y) are shown using terminal colours.

Usage:

bundle exec ruby bitmap-editor.rb

Cheers