Colorspace where each color component is multiplied by alpha value. This makes alpha blending faster and prevents color distortion when blending semitransparent colors together.
Questions tagged [premultiplied-alpha]
35 questions
13
votes
4 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
- 246,734
- 253
- 869
- 1,219
11
votes
5 answers
Method for converting PNGs to premultiplied alpha
Looking for some kind of simple tool or process for Windows that will let me convert one or more standard PNGs to premultiplied alpha.
Command line tools are ideal; I have easy access to PIL (Python Imaging Library) and Imagemagick, but will install…

Ipsquiggle
- 1,814
- 1
- 15
- 25
8
votes
1 answer
Dark halo around partial transparent parts of images in opengl
I am routinely finding with OpenGL, when I am trying to draw something on a texture and then later onto another surface, using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), I invariably end up with a colored halo (usually a darkish colored…

markt1964
- 2,638
- 2
- 22
- 54
7
votes
4 answers
How to handle alpha in a manual "Overlay" blend operation?
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…

Ben Zotto
- 70,108
- 23
- 141
- 204
6
votes
1 answer
How to tell whether the colors in a video frame decoded by FFmpeg are pre-multiplied by alpha?
When I decode video frames with FFmpeg (avcodec_decode_video2(), sws_scale()), with some videos (e.g., ProRes4444), I get colors pre-multiplied by alpha, and with other videos (e.g., QuickTime PNG), I get colors that aren't pre-multiplied by…

smokris
- 11,740
- 2
- 39
- 59
5
votes
6 answers
Loading 4-channel texture data in iOS
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…

telephone
- 1,131
- 1
- 10
- 29
4
votes
1 answer
How to mask an image with MetalPetal and output with transparency
I have an opaque image, and an opaque mask image. Using MetalPetal and it's MTIBlendWithMaskFilter I can create an output image, which correctly masks the input image, but is opaque with a black background.
I would like the output image to have an…

Ric Santos
- 15,419
- 6
- 50
- 75
4
votes
1 answer
Are images in ILC_COLOR32 image lists alpha premultiplied or not? I'm getting conflicting information
Very simple question here: Are ILC_COLOR32 Image Lists alpha-premultiplied or not? Various questions on Stack Overflow, like this one, imply they are; this wxWidgets bug, however, indicates otherwise. The only place where Microsoft actually says…

andlabs
- 11,290
- 1
- 31
- 52
3
votes
1 answer
Convert PNG from premultiplied-alpha to conventional alpha transparancy?
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…

ck_
- 3,353
- 5
- 31
- 33
3
votes
1 answer
Convert a CGImage to MTLTexture without premultiplication
I have a UIImage which I've previously created from a png file:
let strokeUIImage = UIImage(data: pngData)
I want to convert strokeImage (which has opacity) to an MTLTexture for display in an MTKView, but doing the conversion seems to perform an…

Plutovman
- 677
- 5
- 22
3
votes
4 answers
Draw a texture in OpenGL while ignoring its alpha channel
I have a texture loaded into memory that is of RGBA format with various alpha values.
The image is loaded as so:
GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
self.texNum = texture;
…

jcoplan
- 33
- 1
- 4
3
votes
5 answers
Compositing premultiplied images using ImageMagick
I have two images. One is background with no alpha. The other is a white cloud. The alpha of the cloud image is premultiplied with black. When I composite them the white cloud has black in it, so it looks grey instead of white like it should. I'm…

whereisalext
- 680
- 6
- 12
2
votes
1 answer
Premultiplied alpha and multisampling in OpenGL
I'm rendering some triangles into multisampled texture. Then blit this texture into normal texture and draw a textured quad onto screen.
I need the final texture to have premultiplied alpha. Is there a way to tell OpenGL to automatically premultiply…

nj16
- 63
- 5
2
votes
0 answers
Disable premultiplied alpha on Bitmap.compress
I am saving images from my Android application with myBitmaps.compress(Bitmap.CompressFormat.PNG, 100, stream) which works pretty well, even with an alpha channel (The BitmapFormat is ARGB_8888). Then I want to read the images back into the…

Erik Brendel
- 683
- 9
- 23
2
votes
1 answer
PIL - Prevent premultiplied alpha channel
I'm trying to add alpha channel on an image, but the result is not the expected one:
from PIL import Image
baseImage = Image.open('baseimage.png').convert('RGBA')
alphaImage =…

jbltx
- 1,255
- 2
- 19
- 34