png

Save Bitmap with transparency to PNG in Delphi 2007

断了今生、忘了曾经 提交于 2020-01-24 09:42:25
问题 I have a Delphi bitmap (32Bit) that has transparency information. I need to convert and save it to a PNG file while preserving the transparency. The tools I currently have are the graphics32 Library, GR32_PNG (by Christian Budde), and PNGImage (by Gustavo daud). What is the best way to do this? EDIT 1 : There is not just one color in my bitmap that's transparent but pixels with varying levels of transparency that needs to be preserved. EDIT 2 : I am getting my bitmap with alpha information by

批量svg转化成png

僤鯓⒐⒋嵵緔 提交于 2020-01-24 00:22:02
#需要提前安装cairosvg模块,下载地址http: // cairosvg.org / download / ! encoding:UTF-8 import cairosvg import os loop = True while loop: svgDir = raw_input(“请输入SVG文件目录”) if os.path.exists(svgDir) and os.path.isdir(svgDir): loop = False else: print “错误:您输入的SVG文件目录不存在或者不是一个有效的目录,请重新输入” loop = True while loop: exportDir = raw_input(“请输入导出目录”) if os.path.exists(exportDir): loop = False else: print “错误:您输入的导出目录[”, exportDir, “] 不存在,是否要创建这个目录?” loops = True while loops: msg = “” cmd = raw_input(“创建 (Y) 重新 ®”) if cmd.upper() == “R”: loops = False elif cmd.upper() == “Y”: os.makedirs(exportDir, True) if os.path

three.js toDataURL PNG is black

不打扰是莪最后的温柔 提交于 2020-01-23 17:40:06
问题 I'm trying to grab a screenshot with renderer.domElement.toDataURL("image/png"), and save it to a file. The image is the right size, but it's black. I have preserveDrawingBuffer turned on. I think I'm decoding and saving the file correctly, because when I hexdump it I can see the correct initial characters for the PNG format, as well as the IHDR and IDAT chunk headers. However the closing IEND is missing. Any known issues here? Hints? Windows 7/Firefox up to date if it matters. Thanks...

R: crop multiple pngs and combine them into a single plot

无人久伴 提交于 2020-01-23 13:24:29
问题 I am plotting data into two plots like this: xy <- structure(list(NAME = structure(c(2L, 2L, 1L, 1L), .Label = c("CISCO", "JOHN"), class = "factor"), ID = c(41L, 41L, 57L, 57L), X_START_YEAR = c(1965L, 1932L, 1998L, 1956L), Y_START_VALUE = c(960L, -45L, 22L, -570L), X_END_YEAR = c(1968L, 1955L, 2002L, 1970L), Y_END_VALUE = c(960L, -45L, 22L, -570L), LC = structure(c(1L, 1L, 2L, 2L), .Label = c("CA", "US"), class = "factor")), .Names = c("NAME", "ID", "X_START_YEAR","Y_START_VALUE", "X_END

PyQt(Python+Qt)学习随笔:model/view架构中的QStandardItemModel使用案例

為{幸葍}努か 提交于 2020-01-23 03:53:19
老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 1、案例说明 在应用中展示指定目录的图标文件的文件名和图标,界面就是一个简单的窗口上面放置一名为listView的列表视图,在视图中展示这些文件名和图标。 2、在界面派生类中定义模型并将模型和视图关联 class mainWindow ( QtWidgets . QWidget , ui_listView . Ui_mainWin ) : def __init__ ( self ) : super ( mainWindow , self ) . __init__ ( ) self . setupUi ( self ) self . model = QStandardItemModel ( ) ICon1 = QStandardItem ( QIcon ( r "F:\学习\python\资源\图像文件\add.png" ) , 'add.png' ) ICon2 = QStandardItem ( QIcon ( r "F:\学习\python\资源\图像文件\application_windows_add.png" ) , 'application_windows_add.png' ) ICon3 = QStandardItem ( QIcon ( r "F:\学习\python

快速生成 Mac App icns 图标

混江龙づ霸主 提交于 2020-01-23 00:22:07
1 准备一个 1024 * 1024 的png图片,假设名字为 pic.png 2 先进入图片所在的目录,然后执行命令行 $ mkdir tmp.iconset ,创建一个临时目录存放不同大小的图片 3 把原图片转为不同大小的图片,并放入上面的临时目录 #全部拷贝到命令行回车执行,执行结束之后去tmp.iconset查看十张图片是否生成好 sips - z 16 16 pic . png - - out tmp . iconset / icon_16x16 . png sips - z 32 32 pic . png - - out tmp . iconset / icon_16x16@2x . png sips - z 32 32 pic . png - - out tmp . iconset / icon_32x32 . png sips - z 64 64 pic . png - - out tmp . iconset / icon_32x32@2x . png sips - z 128 128 pic . png - - out tmp . iconset / icon_128x128 . png sips - z 256 256 pic . png - - out tmp . iconset / icon_128x128@2x . png sips - z 256 256

移动端屏幕自适应布局

微笑、不失礼 提交于 2020-01-22 18:41:31
1、技术点 移动端自适应采用百分比布局比较适合。需要说明一点的是:height的百分比是以父元素的 宽度 计算的,由于移动端父元素宽度有时没有给定值(如父元素宽度为100%),此时子元素的height就为0。 因此子元素的高度值使用padding-top或者padding-bottom撑起。 同时height的高度设置为0,防止font-size或line-height等属性影响到height。 2、示例 示例为展示图片,每行展示3个图片。每列图片宽度33%,图片间距为0.5%。 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"> <meta name="author" content="Tencent-TGideas" /> <meta name="Copyright" content="Tencent" /> <title>实例-图片列表</title> <style> * { margin: 0; padding: 0; } ol, ul { list-style: none; } html,

How to convert gray scale png image to RGB from comand line using image magick

浪子不回头ぞ 提交于 2020-01-22 16:05:17
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this:

How to convert gray scale png image to RGB from comand line using image magick

被刻印的时光 ゝ 提交于 2020-01-22 16:03:27
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this:

How to convert gray scale png image to RGB from comand line using image magick

时光毁灭记忆、已成空白 提交于 2020-01-22 16:03:07
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this: