CommonNetFuncs.Images 3.5.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package CommonNetFuncs.Images --version 3.5.3
                    
NuGet\Install-Package CommonNetFuncs.Images -Version 3.5.3
                    
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="CommonNetFuncs.Images" Version="3.5.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommonNetFuncs.Images" Version="3.5.3" />
                    
Directory.Packages.props
<PackageReference Include="CommonNetFuncs.Images" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommonNetFuncs.Images --version 3.5.3
                    
#r "nuget: CommonNetFuncs.Images, 3.5.3"
                    
#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.
#:package CommonNetFuncs.Images@3.5.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommonNetFuncs.Images&version=3.5.3
                    
Install as a Cake Addin
#tool nuget:?package=CommonNetFuncs.Images&version=3.5.3
                    
Install as a Cake Tool

CommonNetFuncs.Images

nuget

This project contains helper methods for dealing with base64 image encoding and image optimization.

Contents


Base64

Helper methods for dealing with Base64 image encoding.

Base64 Usage Examples

<details> <summary><h3>Usage Examples</h3></summary>

ConvertImageFileToBase64

Converts an image file or stream to a Base64 string.

string base64String = ConvertImageFileToBase64(@"C:\path\to\image.jpg"); // Returns the Base64 string representation of the image file.
CleanImageValue

Attempts to clean a Base64 string by removing any metadata or unwanted characters that may come with it when reading from an HTML element.

string base64String = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
string? cleanedBase64 = CleanImageValue(base64String); // "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
ImageSaveToFile

Save a Base64 string to an image file.

string base64String = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
ImageSaveToFile(base64String, @"C:\path\to\output_image.png"); // Saves the Base64 string as an image file at the specified path.
IsValidBase64Image

Checks to see if a Base64 string is a valid image format.

string base64String = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
bool isValid = IsValidBase64Image(base64String); // true

</details>


Optimizer

Helper methods for optimizing images.

Optimizer Usage Examples

<details> <summary><h3>Usage Examples</h3></summary>

OptimizeImage

Optimizes an image by reducing its file size without sacrificing quality using gifsicle, jpegoptim, or optipng CLI tools depending on the image format.

await OptimizeImage(@"C:\path\to\input_image.jpg", @"C:\path\to\output_image.jpg"); // "C:\path\to\output_image.jpg" contains the optimized image.

</details>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.10 28 1/24/2026
4.0.9 92 1/12/2026
4.0.6 86 1/2/2026
4.0.3 174 12/22/2025
4.0.2 697 12/2/2025
4.0.1 178 11/27/2025
4.0.0 162 11/23/2025
3.8.28 86 1/5/2026
3.8.20 582 12/1/2025
3.8.18 414 11/20/2025
3.8.16 398 11/17/2025
3.8.13 267 11/10/2025
3.8.10 209 10/30/2025
3.8.4 203 10/9/2025
3.7.17 197 9/11/2025
3.7.16 202 9/11/2025
3.7.13 190 9/8/2025
3.7.10 221 8/29/2025
3.7.0 328 8/18/2025
3.6.27 192 8/18/2025
3.6.26 193 8/14/2025
3.6.25 197 8/13/2025
3.6.24 188 8/12/2025
3.6.20 167 7/30/2025
3.6.19 160 7/28/2025
3.6.18 385 7/25/2025
3.6.6 533 7/21/2025
3.6.5 196 7/16/2025
3.6.4 180 7/16/2025
3.6.3 185 7/16/2025
3.6.2 186 7/15/2025
3.6.1 183 7/14/2025
3.6.0 229 7/14/2025
3.5.3 192 7/10/2025
3.5.0 202 7/7/2025
3.4.23 191 6/26/2025
3.4.21 184 6/26/2025
3.4.20 182 6/25/2025
3.4.18 220 6/23/2025
3.4.13 317 6/13/2025
3.4.8 343 6/11/2025
3.4.2 197 6/2/2025
3.4.1 133 5/30/2025
3.4.0 199 5/30/2025
3.3.11 206 5/19/2025
3.3.10 288 5/13/2025
3.3.0 205 4/29/2025
3.2.22 232 3/12/2025
3.2.20 284 3/7/2025
3.2.15 154 2/24/2025
3.2.13 172 2/13/2025
3.2.9 152 2/4/2025
3.2.4 156 1/21/2025
3.2.0 156 12/19/2024
3.1.2 199 12/13/2024
3.1.0 184 12/6/2024
3.0.0 180 12/3/2024
2.1.3 151 12/3/2024
2.1.2 161 12/3/2024
2.1.0 161 12/2/2024
2.0.5 175 11/26/2024
2.0.3 146 11/19/2024
2.0.2 157 11/18/2024
2.0.1 157 11/15/2024
2.0.0 152 11/14/2024
1.0.47 166 11/14/2024
1.0.42 185 11/12/2024
1.0.40 169 11/12/2024
1.0.37 177 11/4/2024
1.0.31 168 10/31/2024
1.0.28 158 10/25/2024
1.0.26 213 10/18/2024
1.0.25 153 10/17/2024
1.0.24 163 10/17/2024
1.0.18 168 10/11/2024
1.0.17 186 9/27/2024
1.0.16 166 9/27/2024
1.0.14 164 9/23/2024
1.0.13 176 9/18/2024
1.0.12 174 9/18/2024
1.0.11 161 9/18/2024
1.0.10 180 9/11/2024
1.0.9 167 9/11/2024
1.0.8 190 9/11/2024
1.0.7 182 9/11/2024
1.0.1 185 9/4/2024
1.0.0 176 9/2/2024