alphablending

Implementing Porter-Duff Rules in Direct3D

What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)? ...

Displaying controls on an alpha-blended form

I tried the Visual C# Kicks code for an alpha-blended form. This works (as soon as I remove the TransparencyKey property); that is, I can use the W3C's PNG alpha test image and see other windows underneath, but makes all controls on the form invisible. Presumably, they simply aren't painted, as OnPaint is overridden. I tried calling the ...

OpenGL: How to do RGBA->RGBA blitting without changing destination alpha

I have an OpenGL RGBA texture and I blit another RGBA texture onto it using a framebuffer object. The problem is that if I use the usual blend functions with glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), the resulting blit causes the destination texture alpha to change, making it slightly transparent for places where alpha previou...

Animations with full alpha in QT?

Is there an animation format supported in QT (using v4.4) that will support a full alpha channel? GIF only has one-bit transparency, and I don't think QT supports APNG. Update: MNG seems to be supported, but that's even less popular than APNG! Maybe SVG is my best bet. ...

What is the formula for alpha blending for a number of pixels?

I have a number of RGBA pixels, each of them has an alpha component. So I have a list of pixels: (p0 p1 p2 p3 p4 ... pn) where p_0_ is the front pixel and p_n_ is the farthest (at the back). The last (or any) pixel is not necessary opaque, so the resulting blended pixel can be somehow transparent also. I'm blending from the beginning o...

How to draw 32-bit alpha channel bitmaps?

I need to create a custom control to display bmp images with alpha channel. The background can be painted in different colors and the images have shadows so I need to truly "paint" the alpha channel. Does anybody know how to do it? I also want if possible to create a mask using the alpha channel information to know whether the mouse ha...

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 over the desktop (or whatever is displayed behind the browser window). Has anyone seen ...

Creating custom transparent control

Hi all, I am trying to create a custom control that displays a bitmap with per-pixel alphablend (as some of you already know for other questions). Right now I am using a custom control in the resource editor and I attach it to a class derived from CWnd. When I register my custom class I set the hbrBackground of the WNDCLASS structe to ...

What do the blend modes in pygame mean?

Surface.blit has a new parameter in 1.8: blend. The following values are defined: BLEND_ADD BLEND_SUB BLEND_MULT BLEND_MIN BLEND_MAX BLEND_RGBA_ADD BLEND_RGBA_SUB BLEND_RGBA_MULT BLEND_RGBA_MIN BLEND_RGBA_MAX BLEND_RGB_ADD BLEND_RGB_SUB BLEND_RGB_MULT BLEND_RGB_MIN BLEND_RGB_MAX Can someone explain what these modes mean? ...

Tackling alpha blend in OpenGL for better performance

Since having blends is hitting perfomance of our game, we tried several blending strategies for creating the "illusion" of blending. One of them is drawing a sprite every odd frame, resulting in the sprite being visible half of the time. The effect is quit good. (You'd need a proper frame rate by the way, else your sprite would be notice...

How to blend a quad, already with a texture on it.

I made a quad with a nice texture on it. The texture has an alpha channel (RGBA). I replaced the quad with the texture (GL_REPLACE), so now I have a billboard with (semi)transparant pixels on it. So far, no problem. But now I want to blend the entire billboard, so it's overall opacity changes. How would I do this? ...

I need an graphical Editor to create PNG files with alphatransparency

Unfortunately, Photoshop currently is the only graphical editor I can use to create PNG files with alphatransparency. I really hate it. But I need it. But can't afford it. Pixelmator looked so good, but it crashes over and over again. On my brand new MacBook Pro. Really, that's not an option. Gimp: It crashes imediately after start. A...

Saving images to db

I can save an image to the database streaming it to a byte array using the below code, but when it comes back out it has lost the alpha blending around the image and shows a blocky blue border. image.Save(stream, image.RawFormat); How can I get the original picture back out? ...

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 resulting colour. For example: The resulting pixel colour is 240,247,249 but I know that the ...

Does someone have an optimized function to premultiply bitmap by alpha ?

GDIPlus blend functions use premultiplied rgb channel by alpha bitmaps for efficiency. However premultiplying by alpha is a very costly since you have to treat each pixel one by one. It seem that it would be a good candidate for SSE assembly. Is there someone here that would want to share its implementation? I know that this is hard wor...

CSS: semi-transparent background, but not text

Is there a way in CSS to make the background of an element semi-transparent, but still have the text of the element non-transparent? (Without separating the text and background in two elements positioned over eachother.) I've tried <p style="position:absolute;background-color:green;filter:alpha(opacity=60);opacity:.6;"><span style="colo...

Blanket Alpha Component in GDI+

Is there a way I can set an Alpha value that affects all subsequent GDI/GDI+ calls? in other words, I am looking to set the transparency for all calls on a Graphics object. (I'm looking for something similar to how the *Transform functions affect the Graphics object they are called on) ...

Flickering child windows with alpha channels

When drawing child controls containing bitmaps with per-pixel alpha channels, we are getting quite a lot of flickering whenever they need to be redrawn. The actual blending is working correctly. I've found a lot of info about reducing flicker (such as this question or this site), but I can't seem to find anything that applies specifica...

AMD RenderMonkey GLSG Config for Alpha Transparency

I'm trying to use RenderMonkey to design a GLSL shader that uses Alpha transparency, and the RenderState editor doesn't use the same terms I'm used to from OpenGL. Can anyone advise on how to configure it for simple Alpha transparency? ...

C# Alpha Blend Transparent PictureBox

I have a webcam feed being displayed on my form and would like to draw on top of it. I was going to do this using a picture box, I have found the PictureBox doesn't support true transparency instead just the colour of the form it's on. It also doesn't support alphablending which is how I would want it to display, similar to how forms can...