1

Topic: Sum of all images

This script will produce a new image by adding all images loaded Image Analyzer

using System;
using System.Linq;
using MeeSoft.ImageProcessing;

public class ScriptOp : MeeSoft.ImageProcessing.Operations.ScriptOperation.Base
{
    PlanarBitmap _active;

    public override void Apply()
    {
        var stopwatch = new System.Diagnostics.Stopwatch();
        stopwatch.Start();

        DstWidth = SrcBitmap.Width;
        DstHeight = SrcBitmap.Height;
        DstBitmap.Planes = null;
        int count = 0;
        ProgressUpdate(0);
        foreach(var image in OpenImages())
        {
            _active = image;
            base.Apply();
            ProgressUpdate(--count);
        }

        WriteLn("Elapsed time: " + stopwatch.ElapsedMilliseconds.ToString() + "ms");
    }

    protected override float GetPixel(int x, int y, int p, BitmapPlane source)
    {
        return DstBitmap[p][x,y] + _active[p][x,y];
        //return Math.Max(DstBitmap[p][x,y], _active[p][x,y]);
    }
}
Michael Vinther

> software developer <