windows 将多个 PNG 制作成一个 ICO 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4808600/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:04:32  来源:igfitidea点击:

Make several PNGs into one ICO file

windowsiconsico

提问by codeulike

With Windows ICO files, you can pack several different sized images into the same ICO file - Windows then picks different sizes based on what it needs. (see herefor info about icon sizes)

使用 Windows ICO 文件,您可以将多个不同大小的图像打包到同一个 ICO 文件中 - Windows 然后根据需要选择不同的大小。(有关图标大小的信息,请参见此处

There are lots of free online tools that take a singe image and make it into an ICO file, but are there any free online tools that take severalimages and make them into one ICO file?

有很多免费的在线工具可以将单个图像制作成 ICO 文件,但是有没有免费的在线工具可以拍摄张图像并将它们制作成一个 ICO 文件?

回答by codeulike

Turns out you can also do this with Gimp, as described here:

事实证明,您也可以使用Gimp执行此操作,如下所述

  • Open the largest of the icon images in The GIMP. Right-click on the image and select File->Open as Layers... and select all the other icon images.
  • This will create a single image with a layer containing each of the other icon images.
  • Save the image as a Microsoft Windows Icon (.ico) image - File->Export (or File->Save As in older versions of GIMP), and then type in the filename, e.g. favicon.ico. (this will automatically select the .ico format)
  • 在 GIMP 中打开最大的图标图像。右键单击图像并选择 File->Open as Layers... 并选择所有其他图标图像。
  • 这将创建一个包含每个其他图标图像的图层的单个图像。
  • 将图像另存为 Microsoft Windows 图标 (.ico) 图像 - 文件->导出(或在旧版本的 GIMP 中为文件->另存为),然后输入文件名,例如 favicon.ico。(这将自动选择 .ico 格式)

回答by c33s

ICOBundle - Free Program from Telegraphics http://www.telegraphics.com.au/sw/product/ICOBundle

ICOBundle - Telegraphics 的免费程序 http://www.telegraphics.com.au/sw/product/ICOBundle

you first create icon files in the required sizes and then combine it with ICOBundle. For the creation of the icon files i use the photoshop plugin http://www.telegraphics.com.au/sw/product/ICOFormat

您首先创建所需大小的图标文件,然后将其与 ICOBundle 结合。为了创建图标文件,我使用 photoshop 插件http://www.telegraphics.com.au/sw/product/ICOFormat

it is a command line utility but the usage is quite simple

它是一个命令行实用程序,但用法非常简单

icobundl.exe -o favicon.ico favicon16x16.ico favicon32x32.ico

回答by Mital Vora

For creating ico file out of multiple png files one of the best tool is png2ico

要从多个 png 文件中创建 ico 文件,最好的工具之一是 png2ico

Following are different ways to download and install png2ico

以下是不同的下载和安装方式 png2ico

Installing from Source

从源安装

download latest png2ico source from hereand run following commands:

这里下载最新的 png2ico 源代码并运行以下命令:

tar xzvf png2ico-src-2002-12-08.tar.gz cd ./png2ico-src-2002-12-08 ./configure make sudo make install

tar xzvf png2ico-src-2002-12-08.tar.gz cd ./png2ico-src-2002-12-08 ./configure make sudo make install

OSX

操作系统

OSX users have the png2ico package directly available trough port. you need to run following command

OSX 用户可以通过 png2ico 包直接使用port。你需要运行以下命令

sudo port install png2ico

sudo port install png2ico

Command

命令

After installing png2icoyou can run following command to generate required ico file

安装后,png2ico您可以运行以下命令来生成所需的 ico 文件

png2ico myicon.ico icon_16x16.png icon_32x32.png icon_64x64.png icon_128x128.png

png2ico myicon.ico icon_16x16.png icon_32x32.png icon_64x64.png icon_128x128.png

  • Note that the ico file has limitation that the maximum size supported is height < 256 pixels and width < 256 pixels.
  • 请注意,ico 文件有限制,即支持的最大尺寸为高度 < 256 像素和宽度 < 256 像素。