Dive into the heart of your PNG files and initially learn viewing and editing metadata online. Uncover the hidden details of your images effortlessly. Later, in this article, we explore the C# and Java approach, providing you with code snippets to customize your PNG metadata. Whether you’re a tech enthusiast or a developer, empower yourself to enhance your images with precision and ease.

View and Edit PNG Metadata Online

Customizing PNG Metadata online is easy with metadata editing apps. You can achieve this effortlessly using the GroupDocs.Metadata App.

Online PNG Metadata Editor
  1. Go to the Online PNG Metadata Editor App website.
  2. Import your PNG file in two ways:
    • Click on “Browse” and pick your file.
    • Drag and drop the file into the assigned space.
  3. PNG metadata properties are now available for online modifications.
  4. Edit the details for the native, EXIF, and XMP properties as needed.
  5. After you’re done, save your PNG file with the updated metadata tags. You can also export the properties in a spreadsheet format like XLSX if needed.

That’s all! Enjoy editing PNG Metadata online.

PNG Metadata Editing – Developer’s Guide

Developers! Get ready to customize the metadata properties of your PNG files using code. Let’s gain some hands-on experience with libraries specifically created to simplify this task. In this article, we’ll walk you through using these APIs to programmatically edit the metadata of PNG files. Pick the one that fits your needs best!

Let’s explore the coding world and start editing metadata tags of PNG files.

Editing PNG Metadata with C#

If you’re a .NET developer looking to modify PNG metadata properties, here’s how you can do it:

  1. Integrate the library into your application.
  2. Utilize the provided code snippet to view and edit metadata properties as needed:
using (Metadata metadata = new Metadata("path/image.png"))
{
    var root = metadata.GetRootPackage<PngRootPackage>();
    foreach (var chunk in root.PngPackage.TextChunks)
    {
        Console.WriteLine(chunk.Keyword);
        Console.WriteLine(chunk.Text);
        var compressedChunk = chunk as PngCompressedTextChunk;
        if (compressedChunk != null)
        {
            Console.WriteLine(compressedChunk.CompressionMethod);
        }
        var internationalChunk = chunk as PngInternationalTextChunk;
        if (internationalChunk != null)
        {
            Console.WriteLine(internationalChunk.IsCompressed);
            Console.WriteLine(internationalChunk.Language);
            Console.WriteLine(internationalChunk.TranslatedKeyword);
        }
    }
}

For detailed guidance, check out the articles on How to Read PNG Metadata using C# and Manage XMP and EXIF Data of Images using C#

For more .NET API resources, explore the following links:

.NET API | Documentation | Download

Editing PNG Metadata with Java

You can create your own application to view and edit PNG image metadata using Java. Here’s a simple example to get you started:

  1. Download and set up the metadata library for Java in your application.
  2. Use the provided source code to view and edit PNG Metadata:
try (Metadata metadata = new Metadata("path/image.png")) {
    PngRootPackage root = metadata.getRootPackageGeneric();
    for (PngTextChunk chunk : root.getPngPackage().getTextChunks()) {
  
        System.out.println(chunk.getKeyword());
        System.out.println(chunk.getText());
  
        if (chunk instanceof PngCompressedTextChunk) {
            PngCompressedTextChunk compressedChunk = (PngCompressedTextChunk) chunk;
            System.out.println(compressedChunk.getCompressionMethod());
        }
  
        if (chunk instanceof PngInternationalTextChunk) {
            PngInternationalTextChunk internationalChunk = (PngInternationalTextChunk) chunk;
            System.out.println(internationalChunk.isCompressed());
            System.out.println(internationalChunk.getLanguage());
            System.out.println(internationalChunk.getTranslatedKeyword());
        }
    }
}

For detailed instructions, check out the articles on How to Read PNG Metadata using Java and Manage XMP and EXIF Data of Images using Java.

For more Java API resources, check these links:

Java API | Documentation | Download

Conclusion

In summary, we’ve explored how to extract, view, and edit metadata tags in PNG files. Initially, we achieved this using an online metadata editor. Later, we delved into programmatically editing metadata using C# and Java. While doing so, we explored various metadata properties specific to PNG files.

For further details about the APIs, consult the respective documentation. If you have any questions, feel free to reach out to us via the forum.

See Also