Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur Animation source code and simplified output #328

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marcodallavecchia
Copy link
Contributor

Hello everyone!
I've seen from this issue, that we were looking to implement a better blur animation figure for section 06-blurring.

I've implemented a Python script that creates this animation with Matplotlib. Here are a few points:

  • I created a simple single-channel 30x30 pixels image of a letter A (using ImageJ) → available in episodes/data/A.tif
  • I exported the animation output directly in episodes/fig/blur-demo.gif
  • The animation has as a first frame the complete blurred image (for the print version, as described in the issue)
  • I chose more or less arbitrarily the colors → please let me know which colors you think could be better / more accessible
  • The code works but it's not the cleanest nor the most structured. But I tried to keep it well documented.
  • I've attached a small README and env.yml file for the requirements
  • Of course, with this script, anyone can change the source image, colors, speed and more of the animation and create a better version if desired.

A final extra point from my side: I'm a big believer that every output should be associated with its source-code, especially in the carpentries context where we are trying to keep things reproducible. In this case, I couldn't find the code used to create the previous version of the blur-demo.gif so I took the freedom to create a episodes/files/source-code/ directory, where we could pool together all the code snippets for generating all the output that would later feed on the website (this is where my current create_blur_animation.py file is). I am unsure if this is the best place to have such folder, maybe in the root could even be better for clear reference.

I hope this is helpful for the issue and course material. I am open to improve it in the near future after some feedback!

Marco Dalla Vecchia added 2 commits June 20, 2024 16:24
…f a single-channel image of letter A. I added the A.tif image in data and the exported animation directly into the fig directory
Copy link

github-actions bot commented Jun 20, 2024

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/datacarpentry/image-processing/compare/md-outputs..md-outputs-PR-328

The following changes were observed in the rendered markdown documents:

 data/A.tif (new)                                   | Bin 0 -> 1136 bytes
 fig/blur-demo.gif                                  | Bin 32633468 -> 567305 bytes
 files/source-code/blur-animation/README.md (new)   |  24 ++++
 .../blur-animation/create_blur_animation.py (new)  | 147 +++++++++++++++++++++
 files/source-code/blur-animation/env.yml (new)     |  11 ++
 5 files changed, 182 insertions(+)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2024-06-21 13:53:31 +0000

github-actions bot pushed a commit that referenced this pull request Jun 20, 2024
github-actions bot pushed a commit that referenced this pull request Jun 21, 2024
@uschille uschille self-assigned this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants