png

A way to create random-noise background image (png) with javascript?

女生的网名这么多〃 提交于 2020-01-12 05:32:04
问题 The new layout of YouTube added a background random-noise which I like very much, having seen almost exactely the same effect on other sites, so I plan to use the same technique in my webpage prototypes, or at least have this "trick" in my toolbox for future use. The image is like this (taken from http://g.raphaeljs.com/barchart.html): Now Youtube accomplishes the (embarrassingly identical) same effect by embedding the image in source code: (on Youtube main page, right click background to

Get pixel color of Base64 PNG using javascript?

本秂侑毒 提交于 2020-01-12 03:28:23
问题 I have a base64 encoded PNG. I need to get the color of a pixel using javascript. I assume I'll have to convert it back to a normal PNG. Can anyone point me in the right direction? 回答1: Create an Image object with the base64 image as the source. Then you can draw the image to a canvas and use the getImageData function to get the pixel data. Here's the basic idea (I haven't tested this): var image = new Image(); image.onload = function() { var canvas = document.createElement('canvas'); canvas

Can a BufferedImage be written to file any format?

让人想犯罪 __ 提交于 2020-01-11 14:18:19
问题 Is it correct that if we have a BufferedImage object in java, we could potentially write it out in ANY format using ImageIO.write (if we have a Writer object for the same)? I tried writing a BufferedImage object into a jpg file, it outputted an empty image file however when i tried writing it in to a png file, it worked fine. 回答1: A BufferedImage can be written into any format that ImageIO.write supports (that is, has an ImageWriter available), yes. Please show the code if you can't get it to

Can a BufferedImage be written to file any format?

半腔热情 提交于 2020-01-11 14:16:46
问题 Is it correct that if we have a BufferedImage object in java, we could potentially write it out in ANY format using ImageIO.write (if we have a Writer object for the same)? I tried writing a BufferedImage object into a jpg file, it outputted an empty image file however when i tried writing it in to a png file, it worked fine. 回答1: A BufferedImage can be written into any format that ImageIO.write supports (that is, has an ImageWriter available), yes. Please show the code if you can't get it to

Adding a transparent circle to an image on python with PIL

こ雲淡風輕ζ 提交于 2020-01-11 12:04:14
问题 I have a python program that craetes a png file with a circle on it. Now I want this circle to be semi transparent, given an alpha value. Here is what I do: img_map = Image.new(some arguments here) tile = Image.open('tile.png') img_map.paste(tile, (x,y)) canvas = ImageDraw.Draw(img_map) # Now I draw the circle: canvas.ellipse((p_x - 5, p_y - 5, p_x + 5, p_y + 5), fill=(255, 128, 10)) # now save and close del canvas img_map.save(path_out + file_name, 'PNG') how can I make the ellipse semi

Adler-32 checksum(s) in a PNG file

*爱你&永不变心* 提交于 2020-01-11 11:21:26
问题 I am currently writing a C program that builds a PNG image from a data file generated by another. The image is a palette type. Is the Adler-32 checksum calculated on the uncompressed data for... a) each compressed block within an IDAT data chunk? b) all compressed blocks within an IDAT data chunk? c) all compressed blocks spanning all IDAT data chunks? From the documents at http://www.w3.org/TR/PNG/, http://tools.ietf.org/html/rfc1950 and rfc1951 (at the same address as previuos) I am of the

How to convert Wbmp to Png?

99封情书 提交于 2020-01-11 05:33:27
问题 After spending much time researching about this on Google, I could not come across an example of converting a Wbmp image to Png format in C# I have download some Wbmp images from the internet and I am viewing them using a Binary Editor. Does anyone have an algorithm that will assist me in doing so or any code will also help. Things I know so far: First byte is type* (0 for monochrome images) Second byte is called a “fixed-header” and is 0 Third byte is the width of the image in pixels* Fourth

材质允许png格式的图片透明

心不动则不痛 提交于 2020-01-11 05:11:23
如何使用带透明的png图片材质 创建cesium元素,经常需要使用材质贴图,有的需要使用png格式的图片 这时,如何直接指图片路径,则在cesium中显示png图片的透明部分会被自动填充,解决办法如下 const material = new Cesium . ImageMaterialProperty ( { image : imageUrl , repeat : Cesium . Cartesian2 ( 1.0 , 1.0 ) , // 不重复 transparent : true , // 启用png透明 color : Cesium . Color . WHITE . withAlpha ( 0.5 ) } ) 来源: CSDN 作者: 丰色木夕 链接: https://blog.csdn.net/youlinhuanyan/article/details/103890551

Setting DPI for PNG files

本小妞迷上赌 提交于 2020-01-11 02:16:32
问题 I have a bunch of diagrams created using a Java diagramming tool that I wrote - they are mostly black and white diagrams, with the blocks in aqua, and occasional other colours. They are currently being saved as JPG files, and I want to insert them into a book that I am preparing for Print On Demand. The book is an OpenOffice ODT file, which will later be converted to a PDF. Currently I use JPG files, but the print facility they use requires 300 DPI, so I modified my diagramming tool to set

将绘图保存到图像文件,而不是使用Matplotlib显示

时光毁灭记忆、已成空白 提交于 2020-01-11 01:58:54
我正在编写一个快速脚本来动态生成绘图。 我使用下面的代码(来自 Matplotlib 文档)作为起点: from pylab import figure, axes, pie, title, show # Make a square figure and axes figure(1, figsize=(6, 6)) ax = axes([0.1, 0.1, 0.8, 0.8]) labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15, 30, 45, 10] explode = (0, 0.05, 0, 0) pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True) title('Raining Hogs and Dogs', bbox={'facecolor': '0.8', 'pad': 5}) show() # Actually, don't show, just save to foo.png 我不想将图形显示在GUI上,而是要将图形保存到文件(例如foo.png)中,以便可以在批处理脚本中使用它。 我怎么做? #1楼 如果您不喜欢“当前”数字的概念,请执行以下操作: import matplotlib.image as mpimg