Git Product home page Git Product logo

gh-image-transformer's Introduction

gh-image-transformer

This CLI does not only transform images into TextMesh Pro Rich-Text tags for Grey Hack but also creates animation frames out of GIFs which are usable in Grey Hack.

Install

npm install -g gh-image-transformer

Usage

Image transformer

Usage: gh-image-transformer [options] <filepath> [width] [height]

Transform images to TextMesh Rich-Tags output for Grey Hack.

Arguments:
  filepath                                  image to transform
  width                                     output width of image
  height                                    output height of image

Options:
  -V, --version                             output the version number
  -o, --output-directory <outputDirectory>  output directory
  -s, --scale <number>                      scale of output
  -wa, --without-alpha                      ignore alpha channel
  -h, --help                                display help for command

Animation transformer

Usage: gh-animation-transformer [options] <filepath> [width] [height]

Transform GIFs to TextMesh Rich-Tags output animation frames for Grey Hack.

Arguments:
  filepath                                  image to transform
  width                                     output width of image
  height                                    output height of image

Options:
  -V, --version                             output the version number
  -o, --output-directory <outputDirectory>  output directory
  -s, --scale <number>                      scale of output
  -wa, --without-alpha                      ignore alpha channel
  -d, --delay <number>                      delay between frames
  -h, --help                                display help for command

How to

Static Image

Static images can be simply transformed into TextMesh Pro Rich-Text tags by using:

gh-image-transformer path/to/image.png

Optionally you can also select the width and height. By default, it will resize the image by a width of 64px. If you want to resize the image by height just place a -1 at the spot of the width.

Keep in mind that the images should be kept below 100px since Grey Hack has a limit of 160000 characters for each print line. Anything above that may cause the image to be displayed incorrectly.

Via the additional options, you can also change the scale of each pixel by default that value is 2. It is not recommended to go lower since that will cause vertical space between lines.

GIF

GIFs can be transformed into TextMesh Pro Rich-Text tags animation frames by using:

gh-animation-transformer path/to/image.gif

The options of the animation transformer are the same as the ones from the normal image transformer. There is only one additional option which is about the delay between each frame.

Note: It is highly recommended to use either greybel-js or greybel-vs to import animations otherwise you end up with a lot of copy paste depending on how many frames the GIF got.

In case you are using greybel-js you just need to execute greybel path/to/image.src. It is recommended to use the --create-ingame flag to avoid copy-pasting all the files.

If you are using greybel-vs you just need to right click on the image.src and select build. To make it more convenient please make sure to activate the create-ingame option.

Example output

Example output

Example animation output

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.