alpha

How to open PNG with CImg library without losing alpha channel?

萝らか妹 提交于 2019-12-05 06:09:05
问题 When I open png file: CImg<unsigned char> image("image.png"); ...I expect to get 4 channel (RGBA) image. But I always get 3 channel (RGB) image instead (even if the image is semitransparent): image.spectrum() returns 3 instead of 4. In my application, I always need to get 4 channels when I open PNG file. CImg looks like popular library with many useful features (some of which may be useful in the future in my image processing application), so I find it hard to believe that it is impossible to

Flatten the alpha channel in ggplot2

我只是一个虾纸丫 提交于 2019-12-05 05:36:39
Some objects (functions) of ggplot2 support an alpha channel. http://docs.ggplot2.org/current/geom_point.html This is a nice feature, but transparent colours in pdf and png files are often source of diversified trouble. How can I use the alpha option and get flattened pdf output files? I had ongoing problems with a large Latex doc created with knitr + ggplot that was perfectly readable on my mac but was unopenable for Windows users. After numerous attempts at optimizing and flattening the pdf, I finally isolated the issue to a single alpha-heavy plot. In my case, switching from pdf to png