GithubHelp home page GithubHelp logo

llansky3 / print-a-gif Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stupotmcdoodlepip/print-a-gif

1.0 0.0 1.0 5.85 MB

Turn any gif into a printable flip book

License: GNU General Public License v3.0

Shell 100.00%

print-a-gif's Introduction

Print-A-Gif

Turn any GIF into a printable flip book via bash script!

This is is a Linux bash script re-write of the original Print-A-Gif by stupotmcdoodlepip. But it doesn't work the same way as the original in all the aspects but it mostly does and the spirit is the same.

You will need ImageMagick for image processing and bc installed to have this running properly.

Script usage:

Print-A-Gif.sh [GIFFILE]

There is no GUI. You need to supply parameters in the script file itself.

#####################################
# PARAMETERS DEFINITION
REPEATX=2
REPEATY="AUTO"
TABWIDTH="AUTO"
TABWIDTH_AUTO=30
TABCOLOR="gray90"
TABCOLOR_COVER="white"
PRINTMARGIN=30
CUTSPACING=1
FRAMEMULTIPLIER=3
ANNOTATIONSIZE=30
#####################################

The notes and tips below are mostly coming from the original!

Some notes on the parameters:

  • Use the REPEATX and REPEATY controls to choose how the images are tiled. I've found that 2 frames on wide works nicely. If REPEATY is set to "AUTO" then the script will fit as many as can vertically , otherwise you can provide any number you see fit.

  • TABWIDTH: This is the width of the gluing / clamping area at the left of the frames. If this is set to "AUTO" then the TABWIDTH is automatically set to TABWIDTH_AUTO [%] of the width of the original frame but can be adjusted if preferred.

  • (New parameter) TABCOLOR: This is the background color used for the clamping area.

  • (New parameter) TABCOLOR_COVER: This is the background color used for the clamping area in the last 2 frames. The tool automatically adds first and last frame as possible covers at the end. This color is also used as background for additional missing frames that fill up the last page.

  • PRINTMARGIN: This is the margin around the edge of each page of frames in the final output file. Adjust so that nothing is lost from the edges when printing. Ideal value is 0 as it will save you some cutting.

  • CUTSPACING: This is the spacing between each frame. I tend to leave this set to 1 as it makes it easier to cut all the frames the same size with an scalpel.

  • (New parameter) FRAMEMULTIPLIER: This allows to repeat same frame multiple times. This may be useful to adjust the flip book speed.

  • Bear in mind that TABWIDTH, PRINTMARGIN, CUTSPACING and FRAMEMULTIPLIER are subject to change when printed due to final scaling. Experiment if necessary.

  • (New parameter) ANNOTATIONSIZE: This allows to set the font size for the annotations. This is relative value and shall be adjusted visually when seeing the result. The actual text size for the annotations is calculated automatically.

  • All the interim images are placed in "tmp" folder and deleted at the end

  • You may also see some blank frames at the end. These are used to pad out the final page if necessary. This ensured that all pages came out the same size and saved a lot of calculations.

  • Now you can print the pdf and cut out the frames!

Tips:

  • Be sure to leave adequate tab width for gluing / clamping. Too narrow and it's hard to see the left side of the images when flipping through the flip book.

  • Stiffer paper, e.g., glossy photo paper lends to a better flipping experience

  • When stacking the cut-out frames, slant the stack a little bit so that the bottom layers protrude a little further to the right than the top layers. This makes it easier to flip through the pages.

  • Try to be as accurate as possible when cutting so that the left and right edges of the flip book aren't too jagged. There will inevitably be some variation.

  • When stacking the frames, tap the right edge of the stack down on a table. It's more important that this edge is aligned when it comes to flipping through the book.

  • Clamp the spine edge securely when gluing

Original demo video: https://www.youtube.com/watch?v=roJq69vgE2U

Example output of the script:

PRINT-A-GIF
Processing file: the-simpsons-homer-simpson.gif
┏━━━━━
┣ tab width: 66
┣ image grid per page: 1x3
┣ image width x height: 220x165
┣ output image width x height: 286x165
┣ frame count: 29
┣ creating cover frames ... done
┣ frame multiplier: 3
┣ adding repeating frames ... done
┣ enhanced frame count:  89
┣ frames per page:  3
┣ missing frame count:  1
┣ adding frames ... done
┣ page count:  30
┣ annotating frames (text size 7) ... done
┣ preparing pages ... done
┣ exporting flipbook-the-simpsons-homer-simpson.pdf ... done

print-a-gif's People

Contributors

llansky3 avatar stupotmcdoodlepip avatar

Stargazers

 avatar

Forkers

yescorp

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.