icon-lab / SynDiff

Official PyTorch implementation of SynDiff described in the paper (https://arxiv.org/abs/2207.08208).
Other
244 stars 37 forks source link

How to realize the conversion between Gray scale and rgb #18

Closed Yamm01 closed 1 year ago

Yamm01 commented 1 year ago

Thank you for this being public . I find that you are using grayscale images. I would like to know how to convert grayscale images to rgb images.

onat-dalmaz commented 1 year ago

There are different ways to convert grayscale images to RGB images. One simple way is to use the same gray value for each of the red, green and blue channels. For example, if the gray value is 128, then the RGB value is (128, 128, 128). This will produce a gray image with three channels1.

Another way is to use a tool or a library that can do the conversion for you. For example, you can use an online tool like GRAY to RGB converter2 or a Python library like TensorFlow3 or OpenCV to convert grayscale images to RGB images.

The conversion method may depend on your purpose and preference. You can experiment with different methods and see which one works best for you.