Questions tagged [alpha]

An alpha channel determines the transparency of an image or view. Lower values are more transparent, and higher values are more opaque

An alpha channel determines the transparency of an image or view. Lower values are more transparent, and higher values are more opaque

1779 questions
61
votes
2 answers

Individual alpha values in scatter plot

I'm wondering if it is possible to have individual alpha values for each point to be plotted using the scatter function of Matplotlib. I need to plot a set of points, each one with its alpha value. For example, I have this code to plot some…
pceccon
  • 9,379
  • 26
  • 82
  • 158
59
votes
2 answers

Adjust Transparency (alpha) of stat_smooth lines, not just transparency of Confidence Interval

Using ggplot2's stat_smooth(), I'm curious how one might adjust the transparency of the generated regression line. Using geom_points() or geom_line(), one normally sets a value for 'alpha', indicating the percent transparency. However, with…
EconomiCurtis
  • 2,107
  • 4
  • 23
  • 33
57
votes
7 answers

PIL: Thumbnail and end up with a square image

Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need to end up displaying the image like this: Can I have a letterbox…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
51
votes
6 answers

colorWithAlphaComponent example in Swift

What is the correct syntax for this function in Swift? The following works fine, and colors the background purple: self.view.backgroundColor = UIColor.purpleColor() When I chain the colorWithAlphaComponent function, the view shows the correct…
kmiklas
  • 13,085
  • 22
  • 67
  • 103
45
votes
3 answers

Add alpha channel to hex color declared on css variable

Like the title says, i would like to somehow add transparency to a hex color defined in css variable. I have seen solutions in other posts using rgb, but I need hex. Maybe with rgba(), calc() or linear-gradient(), but I didn't reach any result with…
Jose Varela
  • 451
  • 1
  • 4
  • 5
45
votes
4 answers

Plotting transparent histogram with non transparent edge

I am plotting a histogram, and I have three datasets which I want to plot together, each one with different colours and linetype (dashed, dotted, etc). I am also giving some transparency, in order to see the overlapping bars. The point is that I…
Argentina
  • 1,071
  • 5
  • 16
  • 30
39
votes
3 answers

Android alpha animation fadein fadeout with delays

I want to do a very simple alpha animation but I cannot find a valid way. The idea is to perform this animation over a view: alpha from 0 to 1 of 1 second hold alpha at 1 for 5 seconds alpha from 1 to 0 of 1 second hold alpha at 0 for 5…
zegnus
  • 1,437
  • 3
  • 17
  • 23
37
votes
4 answers

AlphaAnimation does not work

I have been looking for a solution to my problem. But my code seems to be ok. I'll try to explain: I have a TextView with android:alpha="0" in my layout definition. I want (when a image is clicked) show that TextView with an AlphaAnimation, from…
jjimenez
  • 853
  • 1
  • 7
  • 18
35
votes
3 answers

Core Animation is not working with "alpha" value

Before this code, my movie pic alpha is set to 0, CABasicAnimation* fadein= [CABasicAnimation animationWithKeyPath:@"alpha"]; [fadein setToValue:[NSNumber numberWithFloat:1.0]]; [fadein setDuration:0.5]; [[moviepic…
5argon
  • 3,683
  • 3
  • 31
  • 57
35
votes
6 answers

How to change a bitmap's opacity?

I have a bitmap: Bitmap bitmap = BitmapFactory.decodeFile("some/arbitrary/path/image.jpg"); But I'm not going to display the image to the user. I want the alpha to be 100 (out of 255). If this is not possible, can I set the opacity of the Bitmap?
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
35
votes
6 answers

Detect Alpha Channel with ImageMagick

Scenario I would like to save images with alpha transparency as .png and images without alpha transparency as .jpg (even if their original format is .png or .gif). How can I detect whether or not an image has alpha transparency using ImageMagick?
brad
  • 73,826
  • 21
  • 73
  • 85
33
votes
4 answers

iPhone Programming: Applying Alpha to Parent but not to Child Views

Is it possible to set Alpha to .75 or .50 (transparent) for Parent view but the Child views/controls are opaque (Alpha channel 1.0 - completely visible). Whenever i set Alpha of my main UIView to transparent, all the child views/controls are also…
Mustafa
  • 20,504
  • 42
  • 146
  • 209
32
votes
8 answers

JPEG image with transparency

I would like to make a JPEG image file with some pixels that are partially transparent or fully transparent, similar to a PNG file with an alpha channel. Is this possible? If so, how would I go about doing this? I would like to use the image on a…
Elias Zamaria
  • 96,623
  • 33
  • 114
  • 148
31
votes
8 answers

How to draw transparent polygons?

I'm using PIL (Python Imaging Library). I'd like to draw transparent polygons. It seems that specifying a fill color that includes alpha level does not work. Are their workarounds? If it can't be done using PIL I'm willing to use something…
carrier
  • 32,209
  • 23
  • 76
  • 99
31
votes
2 answers

How to use alpha transparency in OpenGL?

Here's my code: void display(void); int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable( GL_BLEND ); …
H-H
  • 4,431
  • 6
  • 33
  • 41