Jump to content

Paint.NET not really exporting images (of another origin) when no modifications were made

Recommended Posts

Hi, I think a certain kind of application behaviour is undesired;


- save an image using Windows paint (in my example, png)

- open the image under Paint.NET

- without making edits to the file, let Paint.NET save the file by same file location overwrite ("save", auto detect). 


Nothing will happen to the file, last modified date and file hash remains the same. While we know no visual edits have been made, Paint.NET is a whole different exporter, with different image and PNG format libraries, potentially producing a better file, adding different stuff in file metadata (png) such the fact it was saved using paint.NET, palette data which it doesn't if nothing gets changed.


What happens here is Paint.NET ignoring the file overwrite, if user is saving to the same location it opened the Windows Paint-exported file on. Paint.NET is just pretending that it's saving something in that case.

If however you go to "Save As", it will work as intended and generate a non-matching hash and use the Paint.NET format/add the metadata.


So basically at times Paint.NET chooses to be lazy, where there's no visual edits it will just respect the output file produced by another image editor. If this extends beyond MS paint created files, it can potentially be harmful because user of Paint.NET expects to produce a Paint.NET image file format for their own reasons. You can ask me why do you care about formats or image library version used, what are the quality improvements or changes; that is not an ordinary question, there can be a lot of purposes for many users to truly let Paint.NET write the file (like use some metadata written by it), which they also believe they are doing, its not the question what I will see visually different in the resulting images, but a question whether this is desired application behaviour, which I don't think it is.


Also I noticed in my test cases that sometimes it does write it from scratch using Paint.NET exporter, it depends on the complexion of the image it seems, like some color tones maybe paint.NET wants to structure differently in the format if it was saved using MS paint. So you can randomly get truly rewritten files using my reproduction steps. This could also explain why my attempts to get the same issue with formats other than PNG, kept producing truly rewritten files: i may not have come across certain color compositions/drawings yet that Paint.NET thinks it can preserve by relying on the old exact file. Just that doesn't say the issue is limited to PNG, my point.

Edited by mxz55
Link to comment
Share on other sites

I'm pretty sure this type of logic doesn't exist in Paint.NET. The file being written to isn't inspected to see if it's "the same". This would triple or quadruple the amount of I/O that needs to be done to save an image, and that wouldn't be okay in the general case. It would also use up a ton of memory, and the benefits wouldn't be there.


Have you tried this on other systems? Or maybe saving to a different disk? Maybe you have something else going on with your system. Like maybe OneDrive is obfuscating things, or some other kind of shell or file system plugin. It's also important to refresh the File Explorer window (press F5), as it doesn't always "catch" all the latest changes. (this used to work fine back in XP or Vista ... I think it got buggy in 8?)

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

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


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.

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...