Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 4615

convert png transparent pixels to white

$
0
0
I have a png as a base64 that contains some transparent pixels whose rgb is (0,0,0). I want to convert the rgb of these pixels to white and set the alpha to 255. I read the image through: vector vectordata(string.begin(), strong.end()); mat = imdecode(vectordata, IMREAD_UNCHANGED); Then I change the pixels, by going one by one in the mat array and converting rgb values of the transparent pixels and fixing their transparency back to 255. Is there a faster way to do that? Like composting with a white image ?

Viewing all articles
Browse latest Browse all 4615


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>