JuliaIO / GIFImages.jl

Provides Gif support in Julia using LibGif
https://ashwani-rathee.github.io/GIFImages.jl/dev/
MIT License
12 stars 2 forks source link
gif hacktoberfest julia

Link


GIFImages.jl provides support for decoding and encoding GIF images by wrapping LibGif. GIF(Graphics Interchange Format) supports up to 8 bits per pixel for each image, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space. It also supports animations and allows a separate palette which are known as local colormap of up to 256 colors for each frame. GIF is palette based, is very widely used and is a loseless data compression format.

Docs-dev Slack License: MIT Downloads

Installation

If you have not yet installed Julia, please follow the instructions for your operating system.

Stable Version

# Enter ']' from the REPL to enter Pkg mode.
pkg> add GIFImages.jl

Dev Version

using Pkg
# Enter ']' from the REPL to enter Pkg mode.
pkg> add https://github.com/ashwani-rathee/GIFImages.jl.git

Usage

For decoding purposes, GIFImages.jl currently supports gif_decode which decode the GIF image as colorant matrix. The source data needs to be a filename.

Arguments

Examples

julia> using GIFImages, Downloads

julia> path = "test/data/fire.gif"
"test/data/fire.gif"

julia> img = gif_decode(path)
60×30×33 Array{RGB{N0f8},3} with eltype RGB{N0f8}

For encoding, GIFImages.jl provides gif_encode which encode the GIF colorant matrix to file.

Arguments

Examples

julia> using GIFImages, Downloads

julia> path = "test/data/fire.gif"
"test/data/fire.gif"

julia> img = gif_decode(path)
60×30×33 Array{RGB{N0f8},3} with eltype RGB{N0f8}

julia> gif_encode("fire.gif", img)

Contributions and Issues:

If you have questions about GIFImages.jl, feel free to get in touch via Slack or open an issue :hearts: