Opacity() method removing alpha from all pixels
Posted: 2012-11-12T22:18:21-07:00
Using the C++ api, it seems like the opacity() method applies the same alpha value to all pixels in the image. If I use a completely opaque image, I can fade the entire image correctly. However, if the source image already contains alpha, such as a alpha gradient, or transparent corners, etc... the opacity() method seems to replace the alpha values... and thus removes the original transparency from the source image.
What is the best way to increase (or decrease) the existing alpha values in an image... without replacing them all with a single value?
For example, in the popular vector graphics app Inkscape, if you have a rectangle which contains an alpha gradient... you can still apply an opacity to the entire shape, which preservers the alpha gradient... it just increases the alpha or decreases the alpha values in the shape.
Thanks!
-Jonathan
What is the best way to increase (or decrease) the existing alpha values in an image... without replacing them all with a single value?
For example, in the popular vector graphics app Inkscape, if you have a rectangle which contains an alpha gradient... you can still apply an opacity to the entire shape, which preservers the alpha gradient... it just increases the alpha or decreases the alpha values in the shape.
Thanks!
-Jonathan