alpha

Transparent png resizing with Python Image Library and the halo effect

纵饮孤独 提交于 2019-12-21 02:38:22
问题 There are a couple similar questions on SO, but none of them really helped. Basically I am trying to resize a simple png image, as seen here: http://media.spiralknights.com/wiki-images/3/3e/Equipment-Proto_Sword_icon.png (from the mmo Spiral Knights, copyright Three Rings Entertainment) I had originally implemented a utility which uses these images in php, and the resizing utility there worked perfectly well. I used the method described on the imagecopyresampled page in PHP's documentation.

Matplotlib: plotting transparent histogram with non transparent edge

ぐ巨炮叔叔 提交于 2019-12-20 09:12:32
问题 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 would like the edge of each bar not to become transparent as the inner part does. Here is an example: import matplotlib.pyplot as plt import numpy as np x = np.random.random(20) y =np.random.random(20) z= np.random.random(20) fig = plt.figure() ax =

Modify alpha opacity of LESS variable

我的梦境 提交于 2019-12-20 08:19:57
问题 Using LESS, I know that I can change the saturation or tint of a color variable. That looks like this: background: lighten(@blue, 20%); I want to change the alpha opacity of my color, though. Preferably like this: background: alpha(@blue, 20%); Is there a simple way to do this in LESS? 回答1: The site documentation gives the answer: background: fade(@blue, 20%); The function name is fade not alpha according to that document. 回答2: For completeness fade Set the absolute transparency of a color.

Problem reconstituting UIImage from RGBA pixel byte data

与世无争的帅哥 提交于 2019-12-20 07:08:33
问题 I need to create 12 coloured images from a single greyscale image ( red orange yellow etc ) Source image is actually a PNG, RGBA: I'm using a library I found ( https://github.com/PaulSolt/UIImage-Conversion/ ) to break the UIImage into a RGBA byte array which I then process pixel by pixel, and use the same library to reconstitute a new UIImage. This is my code: - (UIImage*) cloneWithTint3: (CGColorRef) cgTint { enum { R, G, B, A }; // - - - assert( CGColorGetNumberOfComponents( cgTint ) == 4

PHP GD - transparent PNG black background

帅比萌擦擦* 提交于 2019-12-20 04:38:13
问题 I am using PHP and GD to crop and output an image with the code below. it works fine but when i pass a transparent PNG into it i get a black background generated. How can i stop this? //setup switch ($source_type) { case IMAGETYPE_JPEG: $source = imagecreatefromjpeg($img_path); break; case IMAGETYPE_PNG: $source = imagecreatefrompng($img_path); break; } // setup cropped destination $cropped = imagecreatetruecolor($cropped_width, $cropped_height); // create cropped image $x = (($source_width /

PHP GD issues with ImageCreateTrueColor and PNGs

对着背影说爱祢 提交于 2019-12-20 04:30:50
问题 I am resizing PNG images using the GD image library function ImageCopyResampled(). It all works fine, I can even keep alpha blending transparency with the use of ImageCreateTrueColor() rather than using ImageCreate() to create the resized image. The problem is, that if I use ImageCreateTrueColor() rather than ImageCreate() the file size of PNG files increases from something like 80kb to 150kb. If I use ImageCreate() the file size stays around the same size, but colors screw! So my question is

How do I make a png with transparency appear transparent in MatLab?

依然范特西╮ 提交于 2019-12-20 02:47:08
问题 I have an image with a transparent background, but when I open it in MATLAB, I get a black background. I'm overlaying it on top of a background image. How can I get this to display? I've tried using the alpha function alpha(image,0) but it sets my entire image to 0. Is it possible for me to set the alpha of individual pixels to be equal to 0? That way I can run each pixel through a loop. I'm not sure if this helps, but when I run a imfinfo('ryu1.png') , I get : ... Transparency = 'alpha'

电机FOC中的坐标变换(CLARK+PARK+公式推导+仿真+C语言实现)【转载】

情到浓时终转凉″ 提交于 2019-12-20 00:17:37
0 前言 今天获知了,电机FOC包含了SVPWM、坐标转换、信号采集反馈、PID闭环控制等,这个控制策略,统称为FOC控制。一般SVPWM算法的实现是在静止的αβ坐标系上实现。而PID控制器由于是对直流参考信号的跟踪效果较好,因此三相交流电会经过坐标变换,在旋转的dq坐标轴上,可以用直流量描述电枢绕组的合成矢量。 FOC控制中,有两种坐标转换需要注意的,分别是clark变换,和park变换。clark变换将abc坐标系转换为αβ坐标系,而park变换将静止的αβ坐标系转换为旋转的dq坐标系。 1 clark变换 其实直接可以把转换公式列出。 写成转换矩阵,就是: clark变换的逆变换: 写成转换矩阵,就是: 将两个转换矩阵相乘,应该是一个单位矩阵,系数K的作用是可以将转换变为等幅值转换或者等功率转换。 当 ,是等幅值转换;当 ,是等功率转换。 1.1 matlab仿真 在matlab/simulink中搭建仿真模型: abcToAlphabeta中的代码: function y = fcn(a,b, c ) %#eml alpha = a - b/ 2 - c / 2 ; beta = sqrt( 3 )/ 2 * (b - c ); y = ( 2 / 3 )*[alpha;beta]; alphabetaToABC中的代码: function y = fcn (alpha

Separation logic

限于喜欢 提交于 2019-12-19 23:54:58
Separation logic Adding the heap memory writes , [ E 1 ] : = E 2 [E_1]:=E_2 [ E 1 ​ ] : = E 2 ​ memory reads, x : = [ E ] x:=[E] x : = [ E ] memory allocation, x : = c o n s ( E 1 , ⋯   , E n ) x:=cons(E_1,\cdots,E_n) x : = c o n s ( E 1 ​ , ⋯ , E n ​ ) memory deallocation, d i s o p o s e E disopose\ E d i s o p o s e E s t a c k : v a r − > v a l u e stack :var->value s t a c k : v a r − > v a l u e h e a p : l o c − > v a l u e heap :loc->value h e a p : l o c − > v a l u e l o c ⊆ v a l u e loc \subseteq value l o c ⊆ v a l u e Operational semantics E / s → v x : = E / ( s , h ) → s k i p

What is the bit depth of the alpha channel in CSS3 colors?

好久不见. 提交于 2019-12-19 04:23:24
问题 Inspired by this question, I realized I haven't been able to find a clear answer to what the bit depth of the a part of rgba and hsla in CSS3 colors actually is. I've hunted through various W3C documentation, but aside from specifying that alpha is represented as a float range 0.0% - 100.0%, and the definition for the bit depth of the alpha channel in PNGs, I don't really have a clear picture (haha) of what the limits of the alpha channel in CSS3 actually are. Can someone find something more