{"id":19633966,"url":"https://github.com/bilibili/burstlinker","last_synced_at":"2025-04-28T07:31:05.291Z","repository":{"id":67622847,"uuid":"147280084","full_name":"bilibili/BurstLinker","owner":"bilibili","description":"🚀 A simple GIF encoder for Android.","archived":false,"fork":false,"pushed_at":"2019-10-30T09:38:23.000Z","size":4719,"stargazers_count":142,"open_issues_count":6,"forks_count":41,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-05T07:33:08.799Z","etag":null,"topics":["cplusplus","gif","gifencoder","renderscript"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bilibili.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-04T02:56:23.000Z","updated_at":"2024-12-20T06:47:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"59793458-a6ff-4c17-92a6-09fb9d31b806","html_url":"https://github.com/bilibili/BurstLinker","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/bilibili%2FBurstLinker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2FBurstLinker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2FBurstLinker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilibili%2FBurstLinker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilibili","download_url":"https://codeload.github.com/bilibili/BurstLinker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251271107,"owners_count":21562492,"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":["cplusplus","gif","gifencoder","renderscript"],"created_at":"2024-11-11T12:19:12.941Z","updated_at":"2025-04-28T07:31:05.286Z","avatar_url":"https://github.com/bilibili.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BurstLinker\n\n [ ![Download](https://api.bintray.com/packages/succlz123/maven/burst-linker/images/download.svg) ](https://bintray.com/succlz123/maven/burst-linker/_latestVersion)\n\nIdea from: [square/gifencoder](https://github.com/square/gifencoder)\n\nBurstLinker is a simple C++ GIF encode library.\n\n## Download\n\n### Android\n\nGradle:\n\n```\nimplementation 'com.bilibili:burst-linker:latest-version'\n```\n\n#### Build Environment\n\nAndroid Studio 3.4.1\n\nNDK r20\n\n#### Basic usage\n\n``` java\nint delayMs = 1000;\nString filePath = getCacheDir() + File.separator + \"out.gif\";\nBurstLinker burstLinker = new BurstLinker();\n\ntry {\n    burstLinker.init(width, height, filePath);\n    Bitmap colorBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n    Canvas canvas = new Canvas(colorBitmap);\n    Paint p = new Paint();\n    int[] colors = new int[]{0xFFF00000, 0xFFFFFF00, 0xFFFFFFFF};\n    for (int color : colors) {\n        p.setColor(color);\n        canvas.drawRect(0, 0, width, height, p);\n        burstLinker.connect(colorBitmap, BurstLinker.OCTREE_QUANTIZER, \n                BurstLinker.NO_DITHER, 0, 0, delayMs);\n    }\n} catch (GifEncodeException e) {\n    e.printStackTrace();\n} finally {\n    burstLinker.release();\n}\n```\n\n#### Enable RenderScript Support\n\n\u003e This is an untested feature.\n\n1. Choose the Git branch \"/feature/render-script\".\n2. Sync Project with Gradle Files, It will generate the required file named \"ScriptC_*.cpp\".\n3. Uncomment the line 64 of the \"/lib/CMakeLists.txt\".\n4. Try this function.\n\n### Linux \u0026 Mac\n\n1. Install [CMake](http://www.cmake.org/)\n   - Mac  `brew install cmake`   \n   - ArchLinux `sudo pacman -S cmake`\n\n2. Build\n   - `cd /BurstLinker`\n   - `mkdir cmake-build-debug; cd cmake-build-debug`\n   - `cmake ..`\n   - `make BurstLinker`\n\n3. Run\n   - `./BurstLinker 1000 1.jpg 2.jpg 3.jpg` \n   - See the \"out.gif\"\n\n### Windows\n\n1. Install [Microsoft Visual Studio](https://www.visualstudio.com/) \u0026 [CMake](http://www.cmake.org/)\n\n2. Build\n   - `cd /BurstLinker`\n   - `mkdir cmake-build-debug; cd cmake-build-debug`\n   - `cmake ..`\n   - Open the \"BurstLinker.sln\"\n   - Solution Explorer -\u003e BurstLinker -\u003e Build\n\n3. Run\n   - `cd Debug`\n   - `BurstLinker.exe 1000 1.jpg 2.jpg 3.jpg` \n   - See the \"out.gif\"\n\n## Samples\n\n### Different quantizers \u0026 ditherers\n\n- Original\n\n![original](screenshot/lenna-original.png)\n\n- Uniform + No\n\n![uniform](screenshot/uniform.gif)\n\n- MedianCut + No\n\n![media-cut](screenshot/media-cut.gif)\n\n- KMeans + No\n\n![k-means](screenshot/k-means.gif)\n\n- Random + No\n\n![random](screenshot/random.gif)\n\n- Octree + No\n\n![octree](screenshot/octree.gif)\n\n- NeuQuant - 10 + No\n\n![neu-quant-10](screenshot/neu-quant-10.gif)\n\n- NeuQuant - 1 + No\n\n![neu-quant-1](screenshot/neu-quant-1.gif)\n\n- Octree + M2\n\n![uniform](screenshot/octree-m2.gif)\n\n- Octree + Bayer\n\n![octree-bayer](screenshot/octree-bayer.gif) \n\n- Octree + FloydSteinberg\n\n![octree-floyd-steinberg](screenshot/octree-floyd-steinberg.gif)\n\n### Encodes images with transparent channels\n\n- Original\n\n![bilibili](screenshot/bilibili.png)\n\n- Octree + No + Default\n\n  Display all Alpha channels greater than 0. (ARGB.a != 0)\n\n![bilibili-octree](screenshot/bilibili-octree-default.gif)\n\n- Octree + No + Ignored translucency \n\n  Display only  the Alpha channels equal to 255. (ARGB.a == 255) \n\n![bilibili-octree](screenshot/bilibili-octree-ignore.gif)\n\n## Thanks\n\n[square/gifencoder](https://github.com/square/gifencoder)\n\n[waynejo/android-ndk-gif](https://github.com/waynejo/android-ndk-gif)\n\n[lucent1090/MCCQ](https://github.com/lucent1090/MCCQ)\n\n[luxiaoxun/KMeans-GMM-HMM](https://github.com/luxiaoxun/KMeans-GMM-HMM)\n\n[SimonBoorer/Quantize](https://github.com/SimonBoorer/Quantize)\n\n[dali-neuquant](https://code.google.com/archive/p/dali-neuquant)\n\n[FFmpeg/FFmpeg](https://github.com/FFmpeg/FFmpeg)\n\n[progschj/ThreadPool](https://github.com/progschj/ThreadPool)\n\n## License\n\n```\nCopyright 2018 Bilibili\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilibili%2Fburstlinker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilibili%2Fburstlinker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilibili%2Fburstlinker/lists"}