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.

    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
    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.

    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.

    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
    resources/example5.png

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.1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

slidefit-0.1.0-py3-none-any.whl (17.9 kB view hashes)

Uploaded Python 3

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