npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mizucoffee/imagemagick-darwin-static

v1.0.13-mizucoffee

Published

static library of imagemagic for darwin x64 (and arm64)

Downloads

4

Readme

imagemagick-darwin-static

imagemagick static binaries for Mac OSX x64

When you want to write text into images, you have to pass the font explicitly.

Important

you have to set the an environment variable to use it via spawn or cli.

// like you do in the bash:
export MAGICK_HOME= "path/to/node_modules/imagemagick-darwin-static/bin/osx/imagemagick/7.0.5-5/"
export DYLD_LIBRARY_PATH= "path/to/node_modules/imagemagick-darwin-static/bin/osx/imagemagick/7.0.5-5/lib/"
// with spawn, this can be done via the options parameter:
// child_process.spawn(command[, args][, options])

var convert_binary= "path/to/node_modules/imagemagick-darwin-static/bin/osx/imagemagick/7.0.5-5/bin/convert"
var MAGICK_HOME= "path/to/node_modules/imagemagick-darwin-static/bin/osx/imagemagick/7.0.5-5/"
var DYLD_LIBRARY_PATH= "path/to/node_modules/imagemagick-darwin-static/bin/osx/imagemagick/7.0.5-5/lib/"

var spawn = require("child_process").spawn;



var proc = spawn(convert_binary,
                ['/path/to/infille.jpg', '/path/to/outfile.png'],
                 {
                    MAGICK_HOME: MAGICK_HOME,
                    DYLD_LIBRARY_PATH: DYLD_LIBRARY_PATH
                  }
);

This is, because the dynamic libs are located in the lib folder inside this package. And imagemagick needs to know about this.

Motivation

Use imagemagick in electron.atom applications for mac For more information about electron atom see https://electron.atom.io/

Installation

This module is installed via npm:

$ npm install imagemagick-darwin-static

Example Usage

Returns the path of a statically linked graphicsmagick on the local filesystem.

var imagemagick = require('imagemagick-darwin-static');
console.log(imagemagick.path);

For Windows (32 and 64-bit) please use graphicsmagic-static.

Best usage is with npm module gm

const path = require('path');

const graphicsmagick = require('graphicsmagick-static');
const imagemagick = require('imagemagick-darwin-static');

const {subClass} = require('gm');
let gm;

if (os.platform() == 'win32') {
    gm = subClass({
        appPath: path.join(graphicsmagick.path, '/')
    });
} else {
    gm = subClass({
        imageMagick: true,
        appPath: path.join(imagemagick.path, '/')
    });
}

// then do any stuff you need

gm("/path/to/image.png").resize(150,150).write("/new/path.jpg", (err) => {
    
    // here an example
    if (err) return callback(err, null);
});

Electron and Asar

Thinks to keep in mind when packing electron apps with ASAR. Using e.g. the electron-builder, this package and as well graphicsmagick-static should be placed in the app.asar.unpacked folder. Electron builder does this automatically, because of the big binaries.

How ever, when done so, you will have to replace the path of the app.asar to app.asar.unpacked.

This could be achieved by a helper class as given:

import path from 'path';

export default class AppPaths {
    static replaceAsar(path = "") {
        return path.replace(".asar", ".asar.unpacked");
    }
}

...

// Usage:

import AppPaths from 'WhatYouCalledTheFile';
var imagemagickPath = require("imagemagick-darwin-static").path;
let fixedPath = AppPaths.replaceAsar(imagemagickPath);

// Example for using ASAR:

var os = require("os");
var graphicsmagick = require("graphicsmagick-static");
var imagemagick = require("imagemagick-darwin-static");
var imageHandler = null;

if (os.platform() == "win32") {
    gm = require("gm").subClass({
        appPath: AppPaths.replaceAsar(path.join(graphicsmagick.path, "/"))
    })
} else {

    gm = require("gm").subClass({
        imageMagick: true,
        appPath: AppPaths.replaceAsar(path.join(imagemagick.path, "/"))
    })
}

// then do any stuff you need

gm("/path/to/image.png").resize(150,150).write("/new/path.jpg", (err) => {
    
    // here an example
    if (err) return callback(err, null);
});