LaifuGIFG
A script designed for the purpose of creating/adjusting GIFs from series of images/existing GIFs for the bot, LaifuBot, on Discord.
Prerequisites
Features
- Generate a GIF from a series of images
- Generate a new GIF from an existing GIF
- Generate multiple GIFs from a series of existing GIFs at once
- Customizability with options such as applying color changes, adjusting fps, and modifying encoding quality of generated GIFs
Usage
- Have a copy of this repository on your local computer.
- Download a copy of this repository or clone the repository using git:
git clone https://github.com/minidomo/LaifuGIFG.git
- Download a copy of this repository or clone the repository using git:
- Install dependencies
- In the command line, enter into this directory and type the following command to install dependencies:
npm install
- In the command line, enter into this directory and type the following command to install dependencies:
- Adjust config.json
- An example is provided, config.json.example, create a copy or remove the .example extension to have a config.json file.
- Read the provided example file to understand the availability of options to configure the generation of GIFs.
Make sure to remove any comments existing in your config.json if referencing config.json.example
- Generate the GIF(s)
- After configuring config.json, type the following command to run the script to generate the GIF(s) in a generated folder,
out
:npm run start
- After configuring config.json, type the following command to run the script to generate the GIF(s) in a generated folder,
- Empty the
out
directory- Run the following script to empty the
out
directory and put contents into the recycling bin:npm run clean
- Run the following script to empty the
Stages
To utilize config.json effectively, it is important to understand the stages of the script and the order in which they occur. When generating GIFs, the script enters the following stages in the given order for each GIF:
- Base
- Produces copies of the frames from series of images or an existing GIF in
out/temp*/base
.
- Produces copies of the frames from series of images or an existing GIF in
- Resize
- Resizes frames located in
out/temp*/base
and outputs frames toout/temp*/resize
. - Optional. Enters this stage if
resizePrior
istrue
in config.json.
- Resizes frames located in
- Color
- Applies color changes to frames from the previous stage and outputs frames to
out/temp*/color
. - Optional. Enters this stage if
jimpColorManipulation
is a non-empty array.
- Applies color changes to frames from the previous stage and outputs frames to
- Border
- Applies a temporary border to frames from the previous stage and outputs frames to
out/temp*/border
.
- Applies a temporary border to frames from the previous stage and outputs frames to
- First GIF Generation
- Generates the first GIF using frames located in
out/temp*/border
and outputs it toout/temp*/Animation.GIF
.
- Generates the first GIF using frames located in
- Final GIF Generation
- Recolors the border of the first GIF to white and outputs it to
out/Animation*.GIF
.
- Recolors the border of the first GIF to white and outputs it to