racket/draw

Determine if source image has alpha channel

Opened this issue · 4 comments

The procedure (send a-bitmap has-alpha-channel?) led me to believe that it would report whether the loaded image has an alpha channel, but apparently it only says whether the bitmap has been created with an alpha channel or not. I would like to request a feature that determines whether a source image has an alpha channel.

I was told that 'unknown/mask would only produce a mask if the source image had an alpha channel, but that is not the case - 'unknown/mask always produces a mask, it's just the mask will be completely black if there is no alpha.

is this still an issue? Please consider adding the label good first issue so it is findable:

Issues labeled good first issue in in Racket GitHub repositories

(send a-bitmap has-alpha-channel?) still only determines if the generated bitmap object was created with an alpha channel through make-bitmap or read-bitmap with any */alpha, not that the image itself has an alpha channel.

If you has some support would you have a go at resolving this yourself?

I think gif.rkt is the relevant code.

https://docs.racket-lang.org/draw/bitmap_.html#%28constructor._%28%28lib._racket%2Fdraw..rkt%29._bitmap~25%29%29

@lehitoskin was my response above helpful? Please let me know. Kind regards, Stephen