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 🙏

© 2024 – Pkg Stats / Ryan Hefner

charmake

v1.0.5

Published

A simple command line utility for generating character GIFs with overlays.

Downloads

6

Readme

Character Make

A simple command line utility for generating character GIFs with overlays.

Install

Make sure you have Node (v6.2.1 or higher). You will also need the latest FFMPEG along with Graphicsmagick installed and available in your environment PATH. Then:

npm install charmake -g

Usage

Organize your character's animation sequences into the following directory structure.

root/
|
|_design/
| |
| |_design1.png
| |_design2.png
| |_...
| |_designN.png
|
|_character/
  |_sequenceA/
  | |
  | |_sequenceA0000.png
  | |_sequenceA0001.png
  | |_sequenceA0002.png
  | |_...
  | |_sequenceAXXXX.png
  |
  |_sequenceB/
  | |
  | |_sequenceB0000.png
  | |_sequenceB0001.png
  | |_sequenceB0002.png
  | |_...
  | |_sequenceBXXXX.png
  |
  |_...
  |
  |_sequenceZ/
    |
    |_sequenceZ0000.png
    |_sequenceZ0001.png
    |_sequenceZ0002.png
    |_...
    |_sequenceZXXXX.png

The are only a couple of requirements here that you need to follow:

  1. The name of your animation sequences and their directory be same and only consist of letters and underscore (e.g. sequenceA and sequenceA0003.png, or victory_dance and victory_dance0054.png).
  2. There should be a directory called design adjecent to the character directory that contains all the design files (overlay and underlay).
  3. A comma delimited CSV data file containing a list of all the animations in the character along with any croping parameters, it's design file and it's original framerate.

If the conditions are met, then all you need to do is run the following from your terminal or command line:

charmake -i path_to_my_character_dir -d path_to_csv_data_file

The above command will use FFMPEG as the GIF generation library. Animation files for your character will be created inside the charcter's directory upon success. Output directory can be changed by using --output-dir parameter. You can also get a list of all the options available by runing:

charmake --help

Parameters

Most options use sane defaults so you should be good to go without specifying anything additional besides input.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | -i, --input-character | Directory Path | Required | The path to the character directory containing all the animation directories | | -d, --df, --datafile | Data File Path | Required | Path to the CSV data file for the character | | -o, --output-dir | Output Directory Path | Input Directory | Path to the Directory in which to output the generated character files | | -w, --width | Number | Design file Width | Width of the output in pixels. Will default to the size of overlay design file if omitted. | | -h, --height | Number | Same as Width | Height of the output in pixels. If no --height is given but --width is, it's value will be used for --height as well, resulting in a square image. Otherwise, the size of overlay design file is used if omitted. | | -s, --size | String | | Output dimensions of the format x (e.g 512x512). This value will take precedence over --width and --height if given. Defaults to the size of design overlay file if --width and --height are also omitted. | | -f, --fps, --framerate | Number | 25 | Framerate to use for the output animation. Runs at 25 frames/second by default. | | --verbose | Boolean | False | Print debug logs to stdout | | --version | | | Shows version information | | --help | | | Shows detailed help about the command utility |

Data File Structure

The CSV data file needs to follow the following structure:

Column 1: animation directory name (string),
Column 2: crop start X (number),
Column 3: crop start Y (number),
Column 4: crop width (number),
Column 5: crop height (number),
Column 6: design_file (string),
Column 7: 0 for underlay OR 1 for overlay,
Column 8: framerate (number)

For example, the third line describes an animation in directory called dismissing_gesture, croping the frames starting from 0x0 and a total size of 1000x1000. It's design file is named NotInterested.png which is overlayed (1) over the frames. It's framerate is 30 frames/sec.

cheerings,0,0,1000,1000,Swag.png,1,30
cocky_head_turn,0,0,1000,1000,Whatever.png,1,30
dismissing_gesture,0,0,1000,1000,NotInterested.png,1,30
ducking,0,0,1000,1000,Ouch.png,0,30
dying,0,0,1000,1000,MissYou.png,0,30
fist_pump,0,0,1000,1000,Awesome.png,0,30
fist_pumps,0,0,1000,1000,NailedIt.png,0,30
talking,0,0,1000,1000,Thankyou.png,0,30
hanging_idle,0,0,1000,1000,HangingIn.png,1,30

License

(The MIT License)

Copyright (c) 2016 Uzair Sajid

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.