{"id":17013629,"url":"https://github.com/unascribed/jxljxl","last_synced_at":"2025-04-22T11:48:08.159Z","repository":{"id":184790456,"uuid":"672172044","full_name":"unascribed/JXLJXL","owner":"unascribed","description":"Java Xtreme Library for JPEG-XL — a fluent and convenient frontend to all of libjxl's features","archived":false,"fork":false,"pushed_at":"2023-09-13T17:35:37.000Z","size":355,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-03-29T14:51:08.812Z","etag":null,"topics":["java","jpeg-xl","jxl","panama"],"latest_commit_sha":null,"homepage":"","language":"Java","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/unascribed.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}},"created_at":"2023-07-29T06:48:54.000Z","updated_at":"2025-02-28T19:09:45.000Z","dependencies_parsed_at":"2023-07-30T10:01:34.952Z","dependency_job_id":null,"html_url":"https://github.com/unascribed/JXLJXL","commit_stats":null,"previous_names":["unascribed/jxljxl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unascribed%2FJXLJXL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unascribed%2FJXLJXL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unascribed%2FJXLJXL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unascribed%2FJXLJXL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unascribed","download_url":"https://codeload.github.com/unascribed/JXLJXL/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237793,"owners_count":21397399,"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":["java","jpeg-xl","jxl","panama"],"created_at":"2024-10-14T06:13:49.544Z","updated_at":"2025-04-22T11:48:08.129Z","avatar_url":"https://github.com/unascribed.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"logo.svg\" align=\"right\" width=\"180px\" height=\"180px\"\u003e\n\n# JXLJXL\n**Warning**: JXLJXL is not complete. Currently, it only offers an encode API and has not been\nthoroughly tested. It has encoded multiple files successfully, and v0.1 of it powers the JXL support\nin [Visage](https://visage.surgeplay.com).\n\n*The GitHub copy of this repository is a mirror. The authoritative copy is hosted on [Forgejo](https://git.sleeping.town/unascribed/JXLJXL)*\n\nJXLJXL (jjxl or jxl^2 for short, the **J**ava **X**treme **L**ibrary for **J**PEG-**XL**) is a Java\nlibrary for low-level access to the libjxl encode/decode APIs. JXLJXL allows you to create JXL\nfiles will all sorts of interesting topologies, with full support for multi-frame files, custom\nboxes, extra channels, and names for both frames and channels.\n\nThe API is designed to feel nice to use within Java, having a fluent interface that resembles the\nbuilder pattern. This design allows it to flex all the way from simple one-shot encoding of regular\nfiles to building all manner of complex payloads.\n\n\u003c!--The decode API is similarly capable of returning individual frames and returning extra channels, but\ncan just as easily also be used to decode bog-standard fully-composited RGBA images.--\u003e\n\nThe heart of the library is jxlpanama, a simple binding to libjxl via Project Panama, generated with\njextract. These bindings are… thorny, to say the least. Using a C adaptation of a C++ API from Java\nisn't pretty. JXLJXL paves over the raw bindings, making advanced JXL use cases a breeze.\n\nJXLJXL is designed for advanced use cases. If you don't need to handle encoding and have very simple\nneeds for decoding, the [jxlatte](https://github.com/Traneptora/jxlatte) project is a pure Java\nimplementation of a simple JXL decoder that I recommend using instead.\n\n## Usage\n\nJXLJXL is a modern Java 20 library that uses a preview feature — Project Panama, specifically the\nForeign Linker API, a modern and fast replacement for JNI. So, while including the dependency is as\neasy as usual:\n\n```gradle\nrepositories {\n\tmaven {\n\t\turl 'https://repo.sleeping.town'\n\t\tcontent.includeGroup 'com.unascribed'\n\t}\n}\n\ndependencies {\n\timplementation 'com.unascribed:jxljxl:0.2.1'\n}\n```\n\n…you will also need to add these options to your Java invocation, in order to enable the Panama API\nand give JXLJXL permission to invoke native code:\n\n`--enable-preview --enable-native-access=com.unascribed.jxljxl`\n\nIf your project is not modular, then you will need this instead:\n\n`--enable-preview --enable-native-access=ALL-UNNAMED`\n\nJXLJXL does not currently bundle a copy of libjxl — that needs to be available on the target system.\nBundled libraries will be added later.\n\n## API\n\nThe primary entrypoint to the encoding API is `JXLEncoder`, which can be used something like so:\n\n```java\nJXLEncoder.create()\n\t.size(width, height)\n\t.bitsPerSample(8)\n\t.numChannels(3, 1)\n\t.colorEncoding(JXLPredefinedColorEncoding.SRGB)\n\t.newFrame()\n\t\t.distance(1.5f)\n\t\t.withModularEncoding()\n\t\t\t.lossyPalette(true)\n\t\t\t.done()\n\t\t.brotliEffort(3)\n\t\t.effort(1)\n\t\t.keepInvisible(false)\n\t\t.commit(bufferedImage)\n\t.encodeToStream(out);\n```\n\nAll the documentation from libjxl, plus some extras, are included as javadocs in the library. Take\na look around!\n\nAll operations are buffered in memory until the `encode` call is made, so the order isn't\nparticularly important. JXLJXL handles calling everything in the right order and making sense of the\nmess.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funascribed%2Fjxljxl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funascribed%2Fjxljxl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funascribed%2Fjxljxl/lists"}