-
Notifications
You must be signed in to change notification settings - Fork 27
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
Potential issue with setting and getting colours #14
Comments
Hmm this may be an issue with the way colors are encoded and decoded via |
Hi Luiz. Thanks for getting back to me. I swapped the calls out for |bitmap.SetPixel((uint)colour.ToArgb())| and the results appear to be the same. Then I also swapped out the calls for to GetPixel to |original.GetPixelUInt(original.X, original.Y);| and then converted this result back to a Color object. That appears to give the expected results, but not universally. After running the system through several iterations, it still appears as though a variance is getting through. |
I've got my working code set up on GitHub, currently as a private repo. If you'd like I'll see if I can add you to it so you can see exactly what I'm doing since it's going to be quite difficult to unpick this via the log entries alone. I'm wondering if it's something wacky like gamma correction. If it is I've got no idea how to test for that, let alone fix it. |
After doing even more testing on this, the value as written to the pixel doesn't appear to match, what is said to have been written. According to Paint.net the value written to the pixel is 255, 128, 130, 127 (ARGB) but the value should have been 255, 128, 129, 127 (ARGB) as passed to the function. This is one of the strangest issues I've ever come across as I can find no reason for this to happen, at all. |
Hi there.
I've been unable to track down the source of this issue. It may or may not be within the FastBitmap system or not.
I have tested a few of them and they all give the same result.
Basically I encode a pixel onto a bitmap via the SetPixel method call. Retrieving the colour via the GetPixel appears to give a different result than I would have expected:
It's a bit hard to follow but the colours on lines 'After (1, written)' and 'Colour (1) Modified' should match, as should the colours on lines 'After (2, written)' and 'Colour (2) Modified'.
As far as I can tell there isn't anything that can intrinsically go wrong here, so I'm at a loss for what could be causing this issue to appear.
If you've got any ideas, I'd love to hear them!
Cheers.
The text was updated successfully, but these errors were encountered: