premultiplied-alpha

Impact of TYPE_INT_ARGB_PRE

丶灬走出姿态 提交于 2020-01-17 09:11:08
问题 I've been having some issues with a ConvolveOp that can be fixed by setting the imageType of the BufferedImage I'm working with to TYPE_INT_ARGB_PRE (see related SO answer here). Unfortunately I don't fully understand all the implications of selecting this different imageType and I can't seem to find a good reference either, so let me try here: Which drawing operations are affected by changing the imageType of a BufferedImage from TYPE_INT_ARGB to TYPE_INT_ARGB_PRE? Is it just

OpenGL ES 2.0 Alpha

旧时模样 提交于 2019-12-25 04:15:59
问题 I am trying to load a texture PNG ( exported by photoshop) and use it in OpenGL ES 2.0 in Android, but the solid color seems like transparent ( black circle in the png is totally black) I has been read that if you scale a png more than 50% that bug appear( I tested with scaling more and same so I supposed that is not the case) I also read that BitmapFactory dont read premultiplied alpha PNG ,I tryed another fuction that supposed that do the work but didnt work( maybe it was wrong) Any ways to

How to use pre-multiplied during image convolution to solve alpha bleed problem?

雨燕双飞 提交于 2019-12-20 09:58:08
问题 i'm trying to apply a box blur to an transparent image, and i'm getting a "dark halo" around the edges. Jerry Huxtable has a short mention of the problem, and a very good demonstration showing the problem happen: But i, for the life of me, cannot understand how " pre-multiplied alpha " can fix the problem. Now for a very simple example. i have a 3x3 image, containing one red and one green pixel: In reality the remaining pixels are transparent: Now we will apply a 3x3 Box Blur to the image.

math formula for color and alpha in webgl

半腔热情 提交于 2019-12-13 07:42:00
问题 body { background-color:black; } #myCanvas { background-color:rgba(55,23,88,0.5); // (bg_R,bg_V,bg_B,bg_A) } var myCanvas= document.getElementById("myCanvas"); gl = myCanvas.getContext("webgl", { premultipliedAlpha: true , alpha:true }); gl.clearColor(0.8, 0, 0, 0.5); // (ccR,ccV,ccB,ccA) gl.clear(gl.COLOR_BUFFER_BIT); Now i am looking the color of the resulting canvas : rvba = 222,8,33,255 var myCanvas= document.getElementById("myCanvas"); gl = myCanvas.getContext("webgl", {

Loading 4-channel texture data in iOS

耗尽温柔 提交于 2019-12-09 12:55:30
问题 I want to load 4-channel texture data from a file in iOS, so I consider the texture as a (continuous) map [0,1]x[0,1] -> [0,1]x[0,1]x[0,1]x[0,1] If I use the fileformat .png , XCode/iOS consider the file as an image, and so multiplies each component rgb with a (premultiplied alpha), corrupting my data. How should I solve this? Examples may be use two textures with components rgb (3-channel) postdivide alpha use another file format Of these, I consider the best solution to be to use another

Convert PNG from premultiplied-alpha to conventional alpha transparancy?

笑着哭i 提交于 2019-12-07 12:43:18
问题 I'm having a really hard time working with some source images in PNG format that have premultiplied alpha because most tools simply do not support it correctly. Is there anything out there that can do a "best guess" conversion to a more conventional PNG? 回答1: If by "premultiplied alpha" you mean iOS's PNG derivative, then you can convert them back to PNGs with pngdefry. Standard PNGs never use premultiplied alpha. 来源: https://stackoverflow.com/questions/7189417/convert-png-from-premultiplied

Convert PNG from premultiplied-alpha to conventional alpha transparancy?

感情迁移 提交于 2019-12-05 23:37:25
I'm having a really hard time working with some source images in PNG format that have premultiplied alpha because most tools simply do not support it correctly. Is there anything out there that can do a "best guess" conversion to a more conventional PNG? If by "premultiplied alpha" you mean iOS's PNG derivative, then you can convert them back to PNGs with pngdefry . Standard PNGs never use premultiplied alpha. 来源: https://stackoverflow.com/questions/7189417/convert-png-from-premultiplied-alpha-to-conventional-alpha-transparancy

How to handle alpha in a manual “Overlay” blend operation?

浪尽此生 提交于 2019-12-05 02:03:44
问题 I'm playing with some manual (walk-the-pixels) image processing, and I'm recreating the standard "overlay" blend. I'm looking at the "Photoshop math" macros here: http://www.nathanm.com/photoshop-blending-math/ (See also here for more readable version of Overlay) Both source images are in fairly standard RGBA (8 bits each) format, as is the destination. When both images are fully opaque (alpha is 1.0), the result is blended correctly as expected: But if my "blend" layer (the top image) has

Loading 4-channel texture data in iOS

不羁岁月 提交于 2019-12-03 16:10:43
I want to load 4-channel texture data from a file in iOS, so I consider the texture as a (continuous) map [0,1]x[0,1] -> [0,1]x[0,1]x[0,1]x[0,1] If I use the fileformat .png , XCode/iOS consider the file as an image, and so multiplies each component rgb with a (premultiplied alpha), corrupting my data. How should I solve this? Examples may be use two textures with components rgb (3-channel) postdivide alpha use another file format Of these, I consider the best solution to be to use another file format. The GL-compressed file format (PVRTC?) is not Apple-platform independent and seems to be of

How to use pre-multiplied during image convolution to solve alpha bleed problem?

最后都变了- 提交于 2019-12-02 20:52:52
i'm trying to apply a box blur to an transparent image, and i'm getting a "dark halo" around the edges. Jerry Huxtable has a short mention of the problem , and a very good demonstration showing the problem happen: But i, for the life of me, cannot understand how " pre-multiplied alpha " can fix the problem. Now for a very simple example. i have a 3x3 image, containing one red and one green pixel: In reality the remaining pixels are transparent: Now we will apply a 3x3 Box Blur to the image. For simplicities sake, we'll only calculate the new value of the center pixel. The way a box blur works