{"id":15131538,"url":"https://github.com/camerakit/blurkit-android","last_synced_at":"2025-05-14T07:08:29.384Z","repository":{"id":47796437,"uuid":"72967236","full_name":"CameraKit/blurkit-android","owner":"CameraKit","description":"The missing Android blurring library. Fast blur-behind layout that parallels iOS.","archived":false,"fork":false,"pushed_at":"2021-04-03T23:18:57.000Z","size":6270,"stargazers_count":3749,"open_issues_count":36,"forks_count":313,"subscribers_count":74,"default_branch":"master","last_synced_at":"2025-05-13T02:04:38.378Z","etag":null,"topics":["android","android-library","blurkit-android","blurring-libraries","java"],"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/CameraKit.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}},"created_at":"2016-11-06T03:14:58.000Z","updated_at":"2025-05-10T15:15:50.000Z","dependencies_parsed_at":"2022-09-03T10:00:49.632Z","dependency_job_id":null,"html_url":"https://github.com/CameraKit/blurkit-android","commit_stats":null,"previous_names":["wonderkiln/blurkit-android"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameraKit%2Fblurkit-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameraKit%2Fblurkit-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameraKit%2Fblurkit-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameraKit%2Fblurkit-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CameraKit","download_url":"https://codeload.github.com/CameraKit/blurkit-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092775,"owners_count":22013290,"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":["android","android-library","blurkit-android","blurring-libraries","java"],"created_at":"2024-09-26T03:43:05.415Z","updated_at":"2025-05-14T07:08:29.347Z","avatar_url":"https://github.com/CameraKit.png","language":"Java","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt='BlurKit Header' src='.repo/bk-gh-readme-header.svg' /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://spectrum.chat/camerakit/blurkit/\"\u003e\n        \u003cimg alt=\"Join Spectrum\" height=\"42px\" src=\".repo/bk-gh-readme-spectrum-button.svg\" \u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://buddy.works/\" target=\"_blank\"\u003e\n        \u003cimg alt='Buddy.Works' height=\"41px\" src='https://assets.buddy.works/automated-dark.svg'/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## What Is BlurKit?\nBlurKit is an extraordinarily easy to use and performant utility to render real time blur effects in Android.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt='BlurKit Demo' src='.repo/bk-demo.gif' /\u003e\n\u003c/p\u003e\n\n## Perfomance\n\nBlurKit is faster than other blurring libraries due to a number of bitmap retrieval and drawing optimizations. We've been logging benchmarks for the basic high-intensity tasks for a 300dp x 100dp BlurView:\n\n| Task                      | BlurKit time       | Avg. time without BlurKit |\n| --------------------------| -------------------| -----------------------   |\n| Retrieve source bitmap    | 1-2 ms             | 8-25 ms                   |\n| Blur and draw to BlurView | 1-2 ms             | 10-50ms                   |\n\nThis results in an average work/frame time of 2-4ms, which will be a seamless experience for most users and apps.\n\n## Setup\nAdd __BlurKit__ to the dependencies block of the app level `build.gradle`:\n```groovy\ndependencies {\n    implementation 'io.alterac.blurkit:blurkit:1.1.0'\n}\n```\n\n## Usage\n### BlurLayout\nAdd a `BlurLayout` to your XML layout just like any other view.\n\n```xml\n\u003cio.alterac.blurkit.BlurLayout\n    android:id=\"@+id/blurLayout\"\n    android:layout_width=\"150dp\"\n    android:layout_height=\"150dp\"/\u003e\n```\nIn the `Main_Activity.java` you need to override the `onStart()` and `onStop()` methods to include the `BlurLayout` functionality.\n```java\nBlurLayout blurLayout;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.activity_main);\n    blurLayout = findViewById(R.id.blurLayout);\n}\n\n@Override\nprotected void onStart() {\n    super.onStart();\n    blurLayout.startBlur();\n}\n\n@Override\nprotected void onStop() {\n    blurLayout.pauseBlur();\n    super.onStop();\n}\n```\n\nThe layout background will continuously blur the content behind it. If you know your background content will be somewhat static, you can set the layout `fps` to `0`. At any time you can re-blur the background content by calling `invalidate()` on the `BlurLayout`. \n\n```xml\n\u003cio.alterac.blurkit.BlurLayout\n    android:id=\"@+id/blurLayout\"\n    android:layout_width=\"150dp\"\n    android:layout_height=\"150dp\"\n    blurkit:blk_fps=\"0\" /\u003e\n```\n\nOther attributes you can configure are the blur radius and the downscale factor. Getting these to work together well can take some experimentation. The downscale factor is a performance optimization; the bitmap for the background content will be downsized by this factor before being drawn and blurred.\n\n```xml\n\u003cio.alterac.blurkit.BlurLayout\n    android:id=\"@+id/blurLayout\"\n    android:layout_width=\"150dp\"\n    android:layout_height=\"150dp\"\n    blurkit:blk_blurRadius=\"12\"\n    blurkit:blk_downscaleFactor=\"0.12\"\n    blurkit:blk_fps=\"60\" /\u003e\n```\n\n### Creating BlurKit Outside Of A Layout\nYou can use the `BlurKit` class which has a few useful blurring utilities. Before using this class outside of a `BlurLayout`, you need to initialize `BlurKit`.\n\n```java\npublic class MyApplication extends Application {\n    @Override\n    public void onCreate() {\n        BlurKit.init(this);\n    }\n}\n```\n\nYou can blur a `View`, or a `Bitmap` directly.\n\n```java\n// View\nBlurKit.getInstance().blur(View src, int radius);\n\n// Bitmap\nBlurKit.getInstance().blur(Bitmap src, int radius);\n```\n\nYou can also __fastBlur__ a `View`. This optimizes the view blurring process by allocating a downsized bitmap and using a `Matrix` with the bitmaps `Canvas` to prescale the drawing of the view to the bitmap.\n\n```java\nBlurKit.getInstance().fastBlur(View src, int radius, float downscaleFactor);\n```\n\n\n\n## Upcoming Features\n- [ ] `SurfaceView` support\n- [ ] Support for use outside of an `Activity` (dialogs, etc.)\n- [ ] Enhance retrieval of background content to only include views drawn behind the `BlurLayout`.\n\n## License\nBlurKit is [MIT licensed](https://github.com/CameraKit/blurkit-android/blob/master/LICENSE).\n\n---\n Blurkit is a sister project of [CameraKit](https://github.com/CameraKit/camerakit-android) and maintained by the CameraKit team.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamerakit%2Fblurkit-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamerakit%2Fblurkit-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamerakit%2Fblurkit-android/lists"}