Jump to content

How to save text into PNG, or keep existing tEXt chunk at least.


Recommended Posts

Hello,

I would like to insert some comments into .png files. Old Paint.NET was able to keep tEXt chunk, when I edited PNG which has included it already, but current Paint.NET (well, I am using 4.3.12 version) simply deletes it. Is there any solution for this or similar chunks?

 PNG_with_comment.png.2b82b4b7bc132fddf76e777a1877c347.png  <<< See the attached image (5x5 pixels) in some hex editor - most of it is text.

 

Edited by bflmpsvz
Link to comment
Share on other sites

44 minutes ago, bflmpsvz said:

I am using 4.3.12 version

 

The current version of Paint.NET is 5.0.13, version 4.3.12 is no longer supported.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

5 hours ago, bflmpsvz said:

Old Paint.NET was able to keep tEXt chunk, when I edited PNG which has included it already


I don't recall that Paint.NET could do that.  When you say "Old Paint.NET", how old are you referring to?  Version 2.x ?  Version 3.x ?

Please could you .zip a small  .png that has a tEXt chuck and attach the .zip here.

 

Link to comment
Share on other sites

On 10/30/2024 at 6:41 PM, Tactilis said:


I don't recall that Paint.NET could do that.  When you say "Old Paint.NET", how old are you referring to?  Version 2.x ?  Version 3.x ?

Surely version 3.x, and this version was adding its signature using the tEXt chunk into .png images.

The image 5x5 pixel I included in my first post is not small enough?

O.K., see it included in the .zip together with old image I have created using 3.5 version of the Paint.NET.

 

PNGs_with_tEXt_chunk.zip

Edited by bflmpsvz
Link to comment
Share on other sites

22 minutes ago, bflmpsvz said:

O.K., see it included in the .zip together with old image I have created using 3.5 version of the Paint.NET.


Are you saying that Paint.NET 3.5.11, which you used to create the kolecko_600dpi.png image in your .zip is the "Old Paint.NET" that you say used to round-trip tEXt chunks? i.e. it "was able to keep tEXt chunk, when I edited PNG which has included it already"?

 

I may be wrong but as far as I can see, Paint.NET 3.5.11 just used to write its version signature in a tEXt chunk: tEXtSoftware Paint.NET v3.5.11

Current versions of Paint.NET 5.x.x now write the signature in an eXIf chunk.

 

 

Link to comment
Share on other sites

@bflmpsvz Before you post again, please read all the Forum Rules.  And note in particular #7.

It was not a cool move for you to report one of the Moderators for being "off topic" and giving "irrelevant answers" when they were just doing their job by informing you that old versions of Paint.NET are no longer supported.

 

  • Upvote 1
Link to comment
Share on other sites

5 hours ago, Tactilis said:

@bflmpsvz Before you post again, please read all the Forum Rules.  And note in particular #7.

It was not a cool move for you to report one of the Moderators for being "off topic" and giving "irrelevant answers" when they were just doing their job by informing you that old versions of Paint.NET are no longer supported.

 

 

Seconding this. Older versions are not supported, no ifs ands or buts, and that is not an "off topic" or "irrelevant" answer in the slightest. If you're not willing to follow simple rules then your thread is going to get closed really fast.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Now, to get to the actual question.

 

PDN does not, and never has, preserved PNG metadata from the tEXt chunks. It will add its own Creation Software tag*. It will, thanks to @null54, preserve EXIF and XMP metadata (as well as IPTC metadata for some other file formats). However, there has not yet been demand/request for preserving PNG-specific metadata like tEXt chunks. This would be reasonable to add, it's already in the big TODO pile, I can earmark it for a 5.1.x release.

 

* actually, due to a simple bug, it doesn't -- I'm fixing that now, for 5.1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

@bflmpsvz If you search for   how to add tEXt chunks to png    you will find several ways of editing your textual comments. There are various options; some are online tools and others you can run locally.
 

For example the command line tool exiftool will read and write tEXt chunks.

If you want a GUI for that then you could use ExifToolGui.

Here, I am editing the tEXt chunk comment in your original file:

 

Exiftool-GUI.png

 

 

Once @Rick Brewster has added the ability in a later 5.1.x release to preserve PNG-specific metadata, you will have the means of editing PNGs with Paint.NET without losing your tEXt chunks.

 

Link to comment
Share on other sites

On 10/30/2024 at 9:05 PM, Tactilis said:

It was not a cool move for you to report one of the Moderators for being "off topic" and giving "irrelevant answers" when they were just doing their job by informing you that old versions of Paint.NET are no longer supported.

I am sorry, I was afraid that this is the only information I will get..

 

On 10/31/2024 at 7:48 AM, Rick Brewster said:

PDN does not, and never has, preserved PNG metadata from the tEXt chunks.

Well, at least in the form tEXtComment (and 00h), it preserved. I turned on my old comp with WinXP and PDN 3.5.11, you can check my results. It even preserved 21FEh block from GIF as a tEXtComment. Anyway, this is history. Let's hope that this will be included in some future release of the PDN.

PNG_tests.ZIP

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...