Hi, i load a .hdr image in a MagickImage and then change the value of a pixel to {0,0,0} (the image has 3 channels. What happens is that after the first pixelCol.Set(x,y, black) everything becomes (0,0,0). I can't understand why. The sample code is reported here:
```
void mymethod(ref MagickImage image, double[][] pixelSet, float[] black)
PixelCollection ps = image.GetPixels();
Pixel p;
foreach (double[] pixel in pixelSet)
{
if (mycondition)
{
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("Before: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
ps.Set((int)pixel[X_COMP], (int)pixel[Y_COMP], black);
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("After: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
}
}
```
The code returns
> Before: regularfloat regularfloat regularfloat
After: zero zero zero
For the first iteration, and
> Before: zero zero zero
After: zero zero zero
For all the others iterations. I tried skipping the first iteration and the result is the same but starting from the second iteration.
Comments: Sorry, I had an exposition and a graduation day. It has been a very rough month. I'm gonna answer right now! Thanks for the patience
```
void mymethod(ref MagickImage image, double[][] pixelSet, float[] black)
PixelCollection ps = image.GetPixels();
Pixel p;
foreach (double[] pixel in pixelSet)
{
if (mycondition)
{
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("Before: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
ps.Set((int)pixel[X_COMP], (int)pixel[Y_COMP], black);
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("After: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
}
}
```
The code returns
> Before: regularfloat regularfloat regularfloat
After: zero zero zero
For the first iteration, and
> Before: zero zero zero
After: zero zero zero
For all the others iterations. I tried skipping the first iteration and the result is the same but starting from the second iteration.
Comments: Sorry, I had an exposition and a graduation day. It has been a very rough month. I'm gonna answer right now! Thanks for the patience