libimagequant
libimagequant copied to clipboard
keep alpha channel
use opencv cv::imread to read a png,it's a 4 channel cv::mat with alpha channel. but when I use libimagequant to compress that png file and write to disk, opencv read it as a 3 channel cv::mat which lost alpha channel. how can I solve this problem. @leahneukirchen @mdonoughe @jaalto @rflynn
PNG8 files don't have a separate alpha channel, they have transparency in palette entries. This should be possible to convert to a 4-channel image. Reading these files as 3-channel looks like an error.
I've seen people recommend IMREAD_UNCHANGED flag. Have you tried this?