Подтвердить что ты не робот

Как конвертировать .ICO в .PNG?

Какой инструмент я могу использовать для преобразования .ICO файла в файл .PNG?

4b9b3361

Ответ 1

Бесплатно: @icon sushi отлично подходит для работы с иконками:

Характеристики

  • Иконка суши может конвертировать файлы изображений в файлы иконок и наоборот.
  • Поддержка Windows Vista больших иконок. (конвертировать большое изображение в формате PNG)
  • Поддержка Windows XP 32-битных иконок.
  • Поддержка Multiple-Icon, которая содержит несколько значков в файле.
  • Отредактируйте альфа-канал и маску прозрачности.
  • Откройте изображения размером от 1x1 до 256x256.
  • Откройте 1/4/8/24/32bit цветных изображений.
  • Открыть: ICO/BMP/PNG/PSD/EXE/DLL/ICL, конвертировать в: ICO/BMP/PNG/ICL
  • Копировать в/Вставить из буфера обмена.

Ответ 4

Я сделал это так, чтобы С# выполнял работу красиво

#region Usings

using System;
using System.IO;
using System.Linq;
// Next namespace requires a reference to PresentationCore
using System.Windows.Media.Imaging;

#endregion

namespace Imagetool
{
internal class Program
{
    private static void Main(string[] args)
    {
        new Ico2Png().Run(@"C:\Icons\",
                          @"C:\Icons\out\");
    }
}

public class Ico2Png
{
    public void Run(string inPath, string outPath)
    {
        if (!Directory.Exists(inPath))
        {
            throw new Exception("In Path does not exist");
        }

        if (!Directory.Exists(outPath))
        {
            Directory.CreateDirectory(outPath);
        }


        var files = Directory.GetFiles(inPath, "*.ico");
        foreach (var filepath in files.Take(10))
        {
            Stream iconStream = new FileStream(filepath, FileMode.Open);
            var decoder = new IconBitmapDecoder(
                iconStream,
                BitmapCreateOptions.PreservePixelFormat,
                BitmapCacheOption.None);

            var fileName = Path.GetFileName(filepath);

            // loop through images inside the file
            foreach (var frame in decoder.Frames)
            {
                // save file as PNG
                BitmapEncoder encoder = new PngBitmapEncoder();
                encoder.Frames.Add(frame);
                var size = frame.PixelHeight;

                // haven't tested the next lines - include them for bitdepth
                // See RenniePet answer for details
                // var depth = frame.Thumbnail.Format.BitsPerPixel;
                // var path = outPath + fileName + size + depth +".png";

                var path = outPath + fileName + size + ".png";
                using (Stream saveStream = new FileStream(path, FileMode.Create))
                {
                    encoder.Save(saveStream);
                }
            }
        }
    }
}
}

Ответ 5

Примечание. Это было бесплатно, когда этот вопрос был задан, но, по-видимому, это сейчас. @Sean Kearon теперь должен изменить "правильный ответ".

Вы можете использовать IcoFX ($ 59)

Это решение "все-в-одном" для значка создание, извлечение и редактирование. Это предназначен для работы с Windows XP, Значки Windows Vista и Macintosh поддерживая прозрачность.

Ответ 6

ConvertICO.com всегда работал отлично для меня.

Ответ 7

Я не знаю, где бы я был без IrFanView. Фантастический для пакетного преобразования изображений, включая ico в png.

Ответ 8

В терминале на mac:

convert favicon.ico favicon.png

Ответ 9

Один быстрый вариант - загрузить Paint.net и установить Icon/Cursor plugin. Затем вы можете открывать файлы .ico с помощью Paint.net, редактировать их и сохранять их в .png или в другом формате.

Для пакетной обработки я вставляю предложения ImageMagick или IrFanView.

Ответ 10

В случае, если кто-то хочет конвертировать с Python Imaging Library (PIL) в память из файла или URL

from cStringIO import StringIO
import Image
import urllib

def to_png(path, mime="png"):
    if path.startswith("http:"):
        url = urllib.quote(url)
        input = StringIO()
        input.write(urllib.urlopen(url).read())
        input.seek(0)
    else:
        input = open(path).read()

    if input:
        out  = StringIO()
        image = Image.open(input)
        image.save(out, mime.upper())
        return out.getvalue()
    else:
        return None

Ответ 12

Отъезд http://iconverticons.com/ - iConvert позволяет вам легко конвертировать Windows ico в Mac OS X icns, значки SVG для Windows, PNG ico для Mac OS X ico, изображения JPG для значков Windows и многое другое.

Ответ 13

Вот какой код С# для этого, основываясь на ответе на эту тему на "Питер". (Если вы найдете этот ответ полезным, пожалуйста, попробуйте ответить Peter.)

