├── .gitignore
├── LICENSE
├── README.md
├── img
├── download.gif
├── gurukirahitode909.gif
├── hitode909.png
├── kiramedetai.gif
└── medetai.png
├── index.js
├── main.js
├── package.json
└── phaseImageEffecter.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18 | .grunt
19 |
20 | # node-waf configuration
21 | .lock-wscript
22 |
23 | # Compiled binary addons (http://nodejs.org/api/addons.html)
24 | build/Release
25 |
26 | # Dependency directory
27 | node_modules
28 |
29 | # Optional npm cache directory
30 | .npm
31 |
32 | # Optional REPL history
33 | .node_repl_history
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Udon Suzuki
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # kirakiraemoji
2 |
3 | This program is a Kirakira Animated GIF generaor. It is dependent on the ImageMagick.
4 |
5 | ## Usage
6 |
7 | First download and install ImageMagick. In Mac OS X, you can simply use Homebrew or MacPorts. Then clone this repo:
8 |
9 | ```
10 | $ git clone https://github.com/udonchan/kirakiraemoji.git
11 |
12 | ```
13 |
14 | Enabling the command is run the following in repo directry:
15 |
16 |
17 | ```
18 | $ npm install
19 | $ npm link
20 | ```
21 |
22 | ## Example
23 |
24 | Basic usage is following:
25 |
26 | ```
27 | % kirakiraemoji -i medetai.png -s 150 -o kiramedetai.gif
28 | ```
29 |
30 | | input file | output file |
31 | |:-:|:-:|
32 | |  |  |
33 |
34 | In case of using "--guruguru" option, to enable rotation effect.
35 |
36 | ```
37 | % kirakiraemoji -r 128 --colors 32 --guruguru --delay 8 --framenum 16 -i hitode909.png -o guruhitode909.gif
38 | ```
39 |
40 | | input file | output file |
41 | |:-:|:-:|
42 | |  |  |
43 |
44 | You can use '--label' option. It will assign or generate a label to an image. If you want to use a multi-byte character, you need use "--font" option to enable specify the font.
45 |
46 | ```
47 | # to download japanese fonts
48 | % curl -C- "http://fonts.gstatic.com/ea/notosansjapanese/v6/download.zip" -o noto.zip
49 | % unzip noto.zip
50 | Archive: noto.zip
51 | inflating: NotoSansJP-Black.otf
52 | inflating: NotoSansJP-Bold.otf
53 | inflating: NotoSansJP-DemiLight.otf
54 | inflating: NotoSansJP-Light.otf
55 | inflating: NotoSansJP-Medium.otf
56 | inflating: NotoSansJP-Regular.otf
57 | inflating: NotoSansJP-Thin.otf
58 | % kirakiraemoji --font ./NotoSansJP-Black.otf --label "ダウンロー\nド" -o download.gif
59 | ```
60 | | output file |
61 | |:-:|
62 | |  |
63 |
--------------------------------------------------------------------------------
/img/download.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udonchan/kirakiraemoji/18f56fd4795ed5395f359af9116434c43d804c04/img/download.gif
--------------------------------------------------------------------------------
/img/gurukirahitode909.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udonchan/kirakiraemoji/18f56fd4795ed5395f359af9116434c43d804c04/img/gurukirahitode909.gif
--------------------------------------------------------------------------------
/img/hitode909.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udonchan/kirakiraemoji/18f56fd4795ed5395f359af9116434c43d804c04/img/hitode909.png
--------------------------------------------------------------------------------
/img/kiramedetai.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udonchan/kirakiraemoji/18f56fd4795ed5395f359af9116434c43d804c04/img/kiramedetai.gif
--------------------------------------------------------------------------------
/img/medetai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udonchan/kirakiraemoji/18f56fd4795ed5395f359af9116434c43d804c04/img/medetai.png
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | require('./main')();
3 |
4 |
5 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const DEFAULT_DELAY_TIME = 5;
4 | const DEFAULT_FRAME_NUM = 10
5 |
6 | const TEMP_DIRECTRY_PREFIX = 'kirakira';
7 | const temp = require('temp').track();
8 | const fs = require('fs');
9 | const util = require('util');
10 | const path = require('path');
11 | const im = require('imagemagick');
12 | const returnTrue = function(){return true};
13 | const phaseImageEffecter = require('./phaseImageEffecter');
14 |
15 | let program = require('commander');
16 | program.version('0.0.1');
17 | program.usage('-i [options]');
18 | program.option('-i, --input ', 'input file');
19 | program.option('-l --label ', 'label string');
20 | program.option('-o, --output ', 'output path');
21 | program.option('-s, --saturation ', 'saturation value');
22 | program.option('-p, --plain', 'Do NOT Kirakira effect', returnTrue, 0);
23 | program.option('-r --resize ', 'resize the image');
24 | program.option('--colors ', 'preferred number of colors in the image', parseInt);
25 | program.option('--delay