[FR] Grayscale to RGB
See original GitHub issueHi, I’m using albumentations
for my project, but my image is GrayScale with shape [H, W]
but I need to use RGB image (3 channels or [H, W, 3]
) for training neural networks. Does the library provides any transformation to convert grayscale to RGB
, which is similar to tf.image.grayscale_to_rgb
? thank you
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Grayscale to RGB Conversion - Tutorialspoint
Average method is the most simple one. You just have to take the average of three colors. Since its an RGB image, so...
Read more >DIP Grayscale to RGB Conversion - Javatpoint
To convert a grayscale image into color or RGB format, we have two methods. Both methods have their advantages as well as disadvantages....
Read more >How Do I Change From Grayscale to RGB in Photoshop?
There are a few ways to change from gray to RGB in Photoshop. One way is to go to the Image menu and...
Read more >How to Convert an RGB Image to a Grayscale - Baeldung
Grayscale is the simplest model since it defines colors using only one component that is lightness. The amount of lightness is described using...
Read more >Transform Grayscale Images to RGB Using Python's Matplotlib
Add two additional channels to a grayscale! There are a variety of ways to do this, so my way is below: copy the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A transformation
A.ToRGB
would be very usefull.@BloodAxe I understand your idea, but I think having a transformation like
A.RepeatChannels(3)
orA.ToRGB
will be more easy-to-use rather than usecv2.cvtColor
outsideA.Compose[...]
. Another question is how to scale image in range [0, 255] to [0, 1] liketorchvision
’sToTensor
, but when I tryalbumentations.pytorch.transforms.ToTensorV2
, it just swaps channels from [H, W, C] to [C, H, W]. Doesalbumentations
have any equivalent transform?