Skip to main content

get-stick-bugged-lol

A fork of the Python module and command-line tool that generates a Get Stick Bugged Lol video from any image.

Original by: n0spaces

Example

gsbl python.jpg python.mp4 -r 760 475 -s 0.7

Example GIF

Example video with sound

This script uses pylsd-nova to detect line segments in the image, Pillow to draw the lines as they move to form the stick bug, and MoviePy to create the video.

Requirements

  • Python 3.6 or later (any OS)

Installation

This package can be installed using pip:

pip install get-stick-bugged-lol

Usage

In the terminal

Installing the package will register the gsbl command in the terminal (or you can use python -m gsbl). To use the image input.png to generate the video output.mp4:

gsbl input.png output.mp4

Optional arguments:

  • -h, --help show this help message and exit
  • -r --resolution WIDTH HEIGHT width and height of the video (default: 720 720)
  • --img-bg-color R G B RGB background color while the image is visible (default: 0 0 0)
  • --line-color R G B RGB color of line segments (default: 255 255 211)
  • --line-bg-color R G B RGB background color after image disappears (default: 125 115 119)
  • -s --scale SCALE the image scale passed to the line segment detector. Slightly lowering this may improve results in large images. This does not affect the image scale in the video (try --resolution instead). (default: 0.8)

In a Python script

from PIL import Image
from gsbl.stick_bug import StickBug

# Create the StickBug object
sb = StickBug(Image.open('example.png'))  # parameter can also just be a filepath

# Change some properties if you want
sb.video_resolution = (1280, 720)
sb.lsd_scale = 0.5

# That's it! The video will be generated the first time you access it
video = sb.video  # MoviePy VideoClip

# Or you can just save it
sb.save_video('example.mp4')

# If any settings were changed, the video will be regenerated the next time you access it.
sb.line_color = (128, 0, 255)
video_purple = sb.video

StickBug properties

  • image the source PIL Image. You can set this when initializing StickBug, or at any time by accessing the property. If you want, you can leave this parameter empty while initializing.

  • segments a numpy array of the 9 line segments detected. If the line segment detector hasn't run yet, that's done the first time this is accessed. The line segment detector will run again if any other properties have changed. This can also be set manually if you want. Each row of the array must contain the values [x1, y1, x2, y2, width].

  • video (readonly) the MoviePy VideoClip generated by the script. If the video hasn't been generated yet, that's done the first time this is accessed. The video will be regenerated if any other properties have changed.

  • video_resolution the resolution of the video as a tuple

  • lsd_scale the image scale passed to the line segment detector. Slightly lowering this may improve results in large images. This does not affect the image scale in the video.

  • img_bg_color the background color of the video while the image is visible

  • line_color the color of the line segments in the video

  • line_bg_color the background color of the video after the image disappears

Building

Install the required packages:

pip install -r requirements.txt

Install this package directly:

cd [path to repository]
pip install .

Or build a wheel:

cd [path to repository]
python3 setup.py bdist_wheel

License

This package is available under the MIT License. See LICENSE for more info.

This package makes use of the following external libraries:

Metadata

Release files for get-stick-bugged-lol-fork 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for get-stick-bugged-lol-fork 1.0.2
File Size Uploaded Provenance Actions
get_stick_bugged_lol_fork-1.0.2.tar.gz 2.6 MB Without provenance Details for get_stick_bugged_lol_fork-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for get-stick-bugged-lol-fork 1.0.2
File Interpreter ABI Platform Actions
get_stick_bugged_lol_fork-1.0.2-py3-none-any.whl Python 3 none any Details for get_stick_bugged_lol_fork-1.0.2-py3-none-any.whl

Total release size: 5.2 MB

Release files / get_stick_bugged_lol_fork-1.0.2.tar.gz

Download URL get_stick_bugged_lol_fork-1.0.2.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
3a5de65982aba729df79cfe74a6d6b85ea06ea1313e85a97ff2273941b874ee1
BLAKE2b-256 checksum
How to use checksums
60d7cc5dc7b30f68ae3067907a9ba8a41b2dce972fce896a9ab8abaaeabba676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / get_stick_bugged_lol_fork-1.0.2-py3-none-any.whl

Download URL get_stick_bugged_lol_fork-1.0.2-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
940d3e0515dcac7df00e712384d8b34536aabebff4ff5d904e43bf1b0b7235cb
BLAKE2b-256 checksum
How to use checksums
e7fca3636935e4ed229dd35139be2613625cd2905e438e58f8f3d9af5fd29fbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for get-stick-bugged-lol-fork 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page