-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Describe the question.
I have a numpy array with alpha channel and want to use nvimagecodec to encode it. But it doesn't seem to support it and returns None.
encoder = nvimgcodec.Encoder()
arr = np.random.randint(0, 255, (1024, 1024, 4), dtype=np.uint8)
enc_bytes = encoder.encode(arr, "png")
I see nvimagecodec can transcode a PNG image with alpha channel.
decoder = nvimgcodec.Decoder()
png = nvimgcodec.CodeStream("image.png") // image with alpha channel
img_d = decoder.decode(png, nvimgcodec.DecodeParams(color_spec=nvimgcodec.ColorSpec.UNCHANGED))
enc_bytes = encoder.encode(img_d, "png")
So I tried to convert numpy array to nvimagecodec.Image and got this error:
RuntimeError: Unexpected number of channels. Only 3 channels for RGB or 1 channel for gray scale are accepted.
Check for duplicates
- I have searched the open bugs/issues and have found no duplicates for this bug report
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested