I've just searched for the same DOTNET to use in powershell. If you value speed use this colormatrix DOTNET example to invert in a single step: https://www.codeguru.com/dotnet/inverting-image-colors-in-net/ It uses https://learn.microsoft.com/en-us/dotnet/api/system.drawing.imaging.imageattributes , https://learn.microsoft.com/en-us/dotnet/api/system.drawing.imaging.colormatrix and https://learn.microsoft.com/de-de/dotnet/api/system.drawing.graphicsunit . I just applied these methods in Powershell to speed up the inversion a lot instead of doing it pixel by pixel. It should speed up the C# variant too.