A simple package to generate GIF files of realistic rotating cards based on image pairs.
Project description
Card Rotator - Generating 3D Rotation Animation GIFs
This package helps users generate 3D rotating animation cards based on image pairs of front and back. This is similar to what 3dgifmaker (https://www.3dgifmaker.com/) can do, but couldn't really generate them in bulk. This module provides an alternative solution with bulk-generating capabilities.
Installation
Run the following to install the python dependencies:
pip install opencv-python numpy Pillow
To install this package via pip, run:
pip install card-rotator
Usage
Basic Usage
from CardRotator import CardRotator
rotator = CardRotator(input_folder)
rotator.run(output_path)
Parameters
To vary parameters of the animations, CardRotator
class has arguments shown below:
rotator = CardRotator(input_folder: str, frames: int = 240, speed: int = 60,
buffer_px: int = 100, zoom_factor: int = 50, verbose: bool = True)
Name | Description | Default setting |
---|---|---|
input_folder | absolute path with image file pairs, where each image pair should be formatted exactly as [file_name]_front.jpg and [file_name]_back.jpg for it to be successfully detected |
n/a |
frames | number of frames, controls the smoothness | 240 |
speed | speed of rotation, play around with this number | 60 |
buffer_px | the black frame to extend the image by in pixels | 100 |
zoom_factor | affects the field of view, play around with this | 50 |
verbose | if you'd like to have printed statements | True |
rotator.run(output_path)
Name | Description | Default setting |
---|---|---|
output_path | absolute path of where the output GIFs should be located | n/a |
Demo
Examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
card-rotator-0.0.3.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for card_rotator-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb2976115dc7fe1978b414dc3d736ad0b84e9f4663229afdfffbdf673ff2f6c9 |
|
MD5 | a3071dbc3489f7b06673ec88cb0e46d6 |
|
BLAKE2b-256 | 6b1e5594d39fa89ca45500bbc9a598e75b06ca2c526917efbbc772c1642a013c |