March 4, 2025 | blog, Tutorial

Image Annotation Library SDK (2025 Version)


Image annotation plays a crucial role in various industries, from healthcare and legal document processing to AI and machine learning applications.

The ability to annotate images efficiently can greatly improve data management and accessibility. This is where GdPicture image annotation sdk comes into play, offering robust tools for seamless image annotation.

Why Use GdPicture’s Library for Image Annotation?

GdPicture provides a powerful and flexible way to add annotations to images and TIFF files using custom XMP annotations. This functionality is akin to how you would annotate PDF documents, enabling:

  • Easy integration into your applications
  • Comprehensive annotation tools for creating, editing, and extracting annotations
  • Seamless handling of multiple file formats, including TIFF and standard image formats
  • Improved workflow efficiency by embedding metadata directly within the images

Features of GdPicture Image Annotation Tools

The SDK offers an extensive set of annotation features, allowing developers to:

  • Create annotations on images using XMP metadata
  • Edit existing annotations to update, modify, or delete notes
  • Extract annotation data for further processing or integration with other applications
  • Support multiple annotation types, such as text, shapes, highlights, and custom markers
  • Save and retrieve annotated images without compromising quality

Setting Up Your First Annotation Project

The AnnotationManager class handles core annotation operations in your projects. Proper setup ensures reliable annotation processing throughout your application lifecycle.

Installation Steps

Follow these steps to set up your annotation project with GdPicture:

Step 1: Install Visual Studio

  • Download and install Visual Studio (Community, Professional, or Enterprise edition).
  • Select the .NET desktop development workload during installation.
  • Launch Visual Studio after installation.

Step 2: Install GdPicture.NET SDK

  • Download the GdPicture.NET SDK from the official website.
  • Follow the installation guide to integrate it into your project.

Step 3: Set Up a New C# Project

  • Open Visual Studio and click Create a new project.
  • Select Console App (.NET) as the template.
  • Name your project and click Create.

Step 4: Add GdPicture.NET NuGet Package

  • Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
  • In the Browse tab, search for:
    • GdPicture.API (for .NET 6.0 or newer)
    • GdPicture (for .NET 4.6.2 or .NET Core 3.1)
  • Select the appropriate package and install it.
  • Create an AnnotationManager instance

Basic implementation:

using AnnotationManager annotationManager = new AnnotationManager();
annotationManager.InitFromFile(@"C:\temp\source.jpg");

Basic Configuration

The annotation manager uses XML-based syntax for XMP annotations. This structure enables various markup types:

  • Text annotations
  • Rubber stamps
  • Geometric shapes
  • Freehand drawings
  • Sticky notes

Each annotation type supports specific properties. The following example creates a rubber stamp with custom settings:

AnnotationRubberStamp annotStamp = annotationManager.AddRubberStampAnnot(
    GdPictureColor.Blue,  // Color
    2, 1, 4, 2,          // Position and size
    "APPROVED"           // Text
);
annotStamp.Rotation = -30;
annotStamp.Author = "YourName";

Saving Annotations

// Save editable annotations
annotationManager.SaveAnnotationsToPage();

// Create permanent annotations
annotationManager.BurnAnnotationsToPage(false);

// Export the final image
annotationManager.SaveDocumentToJPEG(@"C:\temp\output.jpg", 75);

Test each annotation type after configuration. Flattened annotations become permanent image elements. Choose between editable and permanent annotations based on your application needs.

How to Annotate Images Using GdPicture

1. Creating an Annotation

To annotate an image, GdPicture allows you to create XMP metadata annotations. Below is a basic example of how you can add a text annotation to an image:

using GdPicture.Imaging;
using GdPicture.Annotations;

// Load image
Image image = Image.Load("example.jpg");

// Create annotation
XmpAnnotation annotation = new XmpAnnotation();
annotation.Text = "Sample Annotation";
annotation.Position = new AnnotationPosition(50, 100);

// Add annotation to image
image.Annotations.Add(annotation);

// Save annotated image
image.Save("annotated_example.jpg");

2. Editing an Existing Annotation

Modifying an annotation requires fetching the annotation from an image and updating its properties:

// Load the annotated image
Image image = Image.Load("annotated_example.jpg");

// Retrieve the first annotation
XmpAnnotation annotation = image.Annotations[0];

// Modify annotation text
annotation.Text = "Updated Annotation";

// Save updated image
image.Save("updated_annotated_example.jpg");

3. Extracting Annotations

Extracting annotations from an image can be done to retrieve text, position, or other metadata:

// Load annotated image
Image image = Image.Load("annotated_example.jpg");

// Iterate through annotations
foreach (XmpAnnotation annotation in image.Annotations)
{
    Console.WriteLine($"Annotation: {annotation.Text} at Position: {annotation.Position.X}, {annotation.Position.Y}");
}

Why Choose GdPicture for Image Processing?

GdPicture is a powerful SDK that supports advanced image processing, making it an excellent choice for image annotation. With GdPicture, you can:

  • Load and process images efficiently
  • Apply OCR (Optical Character Recognition) to enhance searchable annotations
  • Support a wide range of image formats
  • Optimize image quality and compression

By leveraging GdPicture, developers can create a feature-rich, scalable, and efficient image annotation solution.

Final Thoughts

GdPicture provides a comprehensive solution for image annotation, making it easier for developers to integrate powerful annotation tools into their applications. Whether you are working with simple image annotations or more advanced metadata management, these tools ensure accuracy, efficiency, and seamless workflow integration.

Start enhancing your image annotation capabilities today!

Frequently Asked Questions

1. What file formats does GdPicture support for annotations?

GdPicture supports a variety of image formats including TIFF, JPEG, PNG, BMP, and GIF for annotation purposes.

2. Can I edit or remove annotations after they are added?

Yes, GdPicture allows you to edit, modify, or delete annotations dynamically before finalizing the image.

3. What types of annotations can be created with GdPicture?

GdPicture supports text annotations, rubber stamps, geometric shapes, freehand drawings, and sticky notes, among others.

4. Does GdPicture support batch processing of annotations?

Yes, you can apply annotations to multiple images at once using batch processing techniques for increased efficiency.

5. How do I make annotations permanent?

Use the BurnAnnotationsToPage(false) method to flatten annotations and make them a permanent part of the image.

6. Is there a way to extract annotation data for external use?

Yes, GdPicture allows you to extract annotations and save metadata separately for integration with other applications.


Tags: