Giter Site home page Giter Site logo

png2icns's Introduction

npm version License

png2icns

A command line and nodejs module to convert a .png file to an .icns file. Works on Mac only.

It expects a 1024*1024 png file to convert. If your files is less in size then skip the maximum size in options.

For example, if your file is 512*512:

Command line:

$ png2icns file.png -s 16,32,64,128,256

In JavaScript:

png2icns({
  in: 'file.png',
  sizes: [16, 32, 64, 128, 256]
}, function () {
  console.log('Successfully converted.');
});

Installation

For command line usage:

npm install png2icns -g

To use programmatically (in NodeJS).

npm install png2icns --save

Usage

Command line

Simply give it path of png file you want to convert.

$ png2icns file_to_convert.png
$ png2icns file.png
$ png2icns file.png -o file.icns // file to output as
$ png2icns file.png -o file.icns -s 16,32,64,128,256,512 // sizes you want in your .icns file

JavaScript

var png2icns = require('png2icns');

png2icns({
  in: 'file.png', // required
  out: 'output.icns' // optional. .icns file name to save the file as. Default: icon.icns
  sizes: [16, 32, 64, 128, 256, 512] // optional.
}, function () {
  console.log('Successfully converted.');
});

png2icns's People

Contributors

moinism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

png2icns's Issues

Doesn't work

When globally installed, it tries to create a temp iconset directory in /usr... and fails because doesn't have acccess

Also it needs sips as a dependency which is missing from project file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.