{"id":20722463,"url":"https://github.com/toomanybees/engiffen","last_synced_at":"2025-04-23T15:48:03.185Z","repository":{"id":54816698,"uuid":"80313945","full_name":"TooManyBees/engiffen","owner":"TooManyBees","description":"gif encoding library/binary for Rust","archived":false,"fork":false,"pushed_at":"2023-11-23T22:44:59.000Z","size":3120,"stargazers_count":12,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T00:49:01.115Z","etag":null,"topics":["gif","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TooManyBees.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-28T22:06:23.000Z","updated_at":"2024-03-04T07:51:25.000Z","dependencies_parsed_at":"2022-08-14T03:40:45.286Z","dependency_job_id":null,"html_url":"https://github.com/TooManyBees/engiffen","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TooManyBees%2Fengiffen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TooManyBees%2Fengiffen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TooManyBees%2Fengiffen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TooManyBees%2Fengiffen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TooManyBees","download_url":"https://codeload.github.com/TooManyBees/engiffen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224996518,"owners_count":17404486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gif","rust"],"created_at":"2024-11-17T03:35:57.187Z","updated_at":"2024-11-17T03:35:57.756Z","avatar_url":"https://github.com/TooManyBees.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# engiffen\n\nGenerates gifs from image sequences.\n\n![source bitmap](tests/ball/ball01.bmp)\n![engiffenned gif](tests/ball.gif)\n![photoshopped gif](tests/ball_ps.gif)\n\n_Source frame, generated gif, and a gif from Photoshop_\n\n# usage\n\n## as binary\n\n```bash\n# Read a bunch of bitmaps and write them to a 20-frame-per-second gif at path `hello.gif`\nengiffen *.bmp -f 20 -o hello.gif\n\n# Read a range of files\nengiffen -r file01.bmp file20.bmp -o hello.gif\n# The app sorts them in lexicographical order, so if your shell orders `file9`\n# before `file10`, the resulting gif will not be in that order.\n\n# Use a faster but worse quality algorithm\nengiffen -r file01.bmp file20.bmp -o hello.gif -q naive\n\n# Use the default NeuQuant algorithm, but with a reduced pixel sample rate\n# Values over 1 reduces the amount of pixels the algorithm trains with\nengiffen -r file01.bmp file100.bmp -o hello.gif -s 2\n\n# Print to stdout by leaving out the -o argument\nengiffen *.bmp \u003e output.gif\n# or hose your console by forgetting to redirect!\nengiffen *.bmp\n```\n\n(If your shell doesn't expand glob patterns into individual args (for\ninstance, the Windows commandline), the binary will parse a single\nargument as a glob pattern and expand it into file names on its own.\nYou can install the binary with `--no-default-features` to skip this\nfeature.)\n\n## as library\n\n```rust\nextern crate engiffen;\n\nuse engiffen::{load_images, engiffen, Gif, Quantizer};\nuse std::fs::File;\n\nlet paths = vec![\"vector\", \"of\", \"file\", \"paths\", \"on\", \"disk\"];\nlet images = load_images(\u0026paths);\nlet mut output = File::create(\"output.gif\")?;\n\n// encode an animated gif at 10 frames per second\nlet gif = engiffen(\u0026images, 10, Quantizer::Naive)?;\ngif.write(\u0026mut output);\n```\n\n```rust\n// Optionally specify how many pixels of each frame should be sampled\n// when computing the gif's palette. This value reduces the amount of\n// sampling work to 1/9th of what it normally would, by only sampling\n// every 3rd pixel on every 3rd row (i.e. pixels lying on a 3x3 grid).\nlet gif = engiffen(\u0026images, 10, Quantizer::NeuQuant(3));\n```\n\n# debug output\n\nTo print timing info to STDERR, compile with the `debug-stderr` feature\n\n```\n$ cargo install engiffen --features debug-stderr\n\n$ engiffen *.tif -f 15 -s 10 \u003e out.gif\nChecked image dimensions in 0 ms.\nPushed all frame pixels in 469 ms.\nComputed palette in 67 ms.\nMapped pixels to palette in 3443 ms.\nWrote to stdout in 5415 ms\n```\n\n# misc\n\nTests that actually create gifs from sample frames are ignored. When\nrunning the ignored specs, run in release mode or they'll take forever.\n\n```\ncargo test --release -- --ignored\n```\n\n## Major work to do\n\n* Incremental frame processing\n\n  Accept a stream of frames from a server to process individually as they arrive. Put off sorting the final palette and compiling the gif until finished.\n\n## Contributing \u0026 Contact\n\nGithub doesn't like to alert me to notifications, so hit me up on Twitter [@toomanybees](https://twitter.com/toomanybees) for a quicker response.\n\nPRs and Issues are always welcome.\n\n## Anything else?\n\n![shrug](tests/shrug.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoomanybees%2Fengiffen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoomanybees%2Fengiffen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoomanybees%2Fengiffen/lists"}