Skip to main content

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

1_front 1_back

gif

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

card-rotator-0.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

card_rotator-0.0.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file card-rotator-0.0.3.tar.gz.

File metadata

  • Download URL: card-rotator-0.0.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for card-rotator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 df3de6f15427e67cea684cc51f2c56922be49710d293daf962c9a31217e01d12
MD5 771ba680e6a52fc841c1019f07e58884
BLAKE2b-256 88ce25c4d9a4e5009ff1998c96c7d95dab62271f1ad9ce142302fdab9cff4ef6

See more details on using hashes here.

File details

Details for the file card_rotator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for card_rotator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eb2976115dc7fe1978b414dc3d736ad0b84e9f4663229afdfffbdf673ff2f6c9
MD5 a3071dbc3489f7b06673ec88cb0e46d6
BLAKE2b-256 6b1e5594d39fa89ca45500bbc9a598e75b06ca2c526917efbbc772c1642a013c

See more details on using hashes here.

Supported by

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