Giter Site home page Giter Site logo

gka's Introduction

gka

简单的、高效的帧动画生成工具


gka 是一款简单的、高效的帧动画生成工具。

通过对图片集进行处理,一键式生成序列帧动画文件,并内置相关优化。

  • 一键式 : 图片文件批量序列化重命名,生成 css keyframes,生成帧动画预览文件
  • 性能佳 : 支持图片压缩✓,支持合图模式✓,相同帧图片复用

preview

Install

$ sudo npm install -g gka

Usage

gka <options> <files>

-d, --dir <string>            -d  图片文件夹地址
-p, --prefix <string>         -p  重命名前缀
-f, --frameduration <number>  -f  每帧时长 默认为 0.04
-i, --info <boolean>          -i  是否输出信息文件 默认 false

-s, --sprites <boolean>       -s  是否开启合图模式 默认 false
-a, --algorithm <string>      -a  合图布局模式 默认 binary-tree

-t, --tiny <string>           -t 图片文件夹地址 压缩图片
# 帧动画生成 - 普通模式

$ gka -d [imageDirPath] -p [prefix] 
# 帧动画生成 - 合图模式

$ gka -d [imageDirPath] -p [prefix] -s true
# 压缩图片

$ gka -t [imageDirPath]

Examples

生成帧动画 · 普通模式

1.示例参数:

  • 图片目录:E:\gka-test\img
  • 图片名前缀:prefix-

2.命令

# gka -d [imageDirPath] -p [prefix] 

$ gka -d E:\gka-test\img -p prefix-

3.结果:

BeforeAfter

./img
├── 害羞_00000.png
├── 害羞_00001.png
├── 害羞_00002.png
├── 害羞_00003.png
├── 害羞_00004.png
└── ...

./img-gka
└── gka.html
└── prefix-gka.css
└── img
    ├── prefix-1.png
    ├── prefix-2.png
    ├── prefix-3.png
    ├── prefix-4.png
    └── ...

生成帧动画 · 合图模式

1.示例参数:

  • 图片目录:E:\gka-test\img
  • 图片名前缀:prefix-

2.命令

# gka -d [imageDirPath] -p [prefix] -s true

$ gka -d E:\gka-test\img -p prefix- -s true

3.结果:

BeforeAfter

./img
├── 害羞_00000.png
├── 害羞_00001.png
├── 害羞_00002.png
├── 害羞_00003.png
├── 害羞_00004.png
└── ...
 
./img-gka-sprites
└── img
    └── prefix-sprites.png
└── gka.html
└── prefix-gka.css

图片压缩

1.示例参数:

  • 图片目录:E:\gka-test\img

2.命令

# gka -t [imageDirPath]

$ gka -t E:\gka-test\img

Welcome

  • 欢迎 Pull requests、Issues 一般在24小时内处理
  • 讨论与咨询请+QQ 3201590286 :D

License

MIT

Copyright (c) 2017 - present, joeyguo

Log

  • v1.0.x 重命名图片文件、 生成 keyframe animation css 动画、自动化合图、自动化图片压缩、效果预览
  • v1.1.0 相同帧图片复用
  • v1.4.5 支持输出信息文件、合图布局参数
  • v1.4.6 增加图片预加载

gka's People

Contributors

joeygoo avatar joeyguo avatar

Watchers

 avatar  avatar

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.