{"id":15713660,"url":"https://github.com/naqvis/crystal-vips","last_synced_at":"2025-07-10T18:40:50.058Z","repository":{"id":41286841,"uuid":"509001116","full_name":"naqvis/crystal-vips","owner":"naqvis","description":"Crystal bindings for the libvips image processing library.","archived":false,"fork":false,"pushed_at":"2024-03-15T02:02:32.000Z","size":4959,"stargazers_count":45,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T02:27:57.785Z","etag":null,"topics":["crystal","crystal-bindings","crystal-lang","crystal-language","crystal-shard","libvips"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/naqvis.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}},"created_at":"2022-06-30T08:44:09.000Z","updated_at":"2025-01-29T21:38:02.000Z","dependencies_parsed_at":"2024-02-18T11:27:14.194Z","dependency_job_id":"b503c459-1f0a-401f-ab6a-fbb2adf3c0da","html_url":"https://github.com/naqvis/crystal-vips","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/naqvis/crystal-vips","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-vips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-vips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-vips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-vips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naqvis","download_url":"https://codeload.github.com/naqvis/crystal-vips/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-vips/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264631403,"owners_count":23640960,"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":["crystal","crystal-bindings","crystal-lang","crystal-language","crystal-shard","libvips"],"created_at":"2024-10-03T21:32:46.058Z","updated_at":"2025-07-10T18:40:49.598Z","avatar_url":"https://github.com/naqvis.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrystalVips\n\n[![crystal-vips CI](https://github.com/naqvis/crystal-vips/actions/workflows/ci.yml/badge.svg)](https://github.com/naqvis/crystal-vips/actions/workflows/ci.yml)\n[![Latest release](https://img.shields.io/github/release/naqvis/crystal-vips.svg)](https://github.com/naqvis/crystal-vips/releases)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://naqvis.github.io/crystal-vips/)\n\nProvides Crystal language interface to the [libvips](https://github.com/libvips/libvips) image processing library.\nPrograms that use `CrystalVips` don't manipulate images directly, instead they create pipelines of image processing operations starting from a source image. When the pipe is connected to a destination, the whole pipeline executes at once and in parallel, streaming the image from source to destination in a set of small fragments.\n\nBecause `CrystalVips` is parallel, its' quick, and because it doesn't need to keep entire images in memory, its light. For example, the libvips speed and memory use benchmark:\n\n[https://github.com/libvips/libvips/wiki/Speed-and-memory-use](https://github.com/libvips/libvips/wiki/Speed-and-memory-use)\n\n## Pre-requisites\n\nYou need to [install the libvips\nlibrary](https://www.libvips.org/install.html). It's in the linux package managers, homebrew and MacPorts, and there are Windows binaries on the vips website. For example, on Debian:\n\n```\nsudo apt-get install --no-install-recommends libvips42\n```\n\n(`--no-install-recommends` stops Debian installing a *lot* of extra packages)\n\nOr macOS:\n\n```\nbrew install vips\n```\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     vips:\n       github: naqvis/crystal-vips\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"vips\"\n\nim = Vips::Image.new_from_file(\"image.jpg\")\n\n# put im at position (100, 100) in a 3000 x 3000 pixel image, \n# make the other pixels in the image by mirroring im up / down / \n# left / right, see\n# https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-embed\nim = im.embed(100, 100, 3000, 3000, extend: Vips::Enums::Extend::Mirror)\n\n# multiply the green (middle) band by 2, leave the other two alone\nim *= [1, 2, 1]\n\n# make an image from an array constant, convolve with it\nmask = Vips::Image.new_from_array([\n    [-1, -1, -1],\n    [-1, 16, -1],\n    [-1, -1, -1]], 8)\nim = im.conv(mask, precision: Vips::Enums::Precision::Integer)\n\n# finally, write the result back to a file on disk\nim.write_to_file(\"output.jpg\")\n```\n\nRefer to [example](example) folder for more samples\n\n## Development\n\nTo run all tests:\n\n```\ncrystal spec\n```\n\n# Getting more help\n\nThe libvips website has a handy table of [all the libvips\noperators](http://libvips.github.io/libvips/API/current/func-list.html). Each\none links to the main API docs so you can see what you need to pass to it.\n\nA simple way to see the arguments for an operation is to try running it\nfrom the command-line. For example:\n\n```bash\n$ vips embed\nembed an image in a larger image\nusage:\n   embed in out x y width height\nwhere:\n   in           - Input image, input VipsImage\n   out          - Output image, output VipsImage\n   x            - Left edge of input in output, input gint\n\t\t\tdefault: 0\n\t\t\tmin: -1000000000, max: 1000000000\n   y            - Top edge of input in output, input gint\n\t\t\tdefault: 0\n\t\t\tmin: -1000000000, max: 1000000000\n   width        - Image width in pixels, input gint\n\t\t\tdefault: 1\n\t\t\tmin: 1, max: 1000000000\n   height       - Image height in pixels, input gint\n\t\t\tdefault: 1\n\t\t\tmin: 1, max: 1000000000\noptional arguments:\n   extend       - How to generate the extra pixels, input VipsExtend\n\t\t\tdefault: black\n\t\t\tallowed: black, copy, repeat, mirror, white, background\n   background   - Color for background pixels, input VipsArrayDouble\noperation flags: sequential \n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/naqvis/crystal-vips/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Ali Naqvi](https://github.com/naqvis) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvis%2Fcrystal-vips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaqvis%2Fcrystal-vips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvis%2Fcrystal-vips/lists"}