Skip to main content

GIFImage_ext

GitHub Pages available

Extension of the GIFImage library on pygame.org written by Matthew Roe.

I found it here: http://pygame.org/project-GIFImage-1039-.html

Small bits of code - a couple of instance variables and methods have been added. I've changed very little of Matthews code - most of the changes are additions, but where I have made a change, I've commented out the original line so that it's easy to see what was there vs. what is there now.

methods added:

next_frame()

  • pauses the animation if it is currently playing
  • advances to next frame if the animation is paused
  • goes to first frame if the current frame = frames[-1]

previous_frame()

  • inverse of next_frame()

slow_down()

  • slows the playback speed by increasing the 'duration' variable

speed_up()

  • increases the playback speed by decreasing the 'duration' variable

scale(scale_factor)

  • scale_factor is added to the image_scale variable - pass positive numbers to increase the image size, negative numbers to decrease size gif_image.scale(.05) #increases image size by 5% gif_image.scale(-.05) #decreases image size by 5% -in the .render method, pygame.transform.scale is called on the current frame if img_scale != 1 and the width and height of the original image are multiplied by the image_scale value (It would be more efficient from a processing standpoint to copy all frames out to a new frame list as they are scaled, then use the cached frames in the new list for subsequent playback loops. That would be overkill for my needs though.) -the transformed image is assigned to a new surface which is blitted to the screen so that the original image quality is retained

reset_scale()

  • resets the img_scale value to 1

Persistant Problems:

  • there is still a pallet handling issue as described on the pygame.org website. Time permitting, I'll look into this, but I'm no expert on the GIF image format and this was really a one-off kind of thing for a quick and dirty prototype for a larger project.

Contributing

Bug reports and feature requests can be entered in the Issues menu.

To ask questions about the project, you can create a new issue in the Issues menu with the label ~question.

To contribute any changes simply clone the project on GitHub: https://github.com/Jokymon/GIFImage_ext, push your changes to your own GitHub project and send a pull request.

Metadata

Release files for pygame-animatedgif 0.1.0

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

Source distribution (sdist)

Source distribution for pygame-animatedgif 0.1.0
File Size Uploaded
pygame-animatedgif-0.1.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygame-animatedgif 0.1.0
File Interpreter ABI Platform
pygame_animatedgif-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release files / pygame-animatedgif-0.1.0.tar.gz

Download URL pygame-animatedgif-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c7f54bb0c47b018244747a611593a1f1ea04785b03626f7a674f1551be977288
BLAKE2b-256 checksum
How to use checksums
d136fbf1283ea23426d73bd111c7c0ebd9687912ae38e3335574bce764733a23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / pygame_animatedgif-0.1.0-py3-none-any.whl

Download URL pygame_animatedgif-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd4a7e9497ad2bc06bd353f313aadc204ef21e521739eecbb871d10dc90d8aeb
BLAKE2b-256 checksum
How to use checksums
f06d85ef7ae5a30523428943a681675e8396f17d121b416057335120c0177d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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