Performance Inquiry: High Memory Usage and Long Processing Time with GroupDocs.Watermark v24.7.0 for Large TIFF Files

Dear GroupDocs Support Team,

I hope this message finds you well. I am writing to share feedback regarding the performance of GroupDocs.Watermark for .NET (v24.7.0) when processing large TIFF image files and to kindly request your guidance on potential optimizations.

In our use case, we applied a simple text watermark to a 220 MB TIFF image using the library. The process consistently took ~33 seconds to complete and consumed approximately 6.33 GB of RAM. While the watermarking functionality itself works correctly, the resource utilization and processing time seem disproportionately high for a single image operation.

Key Observations:

  • Library Version: v24.7.0
  • File Format: TIFF (220 MB)
  • Avg. Processing Time: 33 seconds
  • Avg. Memory Usage: 6.33 GB

internal class Program
{
    static void Main(string[] args)
    {
        BenchmarkRunner.Run<GroupDocsWatermarkBenchmark>();
    }
}

[HtmlExporter]
[MemoryDiagnoser]
public class GroupDocsWatermarkBenchmark
{
    public GroupDocsWatermarkBenchmark()
    {
        ParamList = new List<Input>();

        string resourcesDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources");
        string outputDir = "output";

        EnsureDirectoryExist(outputDir);


        DirectoryInfo diResources = new DirectoryInfo(resourcesDir);
        foreach (var file in diResources.GetFiles().OrderBy(t => t.Extension))
        {
            ParamList.Add(new Input
            {
                FileName = file.FullName,
                OutputFileName = Path.Combine(outputDir, file.Name)
            });
        }
    }

    public List<Input> ParamList { get; }

    [ParamsSource(nameof(ParamList))]
    public Input CurrentParam { get; set; }


    [Benchmark(Description = "GroupDocsTextWatermark")]
    public void AddTextWatermarkByGroupDocs()
    {
        License license = new License();
        license.SetLicense("GroupDocs.Watermark.NET.lic");
        using (Watermarker watermarker = new Watermarker(CurrentParam.FileName))
        {
            TextWatermark watermark = new TextWatermark("绝密文件,禁止外发", new Font("simsun", 16));
            watermark.RotateAngle = -45;
            watermarker.Add(watermark);
            watermarker.Save(CurrentParam.OutputFileName);
        }
    }

    [Benchmark(Description = "GroupDocsImageWatermark")]
    public void AddImageWatermarkByGroupDocs()
    {
        License license = new License();
        license.SetLicense("GroupDocs.Watermark.NET.lic");
        using (Watermarker watermarker = new Watermarker(CurrentParam.FileName))
        {
            ImageWatermark watermark = new ImageWatermark("watermark.png");
            watermark.RotateAngle = -45;
            watermarker.Add(watermark);
            watermarker.Save(CurrentParam.OutputFileName);
        }
    }

    private void EnsureDirectoryExist(string path)
    {
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
    }
}

public class Input
{
    public string FileName { get; set; }
    public string OutputFileName { get; set; }

    public override string ToString()
    {
        return Path.GetFileName(FileName);
    }
}

The benchmark summary is:
1.PNG (6.1 KB)

Questions:

  • Are there recommended configuration settings or best practices to reduce memory footprint and improve processing speed for large TIFF files?
  • Are there known limitations with TIFF processing (e.g., handling multi-page or high-resolution images) that could explain this behavior?
  • Would upgrading to a newer version of GroupDocs.Watermark address these performance concerns?
  • We value GroupDocs.Watermark’s reliability and features but hope to optimize its efficiency for large-scale operations. Any insights, workarounds, or roadmap details would be greatly appreciated.

Thank you for your time and assistance. I look forward to your suggestions.

Hi @caoyanmin
Thank you for your request!
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WATERMARKNET-2059

While we are investigating the issue - If this is possible - can you provide your files?

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Here is the file I used during testing.

hi @caoyanmin ,
Thank you for your detailed message and for sharing the sample file.

We were able to reproduce the performance issue using the latest GroupDocs.Watermark for .NET version 25.2, and we’ve started investigating it.

At this stage, we don’t have any known limitations related to TIFF file processing—whether in terms of file size, resolution, or multi-page structure.

We’ll let you know as soon as we have any updates or recommendations.