https://github.com/phoe/skippy-renderer
GIF renderer for SKIPPY
https://github.com/phoe/skippy-renderer
Last synced: 5 months ago
JSON representation
GIF renderer for SKIPPY
- Host: GitHub
- URL: https://github.com/phoe/skippy-renderer
- Owner: phoe
- Created: 2017-10-02T09:54:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T17:13:12.000Z (over 3 years ago)
- Last Synced: 2025-08-20T00:30:39.945Z (11 months ago)
- Language: Common Lisp
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SKIPPY/RENDERER
This is a GIF renderer for SKIPPY.
## Reason
The issue of rendering a GIF file is that every single GIF frame can - for
compression purposes - only update a single part of the resulting image. For
instance, the first frame can be 100x100px, but the second frame can be 4x4
and only update a part that is 20px from the top and 84px from the left. The
third frame can again be 40x40 and update a yet different part of the image,
the fourth frame can *reverse* the effects of the third frame, etc., etc..
This is why, even if you have the GIF frames alone, it is non-trivial to get
a series of 100x100 images ARGB that you can then convert e.g. into a video
file.
SKIPPY-RENDERER is a library existing to solve this very problem. No matter
what the original frames of the image look like, the RENDER function gives you
a "decompressed" series of 100x100px ARGB frames that you can then e.g. encode
into a different file format.
My personal use case for this library: converting GIF animations into another
file format that required raw ARGB data for each frame.
## Interface
The only exported function is `RENDER` which accepts a SKIPPY data stream and a
`BYTE-ORDER` keyword argument that states the endianness of bytes in the
resulting vector (ARGB or BGRA).
It returns three values - a list of vectors containing ARGB data in row-major
order, a list of integer values for frame delays in milliseconds, and a list
containing three values: image width, image height and a boolean signifying if
the GIF should loop.
```lisp
CL-USER> (skippy:load-data-stream "~/Downloads/cat_picture.gif")
#
CL-USER> (skippy-renderer:render *)
(#(0 0 0 0 0 ...)
...)
(3 3 3 3 3)
(100 100 T)
```
## License
MIT, or whatever the original SKIPPY is licensed under.