/**
 * @function lib.image.png2ico
 * @param {string} src - PNG source file.
 * @param {string} dest - ICO source file.
 * @author Taka Okunishi
 *
 */

var fs = require('fs'),
    path = require('path');

module.exports = function (src, dest, callback) {
    var imagemagick = require('imagemagick');
    imagemagick.convert([
        src,
        '-bordercolor', 'white',
        '-clone', '0',
        '-border', '0',
        '-delete', '0',
        '-alpha', 'off',
        '-colors', '256',
        dest
    ], function (err, stdOut, stdErr) {
        callback(err || stdErr || null);
    });
};