Questions tagged [premultiplied-alpha]

Colorspace where each color component is multiplied by alpha value. This makes alpha blending faster and prevents color distortion when blending semitransparent colors together.

32 questions
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
9
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,784
  • 1
  • 13
  • 24
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,258
  • 1
  • 17
  • 42
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,390
  • 2
  • 37
  • 55
5
votes
3 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
  • 67,174
  • 23
  • 136
  • 201
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,061
  • 10
  • 26
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
  • 10,462
  • 1
  • 25
  • 46
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,142
  • 5
  • 27
  • 32
3
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
  • 13,489
  • 4
  • 35
  • 65
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; …
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,245
  • 2
  • 19
  • 30
2
votes
3 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
  • 532
  • 5
  • 11
2
votes
0 answers

How to use the TextureTool to create a PVR with premultiplied alpha?

How do I use the XCode texturetool to create a pvr texture with premultiplied alpha for iPhone?
Nitzan Wilnai
  • 915
  • 9
  • 22
2
votes
2 answers

PNG Image with BGRA CgBI premultiplied alpha

I have PNGs in Apple's iOS optimized BGRA PNG format (what I get using OptimizedPNG) and want to draw them in a way that tells CoreGraphics NOT to ignore the alpha component of the image. I'm drawing to a CGContextRef in drawRect: Edit: the rendered…
1
vote
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
  • 477
  • 4
  • 14
1
2 3