alpha

Alpha channel in OpenCV

守給你的承諾、 提交于 2019-11-27 03:38:13
问题 does OpenCV support alpha-channel? Or is there any way to work with transparent png? I need to merge two images, where the first one is background and the second one is image which was rotated by cvWarpAffine. I can do this by merging pixels one by one and omit pixels with some value, which I set in cvScalar in cvWarpAffine. However, I don't think that this is intended solution. Thanks for suggestions 回答1: Updated answer: Use CV_LOAD_IMAGE_UNCHANGED flag to load all four channels (including

iPhone - Create a semi transparent rectangle with opaque text

偶尔善良 提交于 2019-11-27 02:51:29
问题 I have a MapView and I want to display a black semi transparent rectangle on top with a text inside. Not over the entire map only on section of it (maybe on the top corner) just as an info box (like the one in the iPod player that appears on double tap and displays the Mute and skip buttons). I tried google but I'm not getting any clear answers. How is the best way to accomplish this? Thanks in advance 回答1: Can be easily done with interface builder: View Hierarchy NOTE The background has to

AlphaAnimation does not work

巧了我就是萌 提交于 2019-11-27 01:46:02
问题 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 0.0f to 1.0f. My problem is that when I click the image, nothing happens. But the strange thing, is that if I set it's alpha to 1 in the layout definition, and I click the image, I can see the animation (alpha 1 -> alpha 0 -> alpha 1). What am I doing

Set BufferedImage alpha mask in Java

自古美人都是妖i 提交于 2019-11-27 00:47:04
I have two BufferedImages I loaded in from pngs. The first contains an image, the second an alpha mask for the image. I want to create a combined image from the two, by applying the alpha mask. My google-fu fails me. I know how to load/save the images, I just need the bit where I go from two BufferedImages to one BufferedImage with the right alpha channel. Michael Myers Your solution could be improved by fetching the RGB data more than one pixel at a time(see http://java.sun.com/javase/6/docs/api/java/awt/image/BufferedImage.html ), and by not creating three Color objects on every iteration of

Android and setting alpha for (image) view alpha

余生颓废 提交于 2019-11-27 00:29:16
Is there really no XML attribute counterpart to setAlpha(int) ? If not, what alternatives are there? No, there is not, see how the "Related XML Attributes" section is missing in the ImageView.setAlpha(int) documentation. The alternative is to use View.setAlpha(float) whose XML counterpart is android:alpha . It takes a range of 0.0 to 1.0 instead of 0 to 255. Use it e.g. like <ImageView android:alpha="0.4"> However, the latter in available only since API level 11. jfcogato It's easier than the other response. There is an xml value alpha that takes double values. android:alpha="0.0" thats

How to set opacity of background colour of graph wit Matplotlib

China☆狼群 提交于 2019-11-27 00:25:52
I've been playing around with Matplotlib and I can't figure out how to change the background colour of the graph, or how to make the background completely transparent. If you just want the entire background for both the figure and the axes to be transparent, you can simply specify transparent=True when saving the figure with fig.savefig . e.g.: import matplotlib.pyplot as plt fig = plt.figure() plt.plot(range(10)) fig.savefig('temp.png', transparent=True) If you want more fine-grained control, you can simply set the facecolor and/or alpha values for the figure and axes background patch. (To

Transparent background with three.js

别等时光非礼了梦想. 提交于 2019-11-27 00:04:04
The code work, but I'm having a problem setting transparent background to the canvas with three.js. I use: Background.renderer.setClearColor(0xffffff, 0); But then the background gets black. How do I change it to be transparent? The code: var camera, scene, renderer; var mouseX = 0, mouseY = 0; var p; var windowHalfX = site.Width / 2; var windowHalfY = site.Height / 2; Background.camera = new THREE.PerspectiveCamera( 35, site.Width / site.Height, 1, 2000 ); Background.camera.position.z = 300; //camera.position.y = 200; // scene Background.scene = new THREE.Scene(); // texture var manager = new

CGBitmapContextCreate with kCGImageAlphaNone

╄→尐↘猪︶ㄣ 提交于 2019-11-26 22:50:42
问题 I desperately need to create a CGContextRef WITHOUT an alpha channel. Unfortunately, with Core Graphics you CANNOT specify kCGImageAlphaNone with CGBitmapCreateContext. Can someone PLEASE post a working example of how I can create a CGContextRef WITHOUT an alpha channel? The reason I need this is because I'm ultimately trying to call CGImageCreateWithMaskingColors, which, of course, will NOT work if the CGImageRef provided has an alpha channel. Please post a working example. If you do you can

Any way to make plot points in scatterplot more transparent in R?

柔情痞子 提交于 2019-11-26 22:35:10
问题 I have a 3 column matrix; plots are made by points based on column 1 and column 2 values, but colored based on column 2 (6 different groups). I can successfully plot all points, however, the last plot group (group 6) which was assigned the color purple, masks the plots of the other groups. Is there a way to make the plot points more transparent? s <- read.table("/.../parse-output.txt", sep="\t") dim(s) [1] 67124 3 x <- s[,1] y <- s[,2] z <- s[,3] cols <- cut(z, 6, labels = c("pink", "red",

Android bitmap mask color, remove color

邮差的信 提交于 2019-11-26 20:15:29
问题 I am creating bitmap, next i am drawing second solid color bitmap on top of it. And now i want to change first bitmap, so solid color that i drawed on it will be transparent. Or simply, i want to remove all pixels of one color from bitmap. I havie tried every colorfilter, and xfermode with no luck, is there any other possibility to remove color other that doing it pixel by pixel? 回答1: This works for removing a certain color from a bitmap. The main part is the use of AvoidXfermode. It should