Skip to content
/ psd.js Public
forked from meltingice/psd.js

A Photoshop PSD file parser for NodeJS and browsers

License

Notifications You must be signed in to change notification settings

apiton/psd.js

This branch is 126 commits behind meltingice/psd.js:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b6bae2e · Sep 11, 2014

History

89 Commits
Jul 21, 2014
Aug 19, 2014
Aug 19, 2014
Jul 21, 2014
Jul 21, 2014
Apr 12, 2014
May 15, 2014
Jul 24, 2014
Jul 21, 2014
Sep 11, 2014
Jul 24, 2014
Apr 12, 2014
Aug 8, 2014

Repository files navigation

PSD.js

Build Status

A general purpose PSD parser written in Coffeescript. Based off of PSD.rb.

Runs in both NodeJS and the browser (using browserify). There are still some pieces missing that are present in PSD.rb, such as layer comp filtering, layer image exporting, a built-in renderer, and many layer info blocks. The eventual goal is full feature parity with PSD.rb.

Installation

PSD.js has no native dependencies. Simply add psd to your package.json or run npm install psd.

Basic Usage

PSD.js works almost exactly the same in the browser and NodeJS.

NodeJS

var PSD = require('psd');
var psd = PSD.fromFile("path/to/file.psd");
psd.parse();

console.log(psd.tree().export());
console.log(psd.tree().childrenAtPath('A/B/C')[0].export());

// You can also use promises syntax for opening and parsing
PSD.open("path/to/file.psd").then(function (psd) {
  return psd.image.saveAsPng('./output.png');
}).then(function () {
  console.log("Finished!");
});

Browser

var PSD = require('psd');

// Load from URL
PSD.fromURL("/path/to/file.psd").then(function(psd) {
  document.getElementById('ImageContainer').appendChild(psd.image.toPng());
});

// Load from event, e.g. drag & drop
function onDrop(evt) {
  PSD.fromEvent(evt).then(function (psd) {
    console.log(psd.tree().export());
  }); 
}

About

A Photoshop PSD file parser for NodeJS and browsers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published