Hello,
The C# code at
https://www.atalasoft.com/products/dotimage/docs/AccessingPixelData.html
has an error.
The correct code would be this:
PixelMemory pm = image.PixelMemory;
using (PixelAccessor pa = pm.AcquirePixelAccessor())
{
for (int y=0; y < image.Height; y++)
{
byte[] row = pa.AcquireScanline(y);
for (int i=0; i < row.Length; i++)
{
/// YOU NEED A CAST HERE
row[i] = (byte) row[i] / 2; // dim each byte value by 50%
}
pa.ReleaseScanline();
}
}