PowerShell and Magick.NET Write performance advice

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
Posts: 1
Joined: 2019-04-02T17:24:57-07:00
Authentication code: 1152

PowerShell and Magick.NET Write performance advice

Post by Batman11 »

Hi, Using .NEt and PowerShell, I'm trying to write a rectangle on a bunch of small Tif images (each size around 10k). Seems to be working except performance is slow when saving the Tif image to disk (Using $IMG.WRITE). It takes about half a second or more to write it out. Was hoping to bring this down a bit.
Any advice on increasing performance of the write? Thanks

Code: Select all

GCI "C:\users\Allan\desktop\\images" | ForEach-Object {

    $img = [ImageMagick.MagickImage]::new($_)

    $Draw = [ImageMagick.Drawables]::new()
   $FileOut ="C:\users\allan\desktop\images\x$_"
I measured the write command ($img.Write($FileOut)) and it takes around .7 of a second to write it out.
I'm trying other methods and they write at around .2 to .3 of a second. That doesn't sound like much but those processes already take about 2 hours to do.
Post Reply