{"id":24088114,"url":"https://github.com/time4tea/oidnjni","last_synced_at":"2025-05-05T21:41:12.399Z","repository":{"id":57737862,"uuid":"231808304","full_name":"time4tea/oidnjni","owner":"time4tea","description":"Java JNI Wrappers (Kotlin) for the Intel Open Image Denoise Library","archived":false,"fork":false,"pushed_at":"2021-04-16T17:39:55.000Z","size":5458,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T23:51:13.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/time4tea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-04T18:17:09.000Z","updated_at":"2021-02-07T03:17:00.000Z","dependencies_parsed_at":"2022-08-24T15:00:45.874Z","dependency_job_id":null,"html_url":"https://github.com/time4tea/oidnjni","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Foidnjni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Foidnjni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Foidnjni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/time4tea%2Foidnjni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/time4tea","download_url":"https://codeload.github.com/time4tea/oidnjni/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252581828,"owners_count":21771574,"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":[],"created_at":"2025-01-10T03:58:22.201Z","updated_at":"2025-05-05T21:41:12.367Z","avatar_url":"https://github.com/time4tea.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Kotlin / Java JNI Interface to Intel Open Image Denoise Library (OIDN)\n\n![Bintray](https://img.shields.io/bintray/v/time4tea/oss/oidnjni)\n![Maven Central](https://img.shields.io/maven-central/v/net.time4tea/oidnjni)\n\n## What is this?\n\nIts a Kotlin library and JNI interface to the [Intel Open Image Denoise Library](https://www.openimagedenoise.org) \n\n## Before\n\n![Example](oidnkt/src/test/resources/example-cornellbox-rendered.png)\n\n## After\n\n![Example](example-output/example-cornellbox-denoised.png)\n\n## Installing\n\nTo install, add these dependencies to your **Gradle** file:\n```groovy\ndependencies {\n    compile group: \"net.time4tea\", name: \"oidnjni\", version: \"0.1.13\"\n}\n```\n\n## How to use\n\n```kotlin\n    val oidn = Oidn()\n    val color = Oidn.allocateBuffer(image.width, image.height)\n    // put some data in the image...\n    val output = Oidn.allocateBuffer(image.width, image.height)\n\n    oidn.newDevice(Oidn.DeviceType.DEVICE_TYPE_DEFAULT).use { device -\u003e\n        device.raytraceFilter().use { filter -\u003e\n            filter.setFilterImage(\n                color, output, image.width, image.height\n            )\n            filter.commit()\n            filter.execute()\n            device.error()\n        }\n    }\n```\n\nYou can look at the `OidnTest` class for an example usage of the library.\n\nThe OIDN library requires a specific raster format, which the Java standard library supports, but does \nnot give an easy way to create. Use `OidnImages.newBufferedImage()` to create a new buffered image.\n\nSimilarly, none of the ImageIO libraries support the raster format. You'll need to create a `BufferedImage`\nin a standard format for these functions to work.\n\n```kotlin\nfun save(image: BufferedImage, file: File) {\n        val dest = BufferedImage(image.width, image.height, BufferedImage.TYPE_INT_RGB)\n        try {\n            image.copyTo(dest)\n            ImageIO.write(dest, \"PNG\", file)\n        } finally {\n            dest.flush()\n        }\n}\n```\n\n## Performance\n\nThe code is almost certainly far from optimal, no effort has gone into making it performant. However, running the filter\n will dominate the performance of the code - the JNI wrapper is very thin.\n\nProcessing the above image takes 0.35s on my laptop.\n\n## TODO\n\n- [ ] Mac / Windows - I have no hardware - contributors wanted!\n- [ ] HDR Images    - I have no use-case - contributors wanted!\n\n## Projects that use the OidnJNI library \n\nPlease let me know if your project uses or wants to use this small library\n\n- [Raytrace in a weekend Kotlin](https://github.com/time4tea/raytrace-in-a-weekend-kotlin)\n\n## Contributors\n\n[@leMaik](https://github.com/leMaik)\n\nContributors are welcome! Either for new use-cases, or new features.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftime4tea%2Foidnjni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftime4tea%2Foidnjni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftime4tea%2Foidnjni/lists"}