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 

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

```python
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.2.0.tar.gz (5.6 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.2.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for progressionpicturepal-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d7e2fbfc59f7f4f6050ced687113fce137e1f25691fd59d169eee488d59fadb6
MD5 43f4c6495cb18d5fe1a6d5513a18043b
BLAKE2b-256 5ffd78c0394a2d390bdfc1a4b8cdc855e4bc62e9d543ac6398fbd6ad92726469

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for progressionpicturepal-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73b3abd854548274bcecbca4b13a3b32b7b8aee4d16d7339e10a03c1809c0fe4
MD5 0b91e47ce66d23bef445d89454b915b7
BLAKE2b-256 4ea69560b3874d8b0a56923c3ba72fc3fcdbb32ad7e289c75d516f2eb63b4b3c

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