Pregunta

¿Qué herramienta puedo utilizar para convertir un archivo .ICO a un archivo .PNG?

¿Fue útil?

Solución

Gratis: @sushi icono es muy bueno para trabajar con iconos:

Características

  • icon sushi puede convertir archivos de imagen en archivos de iconos y viceversa.
  • Soporte para iconos grandes de Windows Vista.(convertir imagen grande con compresión PNG)
  • Soporte para iconos de Windows XP de 32 bits.
  • Soporte para íconos múltiples que contiene algunos íconos en un archivo.
  • Edite el canal Alfa y la Máscara de transparencia.
  • Abra imágenes de tamaño 1x1 a 256x256.
  • Abra imágenes en color de 1/4/8/24/32 bits.
  • Abierto:ICO/BMP/PNG/PSD/EXE/DLL/ICL, Convertir en:ICO/BMP/PNG/ICL
  • Copiar a/Pegar desde el Portapapeles.

Otros consejos

Google tiene un conversor de ico a png, lo vi en reddit el otro día.

http://www.google.com/s2/favicons?domain=stackoverflow.com

ImageMagick puede convertir prácticamente cualquier formato de imagen ampliamente utilizado a otro.

http://www.imagemagick.org/script/index.php

ver http://www.imagemagick.org/script/convert.php En particular

Hay enlaces ImageMagick para los idiomas más populares.

Lo hice de esta manera en C# y funciona muy bien.

#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's 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);
                }
            }
        }
    }
}
}

Nota:Esto fue gratis cuando se hizo esta pregunta, pero aparentemente es una aplicación pagada ahora.@Sean Kearon debería cambiar la "respuesta correcta" ahora.

Puedes usar IcoFX ($59)

Es una solución todo en uno para la creación de iconos, extracción y edición.Está diseñado para funcionar con Windows XP, Windows Vista y Macintosh iconos que admiten la transparencia.

ConvertICO.com siempre me ha funcionado bien.

No sé donde estaría sin IrFanVer.Fantástico para convertir imágenes por lotes, incluido ico a png.

En la terminal de mac:

convert favicon.ico favicon.png

En caso de que alguien quiera convertir con Biblioteca de imágenes de Python (PIL) en la memoria desde un archivo o 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

Una opción rápida es descargar pintura.net e instalar el Complemento de icono/cursor.Luego puede abrir archivos .ico con Paint.net, editarlos y guardarlos en .png u otro formato.

Para el procesamiento por lotes, apoyo las sugerencias de ImageMagick o IrFanVer.

http://converticon.com/ También es candidato.

Verificar http://iconverticons.com/ - iConvert le permite convertir fácilmente Windows ico a iconos de Mac OS X, SVG a iconos de Windows, PNG ico a Mac OS X ico, imágenes JPG a iconos de Windows y mucho más.

Aquí hay un código C# para hacerlo, basado en gran medida en la respuesta de este hilo de "Peter".(Si encuentra útil esta respuesta, vote a favor de la respuesta de 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);
     }
  }

XnView es una excelente utilidad de gráficos para Windows/Mac/Linux (gratis) (pagina de descarga) que le permitirá explorar imágenes, convertir por lotes, transformar, cambiar el tamaño, rotar, tomar capturas de pantalla, etc.

Puede hacer tu XYZ a ICO conversión donde XYZ es casi cualquier formato bajo el sol.

texto alternativo http://img443.imageshack.us/img443/672/convert.gif

http://www.gimp.org/

forma gratuita y potente de hacer que archivos .ico de gran resolución 1024x1024 o superior funcionen al menos con win7, lo he probado :)

simplemente guarda y escribe .ico

:)

la transparencia es fácil, cargue una nueva imagen y seleccione opciones avanzadas, color de fondo->transparencia

La versión de Paint que viene con Windows 7 convertirá iconos a PNG, JPEG, etc.ahora.

Me acabo de encontrar con este problema.Para su información, abra el .ico en Paint y guárdelo como .png.¡Trabajó para mi!

http://convertico.org/ permite a los usuarios convertir múltiples archivos ico a archivos PNG, GIF o JPG en un solo paso.

Probablemente esta sea una respuesta bastante tonta, pero si solo necesita un ícono, puede simplemente tomar una captura de pantalla del ícono en la carpeta y recortar la parte que desee.Asegúrate de que el ícono muestre el tamaño que deseas y tenga un fondo blanco, por supuesto.

Si está utilizando una aplicación de captura de pantalla decente como SnagIt o WinSnap, una captura de región debería solucionarlo en unos segundos.

Tenga en cuenta que esto no le dará transparencia.

Si no está buscando algo programático, simplemente "Imprimir pantalla" y recortar.

Hay una herramienta de conversión en línea disponible en http://www.html-kit.com/favicon/.Además de generar la .ico También te dará una imagen animada. .gif versión.

Icono Convertir es otra herramienta en línea con opción de cambio de tamaño.

Otra alternativa sería IrfanVer

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top