alphablending

Merge two images with transparencies in PHP

℡╲_俬逩灬. 提交于 2019-12-06 04:43:15
问题 I'm attempting to make a composite image of several .png's with background transparencies via php and store the resulting image in my database. My problem is that the transparent sections of my images are being dropped when I merge the images. This is my code to create the composite image: $base = imagecreatefrompng('application/assets/images/vel1_bg.png'); imagealphablending($base, true); list($baseWidth, $baseHeight, $type, $attr) = getimagesize('application/assets/images/vel1_bg.png');

How to draw a translucent image on a form?

寵の児 提交于 2019-12-06 02:53:48
问题 I want to a draw a translucent image on a Delphi form, but for some reason it is not working. Here is the original PNG (border is semi transparent): I load the image in a TImage object: Image1.Transparent := True; Form1.Color := clWhite; Form1.TransparentColor := True; Form1.TransparentColorValue := clWhite; The application: The image isn't translucent. I am working with a BMP image that contains the alpha channel. Am I missing something? 回答1: I found a solution that will let you draw a BMP

Alphablend and TransparentBlt

随声附和 提交于 2019-12-06 02:47:56
问题 This question is related to my earlier question on SO. I want to combine two layers with alpha applied only to a specific portion of the source layer. One way I tried was to set SourceConstantAlpha to $ff (and have the function use the alpha channel in the source layer). This kind of works - although slow (I guess I can speed it up by using ScanLines), the kind of part is that I cannot figure out what to set the alpha channel to. The documentation suggests that the calculation is: st.Red =

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

iPhone OpenGL ES incorrect alpha blending

爱⌒轻易说出口 提交于 2019-12-05 12:01:54
I have a problem with incorrect alpha blending results with openGL ES on iPhone. This is my code for creating texture object: glGenTextures(1, &tex_name); glBindTexture(GL_TEXTURE_2D, tex_name); glTextImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, tex_height, GL_RGBA, GL_UNSIGNED_BYTE, tex_data); 'tex_data' is loaded from raw RGBA8888 data packed with zlib. It loads as it should, wich i've checked with a debugger. This is my code for setting up texture before rendering: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, tex_name); glTexParameteri

Can you override a parent UIView's alpha value on one of its subviews?

落花浮王杯 提交于 2019-12-05 08:02:24
I have a somewhat transparent view (alpha = 0.6) that has some subviews. I'd like one of the subviews (a UILabel) to be drawn with alpha of 1.0 because the blending makes the text difficult to read but by adding it as a subview of the main view it has adopted its parent's alpha value. Is there a way to override this behavior? I believe I'll have to remove it from the subview but wanted to ask and see if maybe I'm missing something. You are correct. You'll have to move the UILabel out of the transparent view to get it to render as non-transparent. Brian is right. For example : view

Recreate HSV color using blend modes

此生再无相见时 提交于 2019-12-05 00:25:12
问题 I’m working on an app that creates images whose hue, saturation, and value change according to different parameters. For performance reasons, it would make sense to render the hue, saturation, and value components separately, and then composite them together using Photoshop-style blending modes (multiply, overlay, screen, hue, etc). I already know how to do this for RGB images: split each channel into its own red, green, or blue image with values ranging from transparent to that channel’s

Is there an API to do per-pixel Alpha Blend on GTK and OSX?

十年热恋 提交于 2019-12-04 20:30:52
I want to draw transparent windows (with alpha channel) on Linux (GTK) and OSX. Is there an API to do that ? Note that I don't want to set a global transparency, the alpha level should be set per pixel. I'm looking for the same kind of API than the UpdateLayeredWindow function on Windows, as in this example: Per Pixel Alpha Blend . For Mac OS X, see the RoundTransparentWindow sample code. It works by using a custom completely transparent window and drawing shapes in it. Although the example only uses shapes with hard edges + overall alpha, arbitrary alpha can be used. Although the example uses

Faster alpha blending using a lookup table?

∥☆過路亽.° 提交于 2019-12-04 20:15:45
I have made a lookup table that allows you to blend two single-byte channels (256 colors per channel) using a single-byte alpha channel using no floating point values (hence no float to int conversions). Each index in the lookup table corresponds to the value of 256ths of a channel, as related to an alpha value. In all, to fully calculate a 3-channel RGB blend, it would require two lookups into the array per channel, plus an addition. This is a total of 6 lookups and 3 additions. In the example below, I split the colors into separate values for ease of demonstration. This example shows how to

Fade in an alpha-blended PNG form in Delphi

爷,独闯天下 提交于 2019-12-04 14:44:10
问题 I asked a question about this some years back when Vista was first released, but never resolved the problem and shelved it as something to consider later. I have a splash screen that I went to great effort to make look great. It's a 32bpp alpha-blended PNG. I have some code (which I can dig up if required!) that works great under Windows XP or under Vista+ when desktop composition is turned off. However, under Vista+ all the transparent parts are black, destroying everything that looks great