Skip to content

crafzic/crafzic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crafzic Image render

image render for the node js environment built with skia-canvas

Example

import {
  Config,
  DefaultRenderer,
  POSITION,
  Text,
} from "@crafzic/crafzic-image";
const config = new Config({
  height: 720,
  width: 1280,
  backgroundColor: "#fff",
});
const text = new Text(config)
  .setFontSize(80)
  .setText("Hello World!")
  .setColor("#ff0000");
renderer.addText(text);
rainbox
import {
  Config,
  DefaultRenderer,
  POSITION,
  Text,
} from "@crafzic/crafzic-image";

async function main() {
  const config = new Config({
    height: 720,
    width: 1280,
    backgroundColor: "#fff00",
  });
  const renderer = new DefaultRenderer(config).setColor("#000");
  const text = new Text(config)
    .setFontSize(80)
    .setText("Hello World!")
    .setColor("#ff0000");
  const text2 = new Text(config)
    .setFontSize(40)
    .setText("Random")
    .setColor("#ff3002")
    .setPosition({
      position: POSITION.TOP_LEFT,
    });
  const text3 = new Text(config)
    .setFontSize(40)
    .setText("Text")
    .setColor("#ff3002")
    .setPosition({
      position: POSITION.TOP_RIGHT,
    });
  const text4 = new Text(config)
    .setFontSize(40)
    .setText("IS")
    .setColor("#ff3002")
    .setPosition({
      position: POSITION.BOTTOM_LEFT,
    });
  const text5 = new Text(config)
    .setFontSize(40)
    .setText("Everywhere !")
    .setColor("#ff3002")
    .setPosition({
      position: POSITION.BOTTOM_RIGHT,
    });

  renderer
    .addText(text)
    .addText(text2)
    .addText(text3)
    .addText(text5)
    .addText(text4);
  await renderer.render();
}

main();

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published