{"id":3521,"url":"https://github.com/ragnraok/android-image-filter","last_synced_at":"2025-04-05T09:06:21.810Z","repository":{"id":2658025,"uuid":"3648889","full_name":"ragnraok/android-image-filter","owner":"ragnraok","description":"some android image filters","archived":false,"fork":false,"pushed_at":"2016-05-29T16:57:50.000Z","size":5647,"stargazers_count":656,"open_issues_count":13,"forks_count":173,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-29T08:05:51.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ragnraok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-07T12:36:34.000Z","updated_at":"2025-02-10T05:33:34.000Z","dependencies_parsed_at":"2022-09-01T09:02:45.194Z","dependency_job_id":null,"html_url":"https://github.com/ragnraok/android-image-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragnraok%2Fandroid-image-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragnraok%2Fandroid-image-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragnraok%2Fandroid-image-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragnraok%2Fandroid-image-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ragnraok","download_url":"https://codeload.github.com/ragnraok/android-image-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312077,"owners_count":20918344,"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":"2024-01-05T20:16:43.869Z","updated_at":"2025-04-05T09:06:21.764Z","avatar_url":"https://github.com/ragnraok.png","language":"C++","readme":"android-image-filter\n====================\n\nsome android image filters\n\nin some filter, I use NDK to implement to make it more efficient\n\n# Setup\n\n- Install Android NDK and properly configure it: [http://goo.gl/koTCb](http://goo.gl/koTCb)\n- Get a clean clone of this project, import the library in Android Studio\n- then Clean and Build the hold project to regenerate the library\n- Then just add library module as a dependency to your existing project.\n\n# How to Use it\nIt is dead simple, you can see magic in the following code:\n\n```Java\n  Bitmap newBitmap = BitmapFilter.changeStyle(originBitmap, BitmapFilter.BLUR_STYLE);\n  imageView.setImageBitmap(newBitmap);        \n```\n\nand there are some options for the filter, you can go to see the demo to see how to use this options to customize your filter effect\n\nYou can see all filters in file [BitmapFilter.java][3], currently contains totally 19 kinds of filters now, here is the list of filters and their options(show by code):\n\n* Grayscale\n* Relief\n* Blur(Average Smooth)\n\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.BLUR_STYLE, maskSize);\n\t```\n\t\n``maskSize`` is a integer, to indicate the average blur mask's size\n\t\n* Oil Painting\n* Neon\n\t\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.NEON_STYLE, \n\tneon_color_R, neon_color_G, neon_color_B);\t\n\t```\n\n``neon_color_R``, ``neon_color_G``, ``neon_color_B`` are the R,G,B component are integer\t\n\t\n* Pixelate\n\t\n\t```Java \n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.PIXELATE_STYLE, pixelSize);\n\t```\n\t\n``pixelSize`` is a integer, the pixel size for this filter\n\t\n* Old TV\n* Invert Color\n* Block\n* Old Photo\n* Sharpen(By Laplacian)\n* Light\n\t\n\t```Java \n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.LIGHT_STYLE, light_center_x, light_center_y, light_radius);\n\t```\n\t\n``light_center_x``, ``light_center_y`` are integer, indicate the center of the light spot, the origin in the left-upper side, and the ``light_radius`` is indicate the radius of light spot, in pixel\n\n* Lomo\n\t\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.LOMO_STYLE, roundRadius);\n\t```\n\n``roundRadius`` is a double, the black round's radius in the effect\t\n\n* HDR\n* Gaussian Blur\n\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.GAUSSIAN_BLUR_STYLE, sigma);\n\t```\n\t\n\t``sigma`` is a double, the sigma value in Gaussian Blur, the bigger of sigma, the smoother in the result image\n\n* Soft Glow\n\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.SOFT_GLOW_STYLE, sigma);\n\t```\n\t\n\t``sigma`` is a double, the same as ``sigma`` in Gaussian Blur, indicate the sigma value in the process of Gaussian Blur for Soft Glow\n\n* Sketch\n* Motion Blur\n\n\t```Java\n\tBitmapFilter.changeStyle(originBitmap, BitmapFilter.SOFT_GLOW_STYLE, xSpeed, ySpeed);\n\t```\n\t``xSpeed`` and ``ySpeed`` are both integer, indicate the speed in x-axis and y-axis, the origin in the left-upper side\n\n* Gotham\n\nPS: all options have defalut values, so you can just select the effect and pass nothing, like this:\n\n```Java\nBitmapFilter.changeStyle(originBitmap, BitmapFilter.MOTION_BLUR_STYLE);\n```\n\n\nIf you have any question, please open an [issue][4] and show your code and the program ouput, thanks!\n\n ![][2]\n \n# The MIT License (MIT)\n\nCopyright (c) \\\u003c2012-2016\\\u003e  \\\u003cragnarok okone1288@gmail.com\\\u003e\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\nall copies 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\nTHE SOFTWARE.\n\n[1]: http://1drv.ms/1i10uuX\n[2]: screenshot/img1.png\n[3]: library/src/cn/Ragnarok/BitmapFilter.java\n[4]: https://github.com/ragnraok/android-image-filter/issues?state=open\n\n","funding_links":[],"categories":["Libraries","etc","库"],"sub_categories":["GUI","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#images)图片"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragnraok%2Fandroid-image-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fragnraok%2Fandroid-image-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragnraok%2Fandroid-image-filter/lists"}