Coder Social home page Coder Social logo

psd-converter's Introduction

@ice-fruits/psd-converter

npm version

A simple utils for create psd on web

Useage

import Converter, { saveAs } from '@ice-fruits/psd-converter';

const schema = {
  width: 800,
  height: 1200,
  children: [
    {
      type: 'image',
      name: 'layer1',
      x: 30,
      y: 30,
      src: 'https://img.alicdn.com/imgextra/i2/471500007/O1CN017jboDr1BvFacfFmg1_!!0-saturn_solar.jpg_468x468q75.jpg',
    },
    {
      type: 'text',
      name: 'text1',
      x: 500,
      y: 30,
      text: 'Cool Girl!',
      fontSize: 40,
      fillColor: '#ff0000',
    },
    {
      type: 'image',
      name: 'layer2',
      x: 30,
      y: 510,
      src: 'https://img.alicdn.com/imgextra/i1/45086719/O1CN01tHGG2Y1zVLsDaFgo3_!!0-saturn_solar.jpg_468x468q75.jpg',
    },
    {
      type: 'text',
      name: 'text2',
      x: 500,
      y: 510,
      text: 'Fusion',
      fontSize: 40,
      fillColor: '#ff0000',
    },
  ],
};

const converter = new Converter();
const buffer = await converter.schema2Psd(schema);
saveAs(buffer, 'demo.psd');

Demo

Create PSD Sample

(You can change the @1.0.3 in demo url to any version which you want)

psd-converter's People

Watchers

Bruce Lee avatar

psd-converter's Issues

Can I Create folders?

I think that creating folder with schema is unexpectable.
And also, extracted schema is not applicable for schema2Psd.
Is this updatable?

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.