{"id":16049136,"url":"https://github.com/kleisauke/net-vips","last_synced_at":"2025-05-14T09:06:34.103Z","repository":{"id":37734662,"uuid":"122058741","full_name":"kleisauke/net-vips","owner":"kleisauke","description":".NET binding for libvips.","archived":false,"fork":false,"pushed_at":"2025-04-02T12:37:40.000Z","size":29635,"stargazers_count":429,"open_issues_count":10,"forks_count":34,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-13T20:18:02.482Z","etag":null,"topics":["bindings","dotnet","image-processing","libvips","mono","pinvoke"],"latest_commit_sha":null,"homepage":"https://kleisauke.github.io/net-vips/","language":"C#","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/kleisauke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"open_collective":"libvips"}},"created_at":"2018-02-19T12:23:37.000Z","updated_at":"2025-04-13T13:55:52.000Z","dependencies_parsed_at":"2024-01-14T10:45:32.566Z","dependency_job_id":"b5a70c87-9c17-474d-b44f-67f9ad27263e","html_url":"https://github.com/kleisauke/net-vips","commit_stats":{"total_commits":434,"total_committers":6,"mean_commits":72.33333333333333,"dds":0.01382488479262678,"last_synced_commit":"d5186afe74efcc4e268a64d5088926eb67943aa7"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleisauke%2Fnet-vips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleisauke%2Fnet-vips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleisauke%2Fnet-vips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleisauke%2Fnet-vips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kleisauke","download_url":"https://codeload.github.com/kleisauke/net-vips/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110278,"owners_count":22016386,"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":["bindings","dotnet","image-processing","libvips","mono","pinvoke"],"created_at":"2024-10-09T00:14:00.208Z","updated_at":"2025-05-14T09:06:34.082Z","avatar_url":"https://github.com/kleisauke.png","language":"C#","funding_links":["https://opencollective.com/libvips"],"categories":[],"sub_categories":[],"readme":"# NetVips\n\n[![NuGet](https://img.shields.io/nuget/v/NetVips.svg)](https://www.nuget.org/packages/NetVips)\n[![CI status (x64 Linux, macOS and Windows)](https://github.com/kleisauke/net-vips/workflows/CI/badge.svg)](https://github.com/kleisauke/net-vips/actions)\n[![CI status (Linux ARM64v8)](https://circleci.com/gh/kleisauke/net-vips.svg?style=shield)](https://circleci.com/gh/kleisauke/net-vips)\n[![CI status (NetVips nightly packaging)](https://ci.appveyor.com/api/projects/status/d2r9uanb5yij07pt/branch/master?svg=true)](https://ci.appveyor.com/project/kleisauke/net-vips/branch/master)\n\nThis NuGet package provides a .NET binding for the [libvips image processing library](https://www.libvips.org/).\n\nThis binding passes the vips test suite cleanly with no leaks on Windows, macOS and Linux.\n\nWe have formatted docs online here:\n\nhttps://kleisauke.github.io/net-vips/\n\n## How it works\n\nPrograms that use `NetVips` don't manipulate images directly, instead\nthey create pipelines of image processing operations building on a source\nimage. When the end of the pipe is connected to a destination, the whole\npipeline executes at once, streaming the image in parallel from source to\ndestination a section at a time.\n\nBecause `NetVips` is parallel, it's quick, and because it doesn't need to\nkeep entire images in memory, it's light. For example, the `NetVips` benchmark:\n\n[NetVips.Benchmarks](https://github.com/kleisauke/net-vips/tree/master/tests/NetVips.Benchmarks)\n\nLoads a large image, shrinks by 10%, sharpens, and saves again. On this test\n`NetVips` is around 22 times faster than Magick.NET and 4 times faster than ImageSharp.\n\nThe [libvips documentation](https://www.libvips.org/API/current/)\nhas a [chapter explaining how libvips opens files](\nhttps://www.libvips.org/API/current/How-it-opens-files.html)\nwhich gives some more background.\n\n## Supported platforms\n\n- .NET Framework 4.5.2 and higher\n- .NET 6.0 and higher\n\n## Install\n\nYou need the libvips shared library on your library search path, version 8.2 or\nlater. There are separate NuGet packages that will contain the pre-compiled\nlibvips binaries for the most common platforms (see\n[this repo](https://github.com/kleisauke/libvips-packaging) for details):\n\n|                                     | NuGet Package\u003csup\u003e1\u003c/sup\u003e                                                         |\n|-------------------------------------|:---------------------------------------------------------------------------------:|\n| **Windows 64-bit**                  | [![NetVips.Native.win-x64-badge]][NetVips.Native.win-x64-nuget]                   |\n| **Windows 32-bit**                  | [![NetVips.Native.win-x86-badge]][NetVips.Native.win-x86-nuget]                   |\n| **Windows ARM64**                   | [![NetVips.Native.win-arm64-badge]][NetVips.Native.win-arm64-nuget]               |\n| **Linux x64 glibc**\u003csup\u003e2\u003c/sup\u003e     | [![NetVips.Native.linux-x64-badge]][NetVips.Native.linux-x64-nuget]               |\n| **Linux x64 musl**\u003csup\u003e3\u003c/sup\u003e      | [![NetVips.Native.linux-musl-x64-badge]][NetVips.Native.linux-musl-x64-nuget]     |\n| **Linux ARM64v8 glibc**\u003csup\u003e2\u003c/sup\u003e | [![NetVips.Native.linux-arm64-badge]][NetVips.Native.linux-arm64-nuget]           |\n| **Linux ARM64v8 musl**\u003csup\u003e3\u003c/sup\u003e  | [![NetVips.Native.linux-musl-arm64-badge]][NetVips.Native.linux-musl-arm64-nuget] |\n| **Linux ARMv7**                     | [![NetVips.Native.linux-arm-badge]][NetVips.Native.linux-arm-nuget]               |\n| **macOS x64**                       | [![NetVips.Native.osx-x64-badge]][NetVips.Native.osx-x64-nuget]                   |\n| **macOS ARM64**                     | [![NetVips.Native.osx-arm64-badge]][NetVips.Native.osx-arm64-nuget]               |\n\n[NetVips.Native.win-x64-badge]: https://img.shields.io/nuget/v/NetVips.Native.win-x64.svg\n[NetVips.Native.win-x64-nuget]: https://www.nuget.org/packages/NetVips.Native.win-x64\n[NetVips.Native.win-x86-badge]: https://img.shields.io/nuget/v/NetVips.Native.win-x86.svg\n[NetVips.Native.win-x86-nuget]: https://www.nuget.org/packages/NetVips.Native.win-x86\n[NetVips.Native.win-arm64-badge]: https://img.shields.io/nuget/v/NetVips.Native.win-arm64.svg\n[NetVips.Native.win-arm64-nuget]: https://www.nuget.org/packages/NetVips.Native.win-arm64\n[NetVips.Native.linux-x64-badge]: https://img.shields.io/nuget/v/NetVips.Native.linux-x64.svg\n[NetVips.Native.linux-x64-nuget]: https://www.nuget.org/packages/NetVips.Native.linux-x64\n[NetVips.Native.linux-musl-x64-badge]: https://img.shields.io/nuget/v/NetVips.Native.linux-musl-x64.svg\n[NetVips.Native.linux-musl-x64-nuget]: https://www.nuget.org/packages/NetVips.Native.linux-musl-x64\n[NetVips.Native.linux-arm64-badge]: https://img.shields.io/nuget/v/NetVips.Native.linux-arm64.svg\n[NetVips.Native.linux-arm64-nuget]: https://www.nuget.org/packages/NetVips.Native.linux-arm64\n[NetVips.Native.linux-musl-arm64-badge]: https://img.shields.io/nuget/v/NetVips.Native.linux-musl-arm64.svg\n[NetVips.Native.linux-musl-arm64-nuget]: https://www.nuget.org/packages/NetVips.Native.linux-musl-arm64\n[NetVips.Native.linux-arm-badge]: https://img.shields.io/nuget/v/NetVips.Native.linux-arm.svg\n[NetVips.Native.linux-arm-nuget]: https://www.nuget.org/packages/NetVips.Native.linux-arm\n[NetVips.Native.osx-x64-badge]: https://img.shields.io/nuget/v/NetVips.Native.osx-x64.svg\n[NetVips.Native.osx-x64-nuget]: https://www.nuget.org/packages/NetVips.Native.osx-x64\n[NetVips.Native.osx-arm64-badge]: https://img.shields.io/nuget/v/NetVips.Native.osx-arm64.svg\n[NetVips.Native.osx-arm64-nuget]: https://www.nuget.org/packages/NetVips.Native.osx-arm64\n\n\u003csup\u003e1\u003c/sup\u003e The version number of these NuGet packages is in sync with libvips' version number.  \n\u003csup\u003e2\u003c/sup\u003e Uses glibc as the standard C library (Ubuntu, Debian, etc).  \n\u003csup\u003e3\u003c/sup\u003e Uses musl as the standard C library (Alpine, Gentoo Linux, etc).\n\nThese binaries provides support for the JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats.\n\nThen just install this package, perhaps:\n\n    Install-Package NetVips\n\nTo test your install, try this test program:\n\n```csharp\nif (ModuleInitializer.VipsInitialized)\n{\n    Console.WriteLine($\"Inited libvips {NetVips.Version(0)}.{NetVips.Version(1)}.{NetVips.Version(2)}\");\n}\nelse\n{\n    Console.WriteLine(ModuleInitializer.Exception.Message);\n}\nConsole.ReadLine();\n```\n\nIf NetVips was able to find the libvips shared library, you should see:\n\n    Inited libvips [VERSION_NUMBER]\n\nHowever, if you see something else, NetVips was unable to initialize libvips.\nThis can happen for a variety of reasons, even though most of the times it's because NetVips\nwas not able to find libvips or due to x86/x64 architecture problems:\n\n| Inner exception | HRESULT | Solution |\n| :--- | :--- | :--- |\n| DllNotFoundException | 0x8007007E | Make sure to add the `bin` folder of the libvips Windows build to your `PATH` environment variable (if you wish to not use the separate NuGet packages). |\n| BadImageFormatException | 0x8007000B | Make sure when you target the `AnyCPU` platform the `Prefer 32-bit` option is unchecked. Or try to target `x64` instead. |\n\n## Example\n\n```csharp\nusing NetVips;\n\nusing var im = Image.NewFromFile(\"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://www.libvips.org/API/current/libvips-conversion.html#vips-embed\nusing var embed = im.Embed(100, 100, 3000, 3000, extend: Enums.Extend.Mirror);\n\n// multiply the green (middle) band by 2, leave the other two alone\nusing var multiply = embed * new[] { 1, 2, 1 };\n\n// make an image from an array constant, convolve with it\nusing var mask = Image.NewFromArray(new[,]\n{\n    {-1, -1, -1},\n    {-1, 16, -1},\n    {-1, -1, -1}\n}, 8);\nusing var convolve = multiply.Conv(mask, precision: Enums.Precision.Integer);\n\n// finally, write the result back to a file on disk\nconvolve.WriteToFile(\"output.jpg\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleisauke%2Fnet-vips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkleisauke%2Fnet-vips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleisauke%2Fnet-vips/lists"}