Skip to main content

Fit images into slides

Project description

slidefit

Fit images into slides. slidefit is a command (callable from a terminal) to fit (a lot of) images into a deck of slides. A template deck of slides can be used to base the fitting on.

python-pptx library is used to do the zipped xml hacking and the file format typically named with the extension .pptx is what is supported.

Installation

One could just copy the file slidefit.py and put it somewhere in the PATH and manually install the dependencies python-pptx and docopt, but otherwise those standard methods should do,

Typical install:

pip install slidefit

Install from cloned repo:

pip install .

After the standard way of installation, slidefit should be available as a command:

slidefit --help

slidefit was written in python and therefore python is required.

Examples

  • Example1 One image per slide as big as possible (7 images, 7 slides)

    Assuming 7 images is required:

    slidefit img0[1-7].png

    Produced slides are saved with a default name (slidefit-output.pptx). Use -o to name it something different:

    slidefit -o example1.pptx img0[1-7].png

    Existing files are not over-written.

    https://github.com/tomnor/slidefit/raw/master/resources/example1.png
  • Example2 Three images per slide in a row (7 images, 3 slides)

    Use the --matrix option (-m 1,3) to specify layout as rows,cols:

    slidefit -m 1,3 -o example2.pptx img0[1-7].png
    https://github.com/tomnor/slidefit/raw/master/resources/example2.png
  • Example3 Three images per slide in one column on the left side

    Use the --hspace (-x) to reserve some horizontal space on the left and/or right side as left,right:

    slidefit -m 3,1 -x 5,80 -o example3.pptx img0[1-7].png

    The space is given as a percentage of available space.

    https://github.com/tomnor/slidefit/raw/master/resources/example3.png
  • Example4 Template with a title slide and 3 more slides with headings

    Use the --template option to specify a template slide deck. Put 4 images in a row on each slide but not the first:

    slidefit -t resources/pen-slides.pptx -m 1,4 -y 20,10 -p 2-4 -o example4.pptx img*.png

    The --pages option (-p) is used to specify what pages to put images on.

    https://github.com/tomnor/slidefit/raw/master/resources/example4.png
  • Example5 Template as above, use different layout on slides

    For example a matrix 2,2 squeezed to the right on pages 2 and 4 and a matrix 1,3 on page 3. More than one pass is required to have different layouts on slides:

    slidefit -t resources/pen-slides.pptx -m 2,2 -x 65,5 -y 20,10 -p 2,4 -o tmp.pptx img0[1-4].png img0[8-9].png img1[0-1].png
    slidefit -t tmp.pptx -m 1,3 -y 20,10 -p 3 -o example5.pptx img0[5-7].png
    rm tmp.pptx
    https://github.com/tomnor/slidefit/raw/master/resources/example5.png
  • Example6 As example5 but using --force to skip special temp files

    Use the target output file example6.pptx as target in all passes and as template file as necessary (once created):

    slidefit -t resources/pen-slides.pptx -m 2,2 -x 65,5 -y 20,10 -p 2,4 -o example6.pptx img0[1-4].png img0[8-9].png img1[0-1].png
    slidefit -f -t example6.pptx -m 1,3 -y 20,10 -p 3 -o example6.pptx img0[5-7].png

    Using --force one can overwrite an existing file.

Other than adding images to slides, slidefit is not supposed to do anything with the slides. A blank slide layout is chosen when no template is given.

Use the --help option to see help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slidefit-0.2.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

slidefit-0.2.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file slidefit-0.2.1.tar.gz.

File metadata

  • Download URL: slidefit-0.2.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for slidefit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e4253583516b6b219a23a8cd6584ac50543313d9b725c06754a8a4bc2cede3fa
MD5 9aa6d73eb82aee9e692c7270dc9f4f88
BLAKE2b-256 f5353e0d3014ad64f8d0c19cab3fe5959e1c553e99577b8e8bf07adb934307d3

See more details on using hashes here.

File details

Details for the file slidefit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: slidefit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for slidefit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5821bda3e8ad80e847dd969b3ba1a25f90f1cb7a6e37f563de23269111e5cff
MD5 09f2ffc1ba3bd070292028b3841bfb1e
BLAKE2b-256 57787e23df46423a8353c78c6d2ea5b64d887527e7e90a7978badf79fa66a975

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page