NDArray.ToBitmap() has critical issue with 24bpp VERTICAL images
Open
Nobody has claimed this yet.
bug
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 205
- Avg merge
- 7d 7h
- Merged PRs (30d)
- 2
Description
var arr = np.ones(1, 2, 1, 3).astype(NPTypeCode.Byte);
var bmp = arr.ToBitmap();
for (int c = 0; c < bmp.Width; c++)
{
for (int r = 0; r < bmp.Height; r++)
{
var p = bmp.GetPixel(c, r);
Console.WriteLine($"r:{r} c:{c} => ({p.R};{p.G};{p.B})");
}
}
// return
// r: 0 c: 0 => (1; 1; 1)
// r: 1 c: 0 => (0; 1; 1) !!!
// instead of
// r: 0 c: 0 => (1; 1; 1)
// r: 1 c: 0 => (1; 1; 1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the implementation of NDArray.ToBitmap() and reproduce the issue with the provided 1x2x1x3 array and pixel loop. Verify the vertical 24bpp output against the expected values, then add or update coverage for this case so both pixels retain RGB values of (1,1,1).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100