{"id":32167520,"url":"https://github.com/ryochin/thumbp","last_synced_at":"2025-10-21T15:32:35.963Z","repository":{"id":206343657,"uuid":"716372128","full_name":"ryochin/thumbp","owner":"ryochin","description":"A Lightweight \u0026 Fast WebP Thumbnail Image Generator for Elixir.","archived":false,"fork":false,"pushed_at":"2025-03-19T02:42:09.000Z","size":207,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T01:19:26.797Z","etag":null,"topics":["elixir","rustler","thumbnail","webp"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/thumbp","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryochin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-09T01:58:39.000Z","updated_at":"2025-06-24T20:24:05.000Z","dependencies_parsed_at":"2024-12-15T00:22:57.260Z","dependency_job_id":"262ab9bf-a88e-46d6-bcc6-b313e0f4c601","html_url":"https://github.com/ryochin/thumbp","commit_stats":null,"previous_names":["ryochin/thumbp"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ryochin/thumbp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryochin%2Fthumbp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryochin%2Fthumbp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryochin%2Fthumbp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryochin%2Fthumbp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryochin","download_url":"https://codeload.github.com/ryochin/thumbp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryochin%2Fthumbp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280286455,"owners_count":26304731,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["elixir","rustler","thumbnail","webp"],"created_at":"2025-10-21T15:32:28.096Z","updated_at":"2025-10-21T15:32:35.951Z","avatar_url":"https://github.com/ryochin.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"⚡ Thumbp: A Lightweight \u0026 Fast WebP Thumbnail Image Generator\n==============================================================\n\n[![Hex.pm](https://img.shields.io/hexpm/v/thumbp.svg)](https://hex.pm/packages/thumbp)\n[![Hexdocs.pm](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/thumbp/)\n[![Hex.pm](https://img.shields.io/hexpm/dt/thumbp.svg)](https://hex.pm/packages/thumbp)\n[![License](https://img.shields.io/hexpm/l/thumbp.svg)](https://github.com/ryochin/thumbp/blob/main/LICENSE)\n\nThumbp is a highly efficient thumbnail creation library for Elixir, designed to output with the [WebP](https://developers.google.com/speed/webp) image format for optimal speed and performance.\n\nNo need for ImageMagick, FFmpeg, libvips, or any other external libraries.\n\nUsage\n-----\n\nRead an image file and create a thumbnail:\n\n```elixir\niex\u003e content = File.read!(\"./test/assets/images/sample.jpg\")\niex\u003e Thumbp.create(content, 320, 240)\n{:ok, \u003c\u003c82, 73, 70, 70, 195, 152, 14, 0, 0, 87, 69, ...\u003e\u003e}\n```\n\nThe `width` and `height` parameters represent the potential maximum sizes, so they do not precisely define the actual dimensions of the image. This implies that the aspect ratio of the image will remain unchanged.\n\nAdjust the quality with an optional parameter ranging from 0 to 100 (default is 75):\n\n```elixir\niex\u003e Thumbp.create(content, 160, 120, quality: 50)\n```\n\nYou can also define a target size, although which may increase the processing time by approximately 20-80%.\n\n```elixir\niex\u003e Thumbp.create(content, 160, 120, target_size: 4_096)    # set to 4KB\n```\n\n\u003e [!Tip]\n\u003e The `quality` and `target_size` options are exclusive.\n\nInstallation\n------------\n\nThe package can be installed by adding `thumbp` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:thumbp, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nThen, run `mix deps.get`.\n\nBenchmark\n---------\n\n* Input: [1280x960 JPEG](https://github.com/ryochin/thumbp/blob/main/test/assets/images/sample.jpg) (85% quality), 171.5KB\n* Output: 320x240 WebP (50% quality), ~2.4KB\n\n```sh\nmix run benchmark/benchmark.exs\n```\n\n```text\nName                      ips        average  deviation         median         99th %\nthumbp                  86.98       11.50 ms     ±7.53%       11.25 ms       15.64 ms\nimage (libvips)         73.95       13.52 ms    ±13.13%       12.99 ms       21.96 ms\n\nComparison:\nthumbp                  86.98\nimage (libvips)         73.95 - 1.18x slower +2.03 ms\n```\n\nDevelopment\n-----------\n\n### Prerequisites\n\n\u003e [!NOTE]\n\u003e This library requires the [Rust](https://www.rust-lang.org/) Toolchain for compilation.\n\nFollow the instructions at [www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) to install Rust.\n\nVerify the installation by checking the `cargo` command version:\n\n```sh\ncargo --version\n# Should output something like: cargo 1.82.0 (8f40fc59f 2024-08-21)\n```\n\nThen, set the `RUSTLER_PRECOMPILATION_EXAMPLE_BUILD` environment variable to ensure that local sources are compiled instead of downloading a precompiled library file.\n\n```sh\nRUSTLER_PRECOMPILATION_EXAMPLE_BUILD=1 mix compile\n```\n\nLicense\n-------\n\nThe MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryochin%2Fthumbp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryochin%2Fthumbp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryochin%2Fthumbp/lists"}