Question

Quel outil puis-je utiliser pour convertir un fichier .ICO en fichier .PNG ?

Était-ce utile?

La solution

Gratuit: @icon sushi est très bon pour travailler avec des icônes :

Caractéristiques

  • icon sushi peut convertir des fichiers image en fichiers icônes et vice versa.
  • Prise en charge des grandes icônes de Windows Vista.(convertir une grande image avec la compression PNG)
  • Prise en charge des icônes Windows XP 32 bits.
  • Prise en charge de Multiple-Icon qui contient des icônes dans un fichier.
  • Modifiez le canal Alpha et le masque de transparence.
  • Ouvrez la taille des images de 1x1 à 256x256.
  • Ouvrez les images couleur 1/4/8/24/32 bits.
  • Ouvrir:ICO/BMP/PNG/PSD/EXE/DLL/ICL, Convertir en :ICO/BMP/PNG/ICL
  • Copier vers/Coller depuis le Presse-papiers.

Autres conseils

Google a un convertisseur ico en png, je l'ai vu sur reddit l'autre jour.

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

ImageMagick peut convertir pratiquement n'importe quel format d'image largement utilisé en un autre.

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

voir http://www.imagemagick.org/script/convert.php en particulier

Il existe des bindigs ImageMagick pour les langues les plus populaires.

Je l'ai fait de cette façon en C#, ça fait bien le travail

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

Note:C'était gratuit lorsque cette question a été posée, mais apparemment, c'est une application payante maintenant.@Sean Kearon devrait changer la "bonne réponse" maintenant.

Vous pouvez utiliser IcoFX ($59)

Il s'agit d'une solution tout-en-un pour la création d'icônes, l'extraction et l'édition.Il est conçu pour fonctionner avec les icônes Windows XP, Windows Vista et Macintosh prenant en charge la transparence.

ConvertICO.com a toujours bien fonctionné pour moi.

Je ne sais pas où je serais sans IrFanView.Fantastique pour la conversion par lots d'images, y compris ico en png.

Dans le terminal sur mac :

convert favicon.ico favicon.png

Au cas où quelqu'un voudrait se convertir avec Bibliothèque d'imagerie Python (PIL) en mémoire à partir d'un fichier ou d'une 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

Une option rapide consiste à télécharger Paint.net et installez le Plugin Icône/Curseur.Vous pouvez ensuite ouvrir les fichiers .ico avec Paint.net, les modifier et les enregistrer au format .png ou dans un autre format.

Pour le traitement par lots, j'appuie les suggestions d'ImageMagick ou IrFanView.

http://converticon.com/ est également candidat.

Vérifier http://iconverticons.com/ - iConvert vous permet de convertir facilement des icônes Windows en icônes Mac OS X, des icônes SVG en icônes Windows, des icônes PNG en icônes Mac OS X, des images JPG en icônes Windows et bien plus encore.

Voici un code C# pour le faire, basé en grande partie sur la réponse de "Peter" sur ce fil.(Si vous trouvez cette réponse utile, veuillez voter pour la réponse 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 est un excellent utilitaire graphique pour Windows/Mac/Linux (gratuit) (page de téléchargement) qui vous permettra de parcourir les images, de convertir par lots, de transformer, de redimensionner, de faire pivoter, de prendre des captures d'écran, etc.

Cela peut faire votre XYZ à ICO conversion où XYZ est presque n'importe quel format sous le soleil.

texte alternatif http://img443.imageshack.us/img443/672/convert.gif

http://www.gimp.org/

moyen gratuit et puissant de faire fonctionner des fichiers .ico de grande résolution 1024x1024 ou supérieur avec Win7 au moins, j'ai testé cela :)

enregistrez simplement et tapez .ico

:)

la transparence est simple, chargez une nouvelle image et sélectionnez les options avancées, couleur d'arrière-plan->transparence

La version de Paint fournie avec Windows 7 convertira les icônes en PNG, JPEG, ect...maintenant.

Je viens de rencontrer ce problème.Pour information, ouvrez le .ico dans Paint et enregistrez-le au format .png.A fonctionné pour moi !

http://convertico.org/ permet aux utilisateurs de convertir plusieurs fichiers ico en fichiers PNG, GIF ou JPG en une seule étape.

C'est probablement une réponse plutôt idiote, mais si vous n'avez besoin que d'une seule icône, vous pouvez simplement prendre une capture d'écran de l'icône dans le dossier et supprimer la partie souhaitée.Assurez-vous que l'icône affiche la taille souhaitée et qu'elle a bien sûr un fond blanc.

Si vous utilisez une application de capture d'écran décente comme SnagIt ou WinSnap, un instantané de région devrait s'en occuper en quelques secondes.

Notez que cela ne vous donnera pas de transparence.

Si vous ne recherchez pas quelque chose de programmatique, cliquez simplement sur "Imprimer l'écran" et recadrez.

Il existe un outil de conversion en ligne disponible sur http://www.html-kit.com/favicon/.En plus de générer le .ico cela vous donnera également une animation .gif version.

Icône Convertir est un autre outil en ligne avec option de redimensionnement.

Une autre alternative serait IrfanVoir

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top