Blurhash.SkiaSharp 2.0.0

dotnet add package Blurhash.SkiaSharp --version 2.0.0                
NuGet\Install-Package Blurhash.SkiaSharp -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blurhash.SkiaSharp" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blurhash.SkiaSharp --version 2.0.0                
#r "nuget: Blurhash.SkiaSharp, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Blurhash.SkiaSharp as a Cake Addin
#addin nuget:?package=Blurhash.SkiaSharp&version=2.0.0

// Install Blurhash.SkiaSharp as a Cake Tool
#tool nuget:?package=Blurhash.SkiaSharp&version=2.0.0                

Blurhash.SkiaSharp

NuGet

Build Status

A Blurhash implementation based on blurhash.net for SkiaSharp, thus fully available for Xamarin and other .NET Standard 2.0 platforms.

Currently allows to decode a blurhash into SKBitmap or encode a SKBitmap into Blurhash string.

Several portions of the code are directly copy-pasted from the System.Drawing implementation.

Tested on Xamarin.Forms on UWP, iOS and Android.

Example usage

Displaying a placeholder for an image in Xamarin.Forms Image control

// decode blurhash instring into a SKBitmap
var im = Blurhash.SkiaSharp.Blurhasher.Decode("LEHV6nWB2yk8pyo0adR*.7kCMdnj", 219, 176);

// load it into a SKImage
var data = SKImage.FromBitmap(im).Encode();

// use as a source for Image control
image1.Source = ImageSource.FromStream(data.AsStream);

Encoding an resource image into a Blurhash string

// get the image from resources
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TestMobileApp.noah.jpg");

// load to SKImage and to Image control
var img = SKImage.FromEncodedData(stream);
image1.Source = ImageSource.FromFile("noah.jpg");

// create SKBitmap from Image and create a blurhash for it
var hash = Blurhash.SkiaSharp.Blurhasher.Encode(SKBitmap.FromImage(img), 4, 3);

// and show it in a Editor control
editor1.Text = hash;

Example of Xamarin.Forms image with Blurhash switching to loaded image

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Blurhash.SkiaSharp:

Package Downloads
Blurhash.Microsoft.Extensions.SkiaSharp

Bridge library to use Blurhash with SkiaSharp and ServiceExtensions

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Blurhash.SkiaSharp:

Repository Stars
zoriya/Kyoo
A portable and vast media library solution.
Version Downloads Last updated
2.0.0 14,323 5/24/2022
1.0.0 1,133 5/7/2020