alpha

OpenGL transparent images have black in them

一世执手 提交于 2019-12-01 03:43:57
问题 I am working on a game for Android and I was wondering why whenever I draw images with transparency there seems to always be some black added to the transparent parts. This happens all over and makes some of my effects look strange. Here is an example. The two circles are only white images with a blur but you can see when one overlaps the other it has a shadow. If I overlap two of the circles say in Inkscape I get pure white where they overlap. I am using GLES20.glEnable(GLES20.GL_BLEND);

How do I create an alpha only bitmap context

拈花ヽ惹草 提交于 2019-12-01 03:41:50
Apple tech note QA1037 says "To create an alpha-only bitmap context simply pass NULL for the colorspace parameter." However, I am not sure what to pass for the bitmapInfo parameter. I was trying something like this, with kCGImageAlphaOnly: CGContextRef ctx = CGBitmapContextCreate(NULL, scaledSize.width, scaledSize.height, 8, scaledSize.width, NULL, kCGImageAlphaOnly); But this gives me an warning about the enum being wrong. What should I put there instead? The docs clearly state you can use values from the CGImageAlphaInfo even though the parameter is defined as needed a value from the

Can I delete published app in alpha testing from google play?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 02:57:05
I have published my application in alpha testing for testing purpose. Now I want delete it permanently from listing. So, Is it possible to delete published application in alpha mode? If your app is in Alpha and no one has downloaded it. You have to unpublished your app first and then contact Google. They will delete your app for you. I had them delete 1 app for me. If you has not published your application yet you can delete it. Once you publish it you can only unpublish it. So you can delete it. You can only unpublish but cannot delete it. it will not display to user but it will be in your

How do I create an alpha only bitmap context

廉价感情. 提交于 2019-11-30 23:44:13
问题 Apple tech note QA1037 says "To create an alpha-only bitmap context simply pass NULL for the colorspace parameter." However, I am not sure what to pass for the bitmapInfo parameter. I was trying something like this, with kCGImageAlphaOnly: CGContextRef ctx = CGBitmapContextCreate(NULL, scaledSize.width, scaledSize.height, 8, scaledSize.width, NULL, kCGImageAlphaOnly); But this gives me an warning about the enum being wrong. What should I put there instead? 回答1: The docs clearly state you can

How to create an alpha mask in iOS using sprite kit

爱⌒轻易说出口 提交于 2019-11-30 21:55:43
The effect that I am trying to achieve is having a circle of light in an area of darkness. The effect is similar to that in pokemon games, when you are in a dark cave and only have limited vision surrounding you. From what I have tried and read, I have been unable to create a mask over nodes in sprite kit that has alpha levels. The masks I manage to create all have a hard edge, and basically just crop. Reading on the apple developer page about the SKCropNode, which has the maskNode property, it says "If the pixel in the mask has an alpha value of less than 0.05, the image pixel is masked out."

ggplot alpha levels appear different on fill and border of points (ringing artefact)

放肆的年华 提交于 2019-11-30 20:40:23
I am plotting many points using ggplot with a constant transparency value for all points. What I find is that the circular points have a more transparent fill than their individual border, so that the borders are noticeably brighter than their fill (I'm plotting light circles on a dark background), i.e. there seems to be a ringing artefact. The effect is that they look like rings rather than semi-transparent circles. library(ggplot2) set.seed(123) data <- data.frame( x = sample(1:100,2000, replace=T), y = sample(1:100,2000, replace=T) ) ggplot(data, aes(x,y)) + geom_point(alpha=0.2, color=

Resize images with transparency in php

纵然是瞬间 提交于 2019-11-30 18:32:53
I have looked all over for how to correctly manage alpha when I'm resizing a png. I've managed to get it to keep transparency, but only for pixels that are completely transparent. Here's my code: $src_image = imagecreatefrompng($file_dir.$this->file_name); $dst_image = imagecreatetruecolor($this->new_image_width, $this->new_image_height); imagealphablending($dst_image, true); imagesavealpha($dst_image, true); $black = imagecolorallocate($dst_image, 0, 0, 0); imagecolortransparent($dst_image, $black); imagecopyresampled($dst_image, $src_image, 0, 0, 0, 0, $this->new_image_width, $this->new

Adding an alpha channel to a Monochrome Image using Open CV Python

只愿长相守 提交于 2019-11-30 15:19:21
I have been working on colour images(RGB) and color images with an alpha channel(RGBA) . Reading an alpha channel from an RGBA image is pretty easy and I can even split the 4 channels of the image. Is there any method by which I can add an alpha channel to a monochrome or a grayscale image? Also, can alpha channel be separately added to the R,G,B Channels individually ? The code I am using to read a transparent image and split the channels is as follows - import cv2 img = cv2.imread(image1_path,-1) b = img[:,:,0] g = img[:,:,1] r = img[:,:,2] a = img[:,:,3] img_merge = cv2.merge((b,g,r,a)) cv2

How to convert 32-bit BMP to contain alpha channel? [closed]

此生再无相见时 提交于 2019-11-30 13:21:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have an PNG image with alpha, I need to convert it to BMP to be loaded to my OpenGL application. However, BMP has only 1 option for 32-bit, that is XRBG where 'X' is just an extra byte for padding purpose (4-byte alignment). The question is how to ultilise this 'X' byte to contain alpha channel, so that the

View with low alpha - Subview with high alpha

安稳与你 提交于 2019-11-30 12:36:53
问题 I have a UIView with an alpha of .5 I have added a subview with an alpha of 1. The subview seems to inherit the alpha value of the parent. Is there a way to make the subview more opaque than its parent view? code looks like this: CGRect promptFrame = CGRectMake(55, 80, 180, 50); UIView *inputPrompt = [[UIView alloc] initWithFrame: promptFrame]; [inputPrompt setBackgroundColor: [UIColor darkGrayColor]]; [inputPrompt setAlpha: .5]; inputPrompt.layer.cornerRadius = 8; inputPrompt.layer