Skip to main content

Compose image-flow diagrams with captions and arrows

Project description

Progression Picture Pal

PPP is perfect if you want to automate showing progression in images.

pip install progressionpicturepal

Examples

All images generated with the below code with different num_images and max_per_row values to show different behaviour.

from progressionpicturepal import create_flow_diagram

images = [
    ("example_images/step1.JPG", "\"First you go to the beach\""),
    ("example_images/step2.JPG", "\"Then you look at a green bush and think about your place in the world\""),
    ("example_images/step3.JPG", "\"Then you see a red leaf\""),
    ("example_images/step4.JPG", "\"But then you see a white house\""),
    ("example_images/step5.JPG", "\"So you look at some bins\""),
    ("example_images/step6.JPG", "\"And then some more houses\""),
    ("example_images/step7.JPG", "\"Before finally looking at your foot\""),
]

create_flow_diagram(
    images=images,
    output_path="flow_output.png",
    num_images=6,
    spacing=160,
    spacing_vertical=100,
    max_node_dim=400,
    max_per_row=3,
    font_size=20,
    arrow_padding_v=70
)

Basic

num_images=3

Wrapping with even

num_images=7

Wrapping with odd

num_images=6 
max_per_row=3

Advanced

More advanced usage use the FlowDiagram class directly.

images = [
    ("example_images/step1.JPG", "\"First you go to the beach\""),
    ("example_images/step2.JPG", "\"Then you look at a green bush and think about your place in the world\""),
    ("example_images/step3.JPG", "\"Then you see a red leaf\""),
    ("example_images/step4.JPG", "\"But then you see a white house\""),
    ("example_images/step5.JPG", "\"So you look at some bins\""),
    ("example_images/step6.JPG", "\"And then some more houses\""),
    ("example_images/step7.JPG", "\"Before finally looking at your foot\""),

]

fd = FlowDiagram(spacing=160, spacing_vertical=100, max_node_dim=400, max_per_row=3,
                    font_size=20, arrow_padding_v=70)

num_images = 6
for image in images[0:num_images]: 
    fd.add_node(image[0], image[1]) 

# only put an arrow every second image
for i in range(num_images-1, 2):
    fd.add_arrow(i, i+1)
fd.save("flow_output.png")

Sponsorship

Sample images kindly provided by Sam Lewis of https://snaps.samlewis.me .

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

progressionpicturepal-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

progressionpicturepal-0.3.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file progressionpicturepal-0.3.0.tar.gz.

File metadata

  • Download URL: progressionpicturepal-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for progressionpicturepal-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d432202d4abdabdd60eb6bbc85c606c0b83aa344536413293f1ffd1c08eb50bf
MD5 b77ade431035e504844a756d854df8b8
BLAKE2b-256 206a752cffc095c703662aafad70592dfabd0b4a126a4b128207f7d1225e6165

See more details on using hashes here.

File details

Details for the file progressionpicturepal-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for progressionpicturepal-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61b4e2771753ea9e7b7f11c8afd8ff6ecfb42d89a48dac479893f4b9e3c46517
MD5 db333ef708a4365bb6d0c9e06cf9b28d
BLAKE2b-256 30ab464aba8518f95041dc69ec9df9233cc7c8c4cf97cd557f4d653d58621c14

See more details on using hashes here.

Supported by

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