{"id":17255323,"url":"https://github.com/crozone/blursharp","last_synced_at":"2025-04-14T05:41:44.168Z","repository":{"id":88314172,"uuid":"242020606","full_name":"crozone/BlurSharp","owner":"crozone","description":"Blurhash implementation for C#","archived":false,"fork":false,"pushed_at":"2020-03-16T07:24:23.000Z","size":1316,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T19:39:39.925Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crozone.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":"2020-02-21T00:28:56.000Z","updated_at":"2023-08-25T12:20:15.000Z","dependencies_parsed_at":"2023-03-13T18:25:20.012Z","dependency_job_id":null,"html_url":"https://github.com/crozone/BlurSharp","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/crozone%2FBlurSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crozone%2FBlurSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crozone%2FBlurSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crozone%2FBlurSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crozone","download_url":"https://codeload.github.com/crozone/BlurSharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830424,"owners_count":21168272,"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-10-15T07:11:18.686Z","updated_at":"2025-04-14T05:41:44.144Z","avatar_url":"https://github.com/crozone.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlurSharp\nBlurhash implementation for C#\n\n## Progress report\n\nWhat is done:\n\n* BlurHash core encoder\n* Encoder wrapper for `System.Drawing`\n* Encoder tests for a set of testing images, using all possible component values.\n\nWhat is TODO:\n\n* Decoder\n* Decoder wrapper for `System.Drawing`\n* Decoder tests\n\n## Performance\n\n### Results\n\nCurrently, this implementation is ~25x faster than the reference C implementation.\n\nOn my reference machine, BlurSharp (Release) can encode all six reference images in 1,1 to 8,8 component forms (64 combinations per image) in under 5 seconds. The C implementation (compiled with -O2) does the same in 125 seconds.\n\n### How\n\nThe library has been written with the `System.Numerics` vector instructions, specifically `Vector3` is used heavily to speed up operations. A precalculated lookup table is used to do SRGB to Linear float conversions.\n\n`Span\u003cT\u003e` is also used extensively in order to reduce object allocations and unnecessary copying of buffers.\n\nFor example, `Span\u003cT\u003e` allows for the encoding of `System.Drawing` bitmaps without copying the image buffer. Further work needs to be done to allow core support for different pixel formats, so that `Bitmap.LockBits` doesn't have to do work internally to present the image as `PixelFormat.Format24bppRgb`.\n\nThe library also leverages the new `Span\u003cT\u003e` based safe `stackalloc` keyword to avoid heap allocations. Depending on how much stack you allow the encoder to use, an image can be encoded without a single object allocation. This can reduce GC pressure under heavy workloads.\n\nPerformance TODO:\n\n* Potentially use parallel processing (questionable benefit for web scenarios)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrozone%2Fblursharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrozone%2Fblursharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrozone%2Fblursharp/lists"}