Skip to content

Commit e16b453

Browse files
Updated image comparison example
1 parent 17c0008 commit e16b453

3 files changed

Lines changed: 126 additions & 67 deletions

File tree

content/english/net/image-comparison/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ url: /net/image-comparison/
1010

1111
## Image Comparison Tutorials
1212
### [Compare Images from Path - GroupDocs.Comparison for .NET](./compare-images-from-path/)
13-
### [Compare Images from Stream - GroupDocs.Comparison for .NET](./compare-images-from-stream/)
13+
Learn how to compare images efficiently in .NET using GroupDocs.Comparison library. Follow step-by-step guide for seamless integration.
14+
### [Compare Images from Stream - GroupDocs.Comparison for .NET](./compare-images-from-stream/)
15+
Learn how to compare images from streams using GroupDocs.Comparison for .NET. Step-by-step guide for seamless integration into .NET applications.

content/english/net/image-comparison/compare-images-from-path/_index.md

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,75 @@
22
title: Compare Images from Path - GroupDocs.Comparison for .NET
33
linktitle: Compare Images from Path - GroupDocs.Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Learn how to compare images efficiently in .NET using GroupDocs.Comparison library. Follow step-by-step guide for seamless integration.
66
type: docs
77
weight: 10
88
url: /net/image-comparison/compare-images-from-path/
99
---
10+
## Introduction
11+
In the realm of .NET development, the ability to efficiently compare documents and images is crucial for various applications. Whether it's for identifying changes, verifying accuracy, or ensuring compliance, developers seek reliable tools that streamline the comparison process. GroupDocs.Comparison for .NET emerges as a robust solution, offering a suite of features tailored to meet these needs seamlessly.
12+
## Prerequisites
13+
Before diving into the intricacies of utilizing GroupDocs.Comparison for .NET, ensure the following prerequisites are met:
14+
### 1. Install GroupDocs.Comparison for .NET
15+
Download the library from [here](https://releases.groupdocs.com/comparison/net/) and follow the installation instructions provided in the documentation [here](https://reference.groupdocs.com/comparison/net/).
16+
### 2. Obtain a License
17+
To unlock the full potential of GroupDocs.Comparison for .NET, acquire a license from [here](https://purchase.groupdocs.com/buy) or utilize the temporary license available [here](https://purchase.groupdocs.com/temporary-license/).
18+
### 3. Familiarity with C# Programming
19+
A basic understanding of C# programming language is necessary to implement the comparison functionalities effectively.
1020

11-
## Complete Source Code
21+
## Import Namespaces
22+
Begin by importing the necessary namespaces into your C# project to access the functionalities of GroupDocs.Comparison for .NET:
1223
```csharp
1324
using System;
1425
using System.IO;
26+
using GroupDocs.Comparison;
27+
using GroupDocs.Comparison.Options;
28+
```
1529

16-
namespace GroupDocs.Comparison.Examples.CSharp.BasicUsage
17-
{
18-
using GroupDocs.Comparison;
19-
using GroupDocs.Comparison.Options;
20-
21-
/// <summary>
22-
/// This example demonstrates comparing of two images without SummaryPage
23-
/// </summary>
24-
class CompareImageFromPath
25-
{
26-
public static void Run()
27-
{
28-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
29-
Console.WriteLine("[Example Basic Usage] # CompareImageFromPath : comparing of two images without SummaryPage\n");
30-
31-
string outputDirectory = "Your Document Directory";
32-
string outputFileName = Path.Combine(outputDirectory, "RESULT.png");
33-
34-
using (Comparer comparer = new Comparer("SOURCE.png"))
35-
{
36-
//If you set the GenerateSummaryPage property to true then the result will be saved in PDF format
37-
CompareOptions options = new CompareOptions();
38-
options.GenerateSummaryPage = false;
39-
40-
comparer.Add("TARGET.png");
41-
comparer.Compare(outputFileName, options);
42-
}
43-
Console.WriteLine($"\nImages compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
44-
}
45-
}
46-
}
30+
Now, let's break down the provided example into multiple steps to effectively compare images using GroupDocs.Comparison for .NET:
31+
## Step 1: Define Output Directory and File Name
32+
```csharp
33+
string outputDirectory = "Your Document Directory";
34+
string outputFileName = Path.Combine(outputDirectory, "RESULT.png");
35+
```
36+
Ensure to replace `"Your Document Directory"` with the desired directory path where you want the comparison result to be stored.
37+
## Step 2: Initialize Comparer Object
38+
```csharp
39+
using (Comparer comparer = new Comparer("SOURCE.png"))
4740
```
41+
Create a new instance of the `Comparer` class by providing the path of the source image (`"SOURCE.png"` in this example).
42+
## Step 3: Configure Comparison Options
43+
```csharp
44+
CompareOptions options = new CompareOptions();
45+
options.GenerateSummaryPage = false;
46+
```
47+
Customize the comparison options as per your requirements. In this case, we're setting `GenerateSummaryPage` to `false` to exclude the summary page from the output.
48+
## Step 4: Add Target Image for Comparison
49+
```csharp
50+
comparer.Add("TARGET.png");
51+
```
52+
Add the target image (`"TARGET.png"`) to compare it against the source image.
53+
## Step 5: Perform Comparison and Save Result
54+
```csharp
55+
comparer.Compare(outputFileName, options);
56+
```
57+
Execute the comparison process and save the result to the specified output file (`"RESULT.png"`).
58+
## Step 6: Display Output Location
59+
```csharp
60+
Console.WriteLine($"\nImages compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
61+
```
62+
Inform the user about the successful completion of the comparison process and provide the location where the result is saved.
63+
64+
## Conclusion
65+
In conclusion, GroupDocs.Comparison for .NET empowers developers with a comprehensive toolkit for efficiently comparing images and documents within their .NET applications. By following the outlined steps and leveraging the capabilities of this library, developers can seamlessly integrate advanced comparison functionalities into their projects, enhancing productivity and accuracy.
66+
## FAQ's
67+
### Can GroupDocs.Comparison for .NET compare documents other than images?
68+
Yes, GroupDocs.Comparison for .NET supports comparing various document formats including Word, Excel, PowerPoint, PDF, and more.
69+
### Is there a trial version available for GroupDocs.Comparison for .NET?
70+
Yes, you can access the trial version [here](https://releases.groupdocs.com/) to evaluate the features before making a purchase.
71+
### Can I customize the output format of the comparison result?
72+
Absolutely, GroupDocs.Comparison for .NET offers flexibility in configuring the output format according to your preferences.
73+
### Does GroupDocs.Comparison for .NET support batch processing?
74+
Yes, developers can leverage batch processing capabilities to compare multiple files simultaneously, improving efficiency.
75+
### Where can I seek assistance if I encounter any issues during implementation?
76+
You can visit the GroupDocs.Comparison forum [here](https://forum.groupdocs.com/c/comparison/12) to seek support from the community and experts.

content/english/net/image-comparison/compare-images-from-stream/_index.md

Lines changed: 61 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,74 @@
22
title: Compare Images from Stream - GroupDocs.Comparison for .NET
33
linktitle: Compare Images from Stream - GroupDocs.Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Learn how to compare images from streams using GroupDocs.Comparison for .NET. Step-by-step guide for seamless integration into .NET applications.
66
type: docs
77
weight: 11
88
url: /net/image-comparison/compare-images-from-stream/
99
---
10+
## Introduction
11+
In the realm of .NET development, ensuring accuracy and consistency across documents or images is crucial. GroupDocs.Comparison for .NET provides a robust solution for developers to compare images efficiently. This tutorial will guide you through the process of comparing images from streams using GroupDocs.Comparison for .NET. By following these steps, you'll be able to seamlessly integrate image comparison capabilities into your .NET applications.
12+
## Prerequisites
13+
Before diving into the tutorial, make sure you have the following prerequisites in place:
14+
### 1. Install GroupDocs.Comparison for .NET
15+
Ensure that you have GroupDocs.Comparison for .NET installed in your development environment. You can download the necessary files from the [download link](https://releases.groupdocs.com/comparison/net/).
16+
### 2. Obtain a License
17+
To utilize GroupDocs.Comparison for .NET, you'll need a valid license. You can either purchase a license from [GroupDocs](https://purchase.groupdocs.com/buy) or obtain a temporary license for evaluation purposes from [here](https://purchase.groupdocs.com/temporary-license/).
18+
### 3. Familiarity with .NET Development
19+
Basic knowledge of .NET programming is required to follow along with this tutorial.
1020

11-
## Complete Source Code
21+
## Import Namespaces
22+
Before proceeding with the comparison process, ensure you import the necessary namespaces into your .NET project.
1223
```csharp
1324
using System;
1425
using System.IO;
15-
16-
namespace GroupDocs.Comparison.Examples.CSharp.BasicUsage
26+
using GroupDocs.Comparison;
27+
using GroupDocs.Comparison.Options;
28+
```
29+
## Step 1: Define Output Directory and File Name
30+
Firstly, specify the directory where you want to store the comparison result and the name of the output file.
31+
```csharp
32+
string outputDirectory = "Your Document Directory";
33+
string outputFileName = Path.Combine(outputDirectory, "RESULT.png");
34+
```
35+
## Step 2: Initialize Comparer
36+
Next, initialize the `Comparer` object by providing the source image stream.
37+
```csharp
38+
using (Comparer comparer = new Comparer(File.OpenRead("SOURCE.png")))
1739
{
18-
using GroupDocs.Comparison;
19-
using GroupDocs.Comparison.Options;
20-
21-
/// <summary>
22-
/// This example demonstrates comparing of two images without SummaryPage
23-
/// </summary>
24-
public class CompareImageFromStream
25-
{
26-
public static void Run()
27-
{
28-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
29-
Console.WriteLine("[Example Basic Usage] # CompareImageFromStream : comparing of two images without SummaryPage\n");
30-
31-
string outputDirectory = "Your Document Directory";
32-
string outputFileName = Path.Combine(outputDirectory, "RESULT.png");
33-
34-
using (Comparer comparer = new Comparer(File.OpenRead("SOURCE.png")))
35-
{
36-
//If you set the GenerateSummaryPage property to true then the result will be saved in PDF format
37-
CompareOptions options = new CompareOptions();
38-
options.GenerateSummaryPage = false;
39-
40-
comparer.Add(File.OpenRead("TARGET.png"));
41-
comparer.Compare(outputFileName, options);
42-
}
43-
Console.WriteLine($"\nImages compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
44-
}
45-
}
46-
}
4740
```
41+
## Step 3: Add Target Image
42+
Add the target image to the comparison process by providing its stream.
43+
```csharp
44+
comparer.Add(File.OpenRead("TARGET.png"));
45+
```
46+
## Step 4: Configure Comparison Options
47+
Configure the options for image comparison. In this example, we set `GenerateSummaryPage` to false to prevent generating a summary page.
48+
```csharp
49+
CompareOptions options = new CompareOptions();
50+
options.GenerateSummaryPage = false;
51+
```
52+
## Step 5: Perform Comparison
53+
Execute the comparison process by calling the `Compare` method and providing the output file name and comparison options.
54+
```csharp
55+
comparer.Compare(outputFileName, options);
56+
```
57+
## Step 6: Display Result
58+
Finally, display a message confirming the successful comparison and the location of the output file.
59+
```csharp
60+
Console.WriteLine($"\nImages compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
61+
```
62+
63+
## Conclusion
64+
In conclusion, GroupDocs.Comparison for .NET offers a powerful solution for comparing images within .NET applications. By following the step-by-step guide outlined in this tutorial, developers can seamlessly integrate image comparison functionality into their projects, ensuring accuracy and consistency across documents.
65+
## FAQ's
66+
### Can GroupDocs.Comparison for .NET compare images in different formats?
67+
Yes, GroupDocs.Comparison for .NET supports comparing images in various formats, including PNG, JPEG, GIF, BMP, and more.
68+
### Is it possible to customize the comparison settings?
69+
Absolutely, developers can customize comparison settings according to their requirements, such as ignoring small formatting differences or setting tolerance levels.
70+
### Can I compare images stored in memory streams?
71+
Yes, you can compare images from memory streams, as demonstrated in this tutorial.
72+
### Does GroupDocs.Comparison for .NET provide support for document comparison as well?
73+
Yes, GroupDocs.Comparison for .NET supports comparing not only images but also documents in various formats such as Word, Excel, PDF, and more.
74+
### Is there a trial version available for testing purposes?
75+
Yes, you can obtain a free trial version from [here](https://releases.groupdocs.com/).

0 commit comments

Comments
 (0)