  /// <summary>
  /// Method to extract all of the images in an ICO file as a set of PNG files. The extracted 
  /// images are written to the same disk folder as the input file, with extended filenames 
  /// indicating the size of the image (16x16, 32x32, etc.) and the bit depth of the original 
  /// image (typically 32, but may be 8 or 4 for some images in old ICO files, or even in new 
  /// ICO files that are intended to be usable in very old Windows systems). But note that the 
  /// PNG files themselves always have bit depth 32 - the bit depth indication only refers to 
  /// the source image that the PNG was created from. Note also that there seems to be a bug 
  /// that makes images larger than 48 x 48 and with color depth less than 32 non-functional.
  /// 
  /// This code is very much based on the answer by "Peter" on this thread: 
  /// http://stackoverflow.com/questions/37590/how-to-convert-ico-to-png
  /// 
  /// Plus information about how to get the color depth of the "frames" in the icon found here:
  /// http://social.msdn.microsoft.com/Forums/en-US/e46a9ad8-d65e-4aad-92c0-04d57d415065/a-bug-that-renders-iconbitmapdecoder-useless
  /// </summary>
  /// <param name="iconFileName">full path and filename of the ICO file</param>
  private static void ExtractImagesFromIconFile(string iconFileName)
  {
     try
     {
        using (Stream iconStream = new FileStream(iconFileName, FileMode.Open))
        {
           IconBitmapDecoder bitmapDecoder = new IconBitmapDecoder(iconStream, 
                               BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.None);

           foreach (BitmapFrame bitmapFrame in bitmapDecoder.Frames)
           {
              int iconSize = bitmapFrame.PixelHeight;
              int bitDepth = bitmapFrame.Thumbnail.Format.BitsPerPixel;
              string pngFileName = Path.GetDirectoryName(iconFileName) + 
                                   Path.DirectorySeparatorChar +
                                   Path.GetFileNameWithoutExtension(iconFileName) + "-" +
                                   iconSize + "x" + iconSize + "-" + bitDepth + ".png";
              using (Stream saveStream = new FileStream(pngFileName, FileMode.Create))
              {
                 BitmapEncoder bitmapEncoder = new PngBitmapEncoder();
                 bitmapEncoder.Frames.Add(bitmapFrame);
                 bitmapEncoder.Save(saveStream);
              }
           }
        }
     }
     catch (Exception ex)
     {
        MessageBox.Show("Unable to extract PNGs from ICO file: " + ex.Message,
                       "ExtractImagesFromIconFile", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
  }

Ответ 14

XnView - отличная графическая утилита для Windows/Mac/Linux (бесплатная) (страница загрузки), которая позволит вам просматривать изображения, конвертировать, преобразовывать, изменять размер, вращать, делать скриншоты и т.д.

Это может сделать ваше преобразование XYZ в ICO где XYZ практически любой формат под солнцем.

alt text

Ответ 15

http://www.gimp.org/

свободный и мощный способ сделать файлы с высоким разрешением .ico 1024x1024 или выше работать с win7 по крайней мере, я протестировал это:)

просто сохраните и введите .ico

:)

прозрачность проста, загружает новое изображение и выбирает дополнительные параметры, цвет фона → прозрачность

Ответ 16

Версия Paint, которая поставляется с Windows 7, будет конвертировать значки в PNG, JPEG, ect... сейчас.

Ответ 17

http://convertico.org/ позволяет пользователям конвертировать несколько файлов ico в файлы PNG, GIF или JPG за один шаг.

Ответ 18

Я просто столкнулся с этой проблемой. FYI открыть .ico в краске и сохранить как .png. Работал для меня!

Ответ 19

Это, вероятно, довольно глупый ответ, но если вам нужен только один значок, вы можете просто сделать снимок экрана в папке и вырезать нужную вам часть. Убедитесь, что значок показывает нужный размер и, конечно же, имеет белый фон.

Если вы используете приличное приложение для скриншотов, например SnagIt или WinSnap, привязка к области должна заботиться об этом в течение нескольких секунд.

Обратите внимание, что это не даст вам прозрачности.

Ответ 20

Если вы не ищете что-то программное, тогда просто "Печать экрана" и обрезка.

Ответ 21

Существует интерактивный инструмент преобразования, доступный по адресу http://www.html-kit.com/favicon/. В дополнение к генерации .ico он также даст вам анимированную версию .gif.

Ответ 22

Icon Convert - это еще один онлайн-инструмент с параметром изменения размера.

Ответ 23

Другой альтернативой будет IrfanView