alpha

How to create an alpha mask in iOS using sprite kit

瘦欲@ 提交于 2019-12-19 03:18:12
问题 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,

How to read an animated gif with alpha channel

三世轮回 提交于 2019-12-18 12:54:38
问题 While doing some tests with .gif animations in MATLAB I realised that somehow I can't read the transparency of the gif. Example: (Original source of the gif) If I do [img,cmap]=imread('Finnandjake.gif'); img is 4D with a redundant 3rd dimension (weird). After squeezing it ( img=squeeze(img); ), if I show it ( imshow(img(:,:,30),cmap) ): The transparency is gone, using another color from the image as background, thus deleting features. However [img,cmap,alpha]=imread('Finnandjake.gif');

PIL: Thumbnail and end up with a square image

邮差的信 提交于 2019-12-18 10:01:39
问题 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: <img src="/media/image.png" style="height:36px; width:36px" /> Can I have a letterbox style with either transparent or white around the image? 回答1: Paste the image into a transparent image with the right size as a background from PIL import Image size = (36, 36) image = Image.open(data) image.thumbnail(size, Image.ANTIALIAS) background =

Capturing EAGLview content WITH alpha channel on iPhone

拜拜、爱过 提交于 2019-12-18 05:13:30
问题 have been struggling with this issue for quite some time now and couldn't find an answer so far. Basically, what I want to do, is capturing the content of my EAGLview and then use it to merge it with other images. Anyway, the mainproblem is, that everything transparent in my EAGLview renders opaque when saving it to the photoalbum or putting it into a UIImageView. Let me share some code with you, I found somewhere else: - (CGImageRef) glToUIImage { unsigned char buffer[320*480*4];

Matplotlib Contourf Plots Unwanted Outlines when Alpha < 1

百般思念 提交于 2019-12-18 05:11:49
问题 I am using matplotlib in Python 2.7 to plot a filled contour plot. I want to overlay this over an image, so I am using the alpha keyword to make the plot semi-transparent. When I do this, the body of the contours are the correct transparency, but contourf() plots unwanted lines on the boundaries between different levels. I have attempted to eliminate them with the keyword argument linecolor='none', but this has not helped. Code: CS = map.contourf(xi, yi, zi, 25, alpha=0.3, linecolor='none') A

Rotate a PNG then resave with Image Transparency

假如想象 提交于 2019-12-17 19:26:03
问题 I'm having some major issues getting PNG transparency on a PNG that is being rotated. $filename = 'bird_up.png'; $source = imagecreatefrompng($filename) or die('Error opening file '.$filename); imagealphablending($source, false); imagesavealpha($source, true); $rotation = imagerotate($source, $degrees, imageColorAllocateAlpha($source, 0, 0, 0, 127)); imagealphablending($source, false); imagesavealpha($source, true); header('Content-type: image/png'); imagepng($rotation); imagedestroy($source)

iOS controlling UIView alpha behaviour for subviews

放肆的年华 提交于 2019-12-17 10:37:12
问题 In my example, I have 3 views: one red view containing two white views. I change the red container view's alpha to 0.3 and this happens (look at the image, the current result). By seeing this, I can only assume (tell me if I'm wrong) that setting a view's alpha will also set all of its subviews' alphas. My question is : is there a way to simply tell the red view to act as a whole so that setting its alpha would give something that looks like the wanted result (in the image)? This is what it

Emlog非插件实现3D标签云

谁说胖子不能爱 提交于 2019-12-14 19:47:05
第一步 module找到你的侧边栏标签 修改侧边栏标签如下 <? php //3D标签云 function widget_tag ( $title ){ global $CACHE ; $tag_cache = $CACHE -> readCache ( 'tags' );?> <div class = "side" > <h3><i class = "fa fa-tags mar-r-4" ></i> <? php echo $title ;?> </h3> <div id = "tag_cloud_widget" > <div class = "tagcloud" > <script type="text/javascript" src=" <? php echo TEMPLATE_URL ; ?> js / 3dtag . js "> </script> <? php foreach ( $tag_cache as $value ): ?> <a href=" <? php echo Url :: tag ( $value [ 'tagurl' ]); ?> " title=" <? php echo $value [ 'usenum' ]; ?> 篇文章"> <? php echo $value [ 'tagname' ]; ?> </a> <? php

“Screen” effect in Java 2D graphics

狂风中的少年 提交于 2019-12-14 01:21:29
问题 This is a question that's been bugging me for some time now: In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque. I would dearly love to be able to replicate this composite using Java 2D graphics, but my repeated attempts at trying to coax AlphaComposite into this have failed - and indeed I think this is outside of AlphaComposite's capabilities. A

Convert black parts of an image to transparent parts by batch file [closed]

独自空忆成欢 提交于 2019-12-13 08:04:53
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Hi guys I'm an animator working with textures that some of them need to Convert black parts of an image to transparent parts and it's really boring to sit and all the day do it with photoshop can't I do it with a batch file?tnx. 回答1: Another Way is to use these 2 commands :