Questions tagged [alpha-transparency]

The alpha transparency of an image defines how transparent the pixels of this image are. Typically, each pixel has an alpha value between 0 (fully transparent) and 255 (fully opaque).

Alpha transparency is an attribute of pixels within an image (or image layer) which determines how transparent the pixel is, by blending the pixel color with the color of the pixel in the layer beneath it. most image editing software allow to edit a layer or image alpha transparency. The alpha value is saved in addition to the RGB value of the pixel. Ranges of transparency may change according to the software setup.

Alpha Transparency as part of Alpha Compositing.

468 questions
395
votes
17 answers

Replace transparency in PNG image with white background

I have a PNG image with an alpha channel (i.e. transparency), and I need to create versions with the image layer composed onto a white background. I want to use a scriptable command using a CLI tool such as Image Magick to directly convert PNG to…
Pointy
  • 405,095
  • 59
  • 585
  • 614
163
votes
8 answers

Set transparent background using ImageMagick and commandline prompt

Suppose you have any image (PNG or JPG). This image has a white background and I need to make this background transparent. I have tried with these examples: convert original.png -background none transparent.png convert original.png -background…
Israel
  • 3,252
  • 4
  • 36
  • 54
92
votes
10 answers

Setting alpha on UIView sets the alpha on its subviews which should not happen

According to the documentation for UIVIew @property(nonatomic) CGFloat alpha The value of this property is a floating-point number in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque. This…
Avba
  • 14,822
  • 20
  • 92
  • 192
76
votes
4 answers

geom_rect and alpha - does this work with hard coded values?

Same title, completely reworded the question though. Why does the alpha work in the first plot but not the second? I'm struggling to see why with hardcoded values the rect is drawn in the right place but not made transparent but when in a data.frame…
nzcoops
  • 9,132
  • 8
  • 41
  • 52
62
votes
5 answers

Transparent equivalent of given color

I've had this a few times, so here goes: I'm making some plots which hold curves with estimates of a parameter given a tuning parameter. Typically, I also have SDs for each estimated value, so I could show error bars around each of them. However, I…
Nick Sabbe
  • 11,684
  • 1
  • 43
  • 57
56
votes
9 answers

Is there a way to set drawable's Alpha using XML?

Easy like itself . I wanna make an alpha button , which would have a selected drawable this way:
A.Quiroga
  • 5,704
  • 6
  • 37
  • 58
47
votes
1 answer

Convert Transparent PNG to JPG with Non-Black Background Color

I'm using System.Drawing.Image in .Net to do a simple conversion from png to jpeg. I'm basically just using these two lines of code: Image img = Image.FromFile(filename); img.Save(newFilename, System.Drawing.Imaging.ImageFormat.Jpeg); it works…
DaveS
  • 895
  • 1
  • 8
  • 20
37
votes
4 answers

How to create a semi transparent shape?

I would like to know how to draw semi-transparent shapes in OpenCV, similar to those in the image below (from http://tellthattomycamera.wordpress.com/) I don't need those fancy circles, but I would like to be able to draw a rectangle, e.g, on a 3…
Bokonon
  • 391
  • 1
  • 5
  • 8
32
votes
1 answer

Set alpha-transparency only to layout and not to it's children

I've found this question and I have almost the same problem. How could I apply alpha only to a relative layout and not to it's children? Could anyone help? I have a rectangular LinearLayout that has some margin, some round corners and an alpha…
Alin
  • 1,044
  • 6
  • 20
  • 42
27
votes
2 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…
22
votes
2 answers

Using Graphics.DrawImage() to Draw Image with Transparency/Alpha Channel

I'm copying an image. (My actual code is resizing the image but that's not relevant to my question.) My code looks something like this. Image src = ... using (Image dest = new Bitmap(width, height)) { Graphics graph = Graphics.FromImage(dest); …
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
19
votes
3 answers

Alpha-gradient on Android

I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML. Image for example
ftp27
  • 885
  • 1
  • 12
  • 31
18
votes
3 answers

CSS opacity and child elements

Rob
  • 8,042
  • 3
  • 35
  • 37
17
votes
2 answers

Is it possible to have two overlapping PictureBox controls with transparent images?

Having two overlapping PictureBox controls, I'm trying to make the transparent areas of the picture box let the controls below (in the z-order) being visible. Even after trying what Microsoft suggests, I cannot get the desired result. This is what I…
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
16
votes
1 answer

SVG: Prevent transparent gaps between adjacent polygons

Consider the following small SVG showing two adjacent triangles:
halirutan
  • 4,281
  • 18
  • 44
1
2 3
31 32