{"id":26832820,"url":"https://github.com/happyseafox/sail","last_synced_at":"2026-01-12T05:03:31.211Z","repository":{"id":37559199,"uuid":"250055575","full_name":"HappySeaFox/sail","owner":"HappySeaFox","description":"The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software","archived":false,"fork":false,"pushed_at":"2024-05-21T10:49:25.000Z","size":21937,"stargazers_count":285,"open_issues_count":4,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-22T00:13:46.051Z","etag":null,"topics":["apng","avif","bmp","gif","gif-animation","image-codecs","image-decoding","image-encoding","image-library","jpeg","jpeg2000","pcx","png","qoi","svg","tga","tiff","webp"],"latest_commit_sha":null,"homepage":"","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/HappySeaFox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.INIH.txt","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":"2020-03-25T18:13:44.000Z","updated_at":"2024-06-21T16:50:05.958Z","dependencies_parsed_at":"2023-10-14T15:24:58.428Z","dependency_job_id":"6c7eaaf9-5ecc-4f8c-92a7-a4b22f312f89","html_url":"https://github.com/HappySeaFox/sail","commit_stats":null,"previous_names":["happy-sea-fox/sail"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HappySeaFox%2Fsail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HappySeaFox%2Fsail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HappySeaFox%2Fsail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HappySeaFox%2Fsail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HappySeaFox","download_url":"https://codeload.github.com/HappySeaFox/sail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509221,"owners_count":20950232,"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":["apng","avif","bmp","gif","gif-animation","image-codecs","image-decoding","image-encoding","image-library","jpeg","jpeg2000","pcx","png","qoi","svg","tga","tiff","webp"],"created_at":"2025-03-30T15:18:57.585Z","updated_at":"2026-01-12T05:03:31.204Z","avatar_url":"https://github.com/HappySeaFox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSquirrel Abstract Imaging Library\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eThe missing fast imaging library for humans (not for machines).\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/HappySeaFox/sail/actions\"\u003e\n    \u003cimg alt=\"Build Status\" src=\"https://img.shields.io/github/actions/workflow/status/HappySeaFox/sail/build-and-test.yml\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/HappySeaFox/sail/releases\"\u003e\n    \u003cimg alt=\"Latest release\" src=\"https://img.shields.io/github/v/release/HappySeaFox/sail?include_prereleases\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#target-audience\"\u003eTarget Audience\u003c/a\u003e •\n  \u003ca href=\"#features-overview\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#20-image-formats\"\u003eImage Formats\u003c/a\u003e •\n  \u003ca href=\"#apis-overview\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"FAQ.md\"\u003eFAQ\u003c/a\u003e\n\u003c/p\u003e\n\n#\n\nSAIL is a high-quality cross-platform image decoding library providing rich APIs, from one-liners\nto complex use cases with custom I/O sources. It supports loading and saving static,\nanimated, and multi-paged images along with metadata and ICC profiles. :sailboat:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\".github/qt-demo.gif\"\u003e\u003cimg src=\".github/qt-demo.gif?raw=true\" alt=\"GIF Demo Screenshot\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Target audience\n\n- Image viewers\n- Game developers\n- Anyone who needs to load or save images in different image formats with\n  a clean and comprehensive API\n\n## Features overview\n\n- [x] Thread-safe C, C++, and Python interfaces\n- [x] Versatile APIs: `junior`, `advanced`, `deep diver`, and `technical diver`\n- [x] Input/output: files, memory, custom I/O streams (see [custom-io.c](https://github.com/HappySeaFox/sail/blob/607de77843614e2ba873961d36a91256d6f9bf68/tests/sail/custom-io.c))\n- [x] Load by file extensions, paths, and [magic numbers](https://en.wikipedia.org/wiki/File_format#Magic_number)\n- [x] Format-specific tuning options (e.g., \u003ca href=\"https://en.wikipedia.org/wiki/Portable_Network_Graphics#Filtering\"\u003ePNG filters\u003c/a\u003e). See [FORMATS](FORMATS.md)\n- [x] Metadata support: text comments, EXIF, ICC profiles\n- [x] Access to image properties without decoding pixels (probing)\n- [x] Access to source image properties (source encoding, etc.)\n- [x] Preserve original pixel formats when saving\n- [x] Extensible codec architecture demonstrated by Intel \\[[*](#intel)\\]\n\n\u003ca id=\"intel\"\u003e\u003c/a\u003e\n\n\\* One day Intel demonstrated the advantages of their [IPP](https://wikipedia.org/wiki/Integrated_Performance_Primitives) technology in speeding up decoding\n[JPEG](https://web.archive.org/web/20091009223918/http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-for-linux-optimizing-jpeg-coding-in-the-ksquirrel-application-with-intel-ipp)\nand\n[JPEG 2000](https://web.archive.org/web/20091009224048/http://software.intel.com/en-us/articles/performance-tools-for-software-developers-application-notes-intel-ipp-jpeg2000-and-jasper-in-ksquirrel)\nimages with the help of [ksquirrel-libs](FAQ.md#how-old-is-sail), the predecessor of SAIL.\n\n## 20+ image formats\n\n| Image format                                                        | Operations    | Dependencies      |\n| --------------------------------------------------------------------| ------------- | ----------------- |\n| [APNG](https://wikipedia.org/wiki/APNG)                             | RW            | libpng+APNG patch |\n| [AVIF](https://wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) | RW            | libavif           |\n| [GIF](https://wikipedia.org/wiki/GIF)                               | RW            | giflib            |\n| [HEIF](https://wikipedia.org/wiki/High_Efficiency_Image_File_Format)| RW            | libheif, libheif-plugin-x265 |\n| [JPEG](https://wikipedia.org/wiki/JPEG)                             | RW            | libjpeg-turbo     |\n| [JPEG 2000](https://wikipedia.org/wiki/JPEG_2000)                   | RW            | openjpeg          |\n| [JPEG XL](https://wikipedia.org/wiki/JPEG_XL)                       | RW            | libjxl            |\n| [PNG](https://wikipedia.org/wiki/Portable_Network_Graphics)         | RW            | libpng            |\n| [PSD](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format)    | R             |                   |\n| [SVG](https://wikipedia.org/wiki/Scalable_Vector_Graphics)          | R             | resvg/nanosvg     |\n| [TGA](https://wikipedia.org/wiki/Truevision_TGA)                    | RW            |                   |\n| [TIFF](https://wikipedia.org/wiki/TIFF)                             | RW            | libtiff           |\n| [WEBP](https://wikipedia.org/wiki/WebP)                             | RW            | libwebp           |\n| ...                                                                 |               |                   |\n\nSee the full list [here](FORMATS.md). Work to add more image formats is ongoing.\n\n## Benchmarks\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"BENCHMARKS.md\"\u003e\u003cimg src=\".github/benchmarks/JPEG-YCbCr-6000x4016.png?raw=true\" alt=\"Benchmark\" width=\"500px\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nTime to load and output default pixels (without explicit conversion) was measured. See [BENCHMARKS](BENCHMARKS.md).\n\n## Preferred installation method\n\n- **Python:** [PyPI](https://pypi.org/project/sailpy/) - `pip install sailpy`\n- **Windows:** [Conan](https://conan.io/center/recipes/sail), `vcpkg`\n- **macOS:** [brew](https://formulae.brew.sh/formula/libsail), [Conan](https://conan.io/center/recipes/sail), `vcpkg`\n- **Linux:** native packages if available, [Conan](https://conan.io/center/recipes/sail), `vcpkg`\n\nSee [BUILDING](BUILDING.md).\n\n## APIs overview\n\nSAIL provides four levels of APIs, depending on your needs. Let's have a quick look at the `junior` level.\n\n#### C:\n```C\nstruct sail_image *image;\n\nSAIL_TRY(sail_load_from_file(path, \u0026image));\n\n/*\n * Handle the image pixels here.\n * Use image-\u003ewidth, image-\u003eheight, image-\u003ebytes_per_line,\n * image-\u003epixel_format, and image-\u003epixels for that.\n *\n * In particular, you can convert it to a different pixel format with functions\n * from libsail-manip. With sail_convert_image(), for example.\n */\n\nsail_destroy_image(image);\n```\n\n#### C++:\n```C++\nsail::image image(path);\n\n// Handle the image and its pixels here.\n// Use image.width(), image.height(), image.bytes_per_line(),\n// image.pixel_format(), and image.pixels() for that.\n//\n// In particular, you can convert it to a different pixel format with image::convert().\n```\n\n#### Python:\n```python\nimport sailpy\n\nimage = sailpy.Image.from_file(path)\n\n# Handle the image and its pixels here.\n# Use image.width, image.height, image.bytes_per_line,\n# image.pixel_format, and image.to_numpy() for that.\n#\n# In particular, you can convert it to a different pixel format with image.convert().\n\n# View documentation\n# python -m sailpy --readme\n\n# Run image viewer example\n# pip install PySide6\n# python -m sailpy.examples.12_image_viewer\n```\n\nSee also [FAQ](FAQ.md) for more information.\n\n## Programming languages\n\n**Programming language:** C11\u003cbr/\u003e\n**Bindings:** C++11, Python 3.10+\n\n## Competitors\n\n- [FreeImage](https://freeimage.sourceforge.io)\n- [DevIL](http://openil.sourceforge.net)\n- [SDL_Image](https://www.libsdl.org/projects/SDL_image)\n- [stb_image](https://github.com/nothings/stb)\n- [Boost.GIL](https://www.boost.org/doc/libs/1_68_0/libs/gil/doc/html/index.html)\n- [gdk-pixbuf](https://developer.gnome.org/gdk-pixbuf)\n- [imlib2](https://docs.enlightenment.org/api/imlib2/html)\n- [CImg](https://github.com/dtschump/CImg)\n- [WIC (Windows only)](https://docs.microsoft.com/en-us/windows/win32/wic/-wic-about-windows-imaging-codec)\n\n## Differences from other image decoding libraries\n\n- Easily extensible with new image format plugins\n- Intuitive API with well-defined abstractions: images, palettes, pixels, etc.\n- Access to source pixel data (supported by most codecs)\n- Access to image properties without decoding pixel data (probing)\n\n## Have questions or issues?\n\nOpening a GitHub [issue](https://github.com/HappySeaFox/sail/issues) is the preferred method\nfor communication and problem resolution.\n\nSee [FAQ](FAQ.md) for more information.\n\n## Architecture overview\n\nSAIL is written in pure C11 without using any third-party libraries (except for codecs). It also provides\nbindings to C++ and Python.\n\n### SAIL codecs\n\nSAIL codecs represent the lowest level. This is a set of standalone, dynamically loaded codecs (SO on Linux\nand DLL on Windows). They implement the actual decoding and encoding capabilities. End users never work with\ncodecs directly; they always use the abstract, high-level APIs in `libsail`.\n\nEvery codec is accompanied by a codec info (description) file, which is a plain text file.\nIt describes the codec's capabilities: supported pixel formats for loading and output, compression types,\nand more.\n\nBy default, SAIL loads codecs on demand. To preload them, use `sail_init_with_flags(SAIL_FLAG_PRELOAD_CODECS)`.\n\n### libsail-common\n\nlibsail-common holds common data types (images, pixel formats, I/O abstractions etc.) and a small set\nof functions shared between SAIL codecs and the high-level APIs in `libsail`.\n\n### libsail\n\nlibsail is a feature-rich, high-level API. It provides comprehensive and lightweight interfaces for decoding\nand encoding images. End users implementing C applications work with libsail.\n\n### libsail-manip\n\nlibsail-manip is a collection of image manipulation functions, such as pixel format conversion.\n\n### libsail-c++\n\nlibsail-c++ is a C++ binding to libsail. End users implementing C++ applications may choose\nbetween libsail and libsail-c++. Using libsail-c++ is recommended for C++ applications due to its\nsimplified interface.\n\n## Building\n\nSee [BUILDING](BUILDING.md).\n\n## Philosophy\n\nSAIL's philosophy is modularization and simplicity.\n\nImage codecs are designed as standalone dynamically loaded files. Future improvements\nwill be implemented as separate libraries, allowing users to choose which components to use (i.e., link against)\nand which to exclude.\n\n## Support\n\nIf you like the project, please consider starring the repository.\n\n## Author\n\nDzmitry Baryshau\n\n## License\n\nReleased under the MIT license.\n\n```\nCopyright (c) 2020-2025 Dmitry Baryshev\n\nThe MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappyseafox%2Fsail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappyseafox%2Fsail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappyseafox%2Fsail/lists"}