SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

[BUG] Rendering issue with Rgb888x image

Open dbriard opened this issue 1 year ago • 2 comments

Description

Hi, I wanted to try Rgb888x format instead of Rgba8888 or Bgra8888, but it do not work as expected.

SKImage.FromBitmap(_bitmap) with Rgba8888 work fine, but SKImage.FromBitmap(_bitmap.Copy(SKColorType.Rgb888x)) give the following result when I DrawImage.

image

Is it a know but, may be there is a value issue with the enum Rgb888x when converting to image???

Code

The best way to share code for larger projects is a link to a GitHub repository: https://github.com/user/repo/tree/bug-123

But, you can also share a short block of code here:

SKImage.FromBitmap(_bitmap.Copy(SKColorType.Rgb888x)

You can also share some XAML:

<!-- xaml code here -->

Expected Behavior

No response

Actual Behavior

No response

Version of SkiaSharp

2.88.3 (Current)

Last Known Good Version of SkiaSharp

2.88.2 (Previous)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

All

Platform / Operating System Version

No response

Devices

No response

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

dbriard avatar Nov 14 '23 08:11 dbriard

Are there any estimated timelines for addressing this issue? We are a vendor of .NET MAUI components (DevExpress), and our PdfViewer control relies on SkiaSharp for image rendering. We've received reports from multiple customers encountering this bug, and it's impacting their experience.

@mattleibow apologies for the ping, but your expertise would be invaluable here. Perhaps you have some information or insights regarding the issue. Thank you!

Alexgoon avatar Jan 25 '24 13:01 Alexgoon

Converting Rgba8888 to Rgbx8888 produces the same memory layout so all you need to do is a memory copy in combination with some bit operation that sets the last bits of a pixel to 1

Gillibald avatar Jan 25 '24 13:01 Gillibald