Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteableBitmapConverter Bitmap STATISTICS changed #1706

Open
imsulag opened this issue Sep 23, 2024 · 0 comments
Open

WriteableBitmapConverter Bitmap STATISTICS changed #1706

imsulag opened this issue Sep 23, 2024 · 0 comments

Comments

@imsulag
Copy link

imsulag commented Sep 23, 2024

Summary of your issue

i planning to Load 16bpp grayscale bitmap on windows. i successfully change mat to WriteableBitmap by using WriteableBitmapConverter method. But when i check between on original and saved bitmap in QGIS, something changed in STATISTICS.

Something changed in STATISTICS. could you explain reason, and what i have to do to fix this situation.

Environment

Write your environment.

What did you do when you faced the problem?

Write here

Example code:

string fileName = $"C:\\Users\\User\\Desktop\\grayscale\\C1_20240611014916_17892_00672307_L2G_R.tif"; // grayscale

Mat src = new Mat(fileName, ImreadModes.Unchanged); 

WriteableBitmap bmp = OpenCvSharp.WpfExtensions.WriteableBitmapConverter.ToWriteableBitmap(src);

SaveBitmap(bmp, $"C:\\Users\\User\\Desktop\\C#Study\\aaa\\test1.jpg");

Output:

here is original

![original](https://github.com/user-attachments/assets/064ee89b-da96-48c1-9dd5-5582cea8e671)

and that is Converted WriteableBitmap. i saved it by JPG.
![test1](https://github.com/user-attachments/assets/cedb4688-db05-451a-8f75-8e09979f9cf9)

What did you intend to be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant