简体   繁体   English

使用Graphicsmagick生成Windows ICO文件的配方

[英]Recipe to generate Windows ICO files with Graphicsmagick

Based on this question for imagemagick, what is the equivalent for graphicsmagick? 基于imagemagick的这个问题,graphicsmagick的等价物是什么? Recipe for creating Windows ICO files with ImageMagick? 使用ImageMagick创建Windows ICO文件的配方?

Also I just want to generate a fully transparent ico file with multiple sizes. 另外,我只想生成一个具有多种尺寸的完全透明的ico文件。 I found that there's an xc:none option that works for both, but is there one single command that generates ico files with multiple sizes that is transparent? 我发现有一个xc:none选项适用于两者,但是有一个命令可以生成多个大小透明的ico文件吗? Otherwise I would have to first create a transparent png file, then create ico files from the png file. 否则我将首先创建一个透明的png文件,然后从png文件创建ico文件。

AFAIK, GraphicsMagick doesn't support writing ICO format files - see here . AFAIK, GraphicsMagick不支持编写ICO格式文件 - 请参阅此处

Just in case anyone knows more about this mad Microsoft format and if it is maybe some sort of multi-page TIF or GIF in disguise that just needs to be renamed, the following would be one way of making a recipe in GraphicsMagick: 万一有人知道更多关于这种疯狂的微软格式,如果它可能是一种伪装的多页TIF或GIF,只需要重命名,以下是在GraphicsMagick中制作配方的一种方法:

#!/bin/bash
{ echo convert image.png mpr:initial; 
  echo convert mpr:initial -resize 16x16 mpr:16;
  echo convert mpr:initial -resize 32x32 mpr:32;
  echo convert mpr:initial -resize 48x48 mpr:48;
  echo convert mpr:initial -resize 64x64 mpr:64;
  echo convert mpr:16 mpr:32 mpr:48 mpr:64 -colors 256 favicon.tif; } | gm batch -prompt off

For the moment, I have created a multi-page TIF as the output file and it contains the four sizes you need - but as I said, GraphicsMagick will not write a ICO file. 目前,我创建了一个多页TIF作为输出文件,它包含您需要的四种尺寸 - 但正如我所说, GraphicsMagick不会写一个ICO文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM