Codenil

How to Upgrade and Explore SkiaSharp 4.0 Preview 1: A Step-by-Step Guide

Published: 2026-05-05 02:44:46 | Category: Software Tools

Introduction

For a decade, SkiaSharp has been the trusted backbone for cross-platform 2D graphics in .NET, enabling developers to render text, geometries, and images with pixel-perfect fidelity across mobile, desktop, web, and server targets using the open-source Skia engine. Now, with the release of SkiaSharp 4.0 Preview 1, a major milestone arrives, bringing over two years of upstream Skia improvements, a more modern API, and tighter integration with the .NET ecosystem. This step-by-step guide will walk you through upgrading to the preview, exploring its new features, and making the most of this release—whether you're building with .NET MAUI, WinUI 3, WebAssembly, or any .NET platform. Let's dive in.

How to Upgrade and Explore SkiaSharp 4.0 Preview 1: A Step-by-Step Guide
Source: devblogs.microsoft.com

What You Need

Before you start, ensure you have the following:

  • .NET SDK 6.0 or later (recommended: .NET 8.0 for optimal compatibility)
  • An existing .NET project that uses SkiaSharp, or a new project where you want to add graphics capabilities
  • Access to NuGet package manager (via Visual Studio, .NET CLI, or IDE of your choice)
  • Basic familiarity with SkiaSharp APIs (drawing, bitmaps, canvases)
  • A desire to test and provide feedback—your input shapes future releases!

Step-by-Step Instructions

Step 1: Install SkiaSharp 4.0 Preview 1

The first step is to update your project's SkiaSharp package to the preview version. Open your terminal or package manager console and run the following command:

dotnet add package SkiaSharp --version 4.0.0-preview.1

Alternatively, in Visual Studio's NuGet Package Manager, search for SkiaSharp, check the Include prerelease box, and select version 4.0.0-preview.1. This single package update brings the entire Skia engine upgrade and new API surface. If you use additional SkiaSharp packages (e.g., for views or native assets), update those as well to the matching preview version.

Step 2: Verify the Skia Engine Upgrade

SkiaSharp 4.0 ships with Skia milestone 147—a leap of 28 milestones and two and a half years of upstream improvements. Many enhancements work automatically without any code changes. To verify the upgrade is active, simply build and run your app. You should see:

  • Sharper downscaled images – mipmap sharpening is now enabled by default, improving image quality when scaling down.
  • Automatic photo orientation – image codecs now respect Exif rotation metadata, so photos display correctly without manual rotation.
  • Improved large image handling – oversized bitmaps automatically tile to fit GPU texture limits, preventing crashes on memory-constrained devices.
  • More accurate colors – transfer functions for Rec.709, HLG, and PQ have been corrected to match industry standards, ensuring color fidelity.

If your app uses custom rendering pipelines, check that these new behaviors don't alter expected visual output. In most cases, they improve consistency.

Step 3: Explore Key New Features

While the engine upgrade is automatic, SkiaSharp 4.0 Preview 1 also introduces several API enhancements. Here’s how to leverage them:

  1. Test incremental performance gains – Rendering operations (noise shaders, canvas operations) are modestly faster. Benchmark rendering-heavy tasks to see improvements.
  2. Check security hardening – Modern compiler mitigations are enabled across all platforms, and all bundled native dependencies have been updated with security fixes. This requires no action but is important for compliance audits.
  3. Review updated Skia engine features – Visit the official SkiaSharp documentation for a full list of new Skia APIs exposed in this release. Look for new surface properties, shader types, or codec options.

Step 4: Integrate with Uno Platform (Optional but Recommended)

Uno Platform has stepped into a co-maintainer role alongside the .NET team. If you use Uno Platform for cross-platform UI, SkiaSharp 4.0 Preview 1 works seamlessly with it. To integrate:

How to Upgrade and Explore SkiaSharp 4.0 Preview 1: A Step-by-Step Guide
Source: devblogs.microsoft.com
  • Update your Uno Platform project to the latest version that supports SkiaSharp 4.0.
  • Leverage Uno's contributions: latest Android bindings, AOT improvements, and WebAssembly support.
  • Test your app on multiple targets (mobile, WebAssembly, desktop) to validate consistent rendering.

Step 5: Provide Feedback and Stay Involved

As a preview release, your feedback is crucial. Report any issues or suggestions on the GitHub repository at github.com/mono/SkiaSharp. Also, mark your calendar for June 30—the Uno Platform's Focus on SkiaSharp online event, where the team will celebrate the release and discuss future plans.

Tips for a Smooth Experience

  • Test across platforms early – Because the Skia engine saw major changes, run your app on all intended targets (including WebAssembly and WinUI 3) to catch platform-specific regressions.
  • Use source control – Create a branch before upgrading so you can roll back if needed.
  • Check for deprecated APIs – While SkiaSharp 4.0 aims for backward compatibility, some older methods may be marked obsolete. Review compiler warnings and migrate accordingly.
  • Engage with the community – The co-maintenance by Uno Platform means faster updates. Follow their blog and the SkiaSharp repo for upcoming previews and release candidates.
  • Leverage automatic improvements – Features like mipmap sharpening and auto-rotation are free wins—no code changes needed, so enjoy the quality boost immediately.

Conclusion

SkiaSharp 4.0 Preview 1 marks a major leap forward for cross-platform .NET graphics. By following these steps, you can upgrade your projects, explore new features, and contribute to the evolution of this essential library. Whether you're building for mobile, desktop, web, or the cloud, the improvements in rendering, security, and performance will benefit your applications. Happy coding, and don't forget to share your feedback!