Questions tagged [alphablending]

Alpha blending is a convex combination of a translucent foreground color with a background color allowing for transparency effects.

530 questions
62
votes
3 answers

How to calculate an RGB colour by specifying an alpha blending amount?

I'm writing a colour picker that gets the pixel RGB values from wherever you point to on the screen. I want to also have the option of specifying that the colour I picked already has an alpha value. I'm just wondering how I can calculate the…
user90598
52
votes
2 answers

Creating a transparent window in C++ Win32

I'm creating what should be a very simple Win32 C++ app whose sole purpose it to ONLY display a semi-transparent PNG. The window shouldn't have any chrome, and all the opacity should be controlled in the PNG itself. My problem is that the window…
adoss
  • 1,061
  • 1
  • 9
  • 9
34
votes
5 answers

Is it possible to render web content over a clear background using WebKit?

I'm trying to gauge the possibility of a patch to WebKit which would allow all rendered graphics to be rendered onto a fully transparent background. The desired effect is to render web content without any background at all, it should appear to float…
Mark Renouf
  • 29,573
  • 19
  • 89
  • 120
34
votes
7 answers

blend two uiimages based on alpha/transparency of top image

I'm trying to blend a background with a foreground image, where the foreground image is a transparent image with lines on it. I am trying to do it this way. UIGraphicsBeginImageContext(CGSizeMake(320, 480)); CGContextRef context =…
saran
31
votes
2 answers

Android - Is it possible to declare an alpha mask directly within layer-list XML definition?

A newbie question I have this layers.xml that I use as a source for an ImageView. And two images, mask.png and image.jpg layers.xml:
Shlomi Schwartz
  • 11,238
  • 25
  • 93
  • 155
31
votes
1 answer

Multiple transparent textures on the same mesh face in Three.js

Is it possible to lay multiple textures on top of each other on the same face in Three.js so that the alpha blending is done GPU accelerated in webGL? The textures are (or should be) applied to the same face so that the bottom texture (texture 1) is…
Timo Kähkönen
  • 10,897
  • 8
  • 64
  • 105
26
votes
3 answers

Manually alpha blending an RGBA pixel with an RGB pixel

I am trying to do an alpha blend operation of an RGBA image (foreground image), on to a RGB image (background image). However, while doing so I think I may be doing the wrong alpha blending operation or doing it wrong. For example, the pixel of my…
19
votes
1 answer

Is it possible to achieve MAX(As,Ad) openGL blending?

I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate). I cannot simply render them into the sprite png, or…
Jeff B
  • 29,005
  • 6
  • 60
  • 85
17
votes
1 answer

Heatmap style gradients in .NET

I am trying to create a heat map with gradients that look similar to this: This image shows three points and the gradients blend nicely together. Here is what I am currently doing in my drawing function: public void DrawGradient(int x, int y,…
Jon Kump
  • 552
  • 6
  • 18
17
votes
3 answers

opengl - blending with previous contents of framebuffer

I am rendering to a texture through a framebuffer object, and when I draw transparent primitives, the primitives are blended properly with other primitives drawn in that single draw step, but they are not blended properly with the previous contents…
staticfloat
  • 5,816
  • 4
  • 34
  • 45
16
votes
2 answers

Remove transparency/alpha from any image using PIL

How do I replace the alpha channel of any image (png, jpg, rgb, rbga) with specified background color? It must also work with images that do not have an alpha channel.
Humphrey
  • 3,560
  • 2
  • 24
  • 26
14
votes
1 answer

UIColor `-colorWithPatternImage:` alpha blending problem solution. (iOS SDK 4.1)

Solution note, not a question. I used this code to set background as a pattern image: UIImage *bg = SomeImage(); UIColor *bgc = [UIColor colorWithPatternImage:bg]; [self setBackgroundColor:bgc]; [self setOpaque:NO]; This works, but alpha…
eonil
  • 75,400
  • 74
  • 294
  • 482
14
votes
1 answer

webgl transparency not working on some computers, why?

I am using Three JS to blend a video texture onto a canvas. I'm trying to make it so that the background of the videotexture is transparent but what ends up happening is the video is only transparent on some computers and not all. Below is a…
Terence Chow
  • 9,287
  • 19
  • 60
  • 120
13
votes
3 answers

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

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…
Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
12
votes
2 answers

What do the blend modes in pygame mean?

Surface.blit has a new parameter in 1.8: blend. The following values are…
Aaron Digulla
  • 297,790
  • 101
  • 558
  • 777
1
2 3
35 36