1

I need to be able to work with images where some regions are grayscale while others are kept on the RGB format. I don't want to convert an image into a grayscale since it will lose the channels and will become simply one channeled, is there a way to keep the RGB channels of some pixels on the picture and turn the others into a grayscale?

David Safrastyan
  • 725
  • 7
  • 18

1 Answers1

5

NO.

I see two solutions to this:

  1. Have both a gray (Mat1b) and a rgb (Mat3b) image, and work on the image you need.
  2. Have a single rgb (Mat3b) image, and set r,g,b channels to the same gray value where you need. In this way you can mimic to have a mixed gray/rgb image.
Miki
  • 40,887
  • 13
  • 123
  • 202