dorko Posted August 22 Share Posted August 22 When I copy an image directly from Paint.NET to Paint Tool SAI, the image appears slightly offset - the image is shifted three pixels to the left, with the leftmost three pixel columns appearing on the right side of the image, shifted down 1 pixel: Example image copied from Paint.NET: How it appears after being pasted into Paint Tool SAI: Behavior seems to be consistent regardless of image size, in other words it's always three pixels off even if I downscale the image: This doesn't occur if the same image is pasted from anywhere else I've tested (browser, discord, photoshop, etc) leading me to believe it's an issue with Paint.NET in particular and not with Paint Tool SAI. Quote Link to comment Share on other sites More sharing options...
Tactilis Posted August 22 Share Posted August 22 2 hours ago, dorko said: This doesn't occur if the same image is pasted from anywhere else I've tested (browser, discord, photoshop, etc) leading me to believe it's an issue with Paint.NET in particular and not with Paint Tool SAI. That conclusion, i.e. that it is a Paint.NET issue, does not necessarily follow from what you have described. Have you tested pasting the image from Paint.NET to other applications? Do they similarly show the 3 pixel shift? If they do, then it is quite possibly a Paint.NET issue. If they do not, then it is more likely that it's a Paint Tool SAI problem. Quote Link to comment Share on other sites More sharing options...
dorko Posted August 22 Author Share Posted August 22 1 minute ago, Tactilis said: That conclusion, i.e. that it is a Paint.NET issue, does not necessarily follow from what you have described. Have you tested pasting the image from Paint.NET to other applications? Do they similarly show the 3 pixel shift? If they do, then it is quite possibly a Paint.NET issue. If they do not, then it is more likely that it's a Paint Tool SAI problem. They do not, the issue seems to be unique to specifically pasting from Paint.NET to Paint Tool SAI. Pasting from anywhere else to SAI works fine; pasting from Paint.NET to anywhere else works fine. Given the pixel shift only occurs from images copied through Paint.NET, my (perhaps limited) understanding is that SAI seems to not like however Paint.NET in particular handles its clipboard images. Quite curious why, on a technical level, this sort of image distortion would happen as a result. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 22 Share Posted August 22 Paint.NET places the image onto the clipboard in various formats. It's up to the consuming program (in this case, Paint Tool SAI) to choose which format it wants to use. Maybe Paint Tool SAI is choosing a format that it doesn't handle properly. ¯\_(ツ)_/¯ These are the formats Paint.NET is placing onto the clipboard: 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
dorko Posted August 23 Author Share Posted August 23 Interesting! Exactly the insight I was hoping for, toe_head. Seems like fixing this sort of issue might be beyond the scope of Paint.NET then, though at least the images will paste properly if I perform an intermediary step, ie paste the image somewhere else and copy from there. Quote Link to comment Share on other sites More sharing options...
Reptillian Posted August 23 Share Posted August 23 (edited) I have this issue when copy and pasting from Paint.NET into Firefox. Unfortunately, I'll just shrug and say "I'll just live then.". Edited August 23 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 23 Share Posted August 23 As long are you're using the latest version of Paint.NET, then this is a bug in Paint Tool SAI. It is not correctly parsing the DIBv5 header when bV5Compression is equal to BI_BITFIELDS. You should report this bug to them. See more discussion here: 1 Quote 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 More sharing options...
Rick Brewster Posted August 23 Share Posted August 23 5 hours ago, dorko said: Quite curious why, on a technical level, this sort of image distortion would happen as a result. Because they are incorrectly parsing the BITMAPV5HEADER data. They are reading an additional 3 4-byte values at the end of the header, which is where the first 3 pixels of the bottom row are supposed to be. The DIB has its pixels in left-to-right, bottom-to-top order (which is oddly the standard for DIBs). So the image shifts left by 3 pixels because they're skipping 3 pixels worth of data, and then the rightmost 3 pixels of the bottom row are pulled from the left edge of the next row. And so on up until the last 3 pixels (the top rightmost pixels) are garbage values -- so this is also technically a buffer overrun bug on their part (which can actually be a serious security concern depending on context). (btw, DIB = Device Independent Bitmap) 1 Quote 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 More sharing options...
Rick Brewster Posted August 23 Share Posted August 23 Also, a great way to remove this type of bug -- because DIBs and DIBV5s are a monstrous pain to work with and it's no surprise they got it wrong because lots of apps also get it wrong -- is to process the PNG clipboard format instead. It's a PNG ... should be very easily parsable by an app like Paint Tool SAI. Paint.NET puts PNG onto the clipboard first for a reason: so that other apps will (hopefully) prioritize it over the DIB variants that are so error prone across the whole ecosystem of Windows apps. Lastly, make sure you're using the latest versions of both Paint.NET and Paint Tool SAI. You didn't say what versions of each you were using. As far as we can tell you're using old versions of both. 1 Quote 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 More sharing options...
dorko Posted August 23 Author Share Posted August 23 4 hours ago, Rick Brewster said: Lastly, make sure you're using the latest versions of both Paint.NET and Paint Tool SAI. You didn't say what versions of each you were using. As far as we can tell you're using old versions of both. I am using the latest Paint.NET. Though I'm using an older version of SAI (intentionally) I am willing to accept that if not caused by Paint.NET, which seems not to be the case, this issue's likely not one I can solve outside of using a different program to paste into SAI. It is nice to understand why this occurs, though, and to have a workaround I can use to paste images in properly. Quote Link to comment Share on other sites More sharing options...
Tactilis Posted August 23 Share Posted August 23 30 minutes ago, dorko said: this issue's likely not one I can solve outside of using a different program to paste into SAI How frequently do you need to copy-paste from Paint.NET to Paint Tool SAI? If it's something you do often, then I'd be inclined to automate the sequence: Copy from Paint.NET Paste into IrfanView Copy from IrfanView Paste into SAI In this comment https://forums.getpaint.net/topic/122164-full-screen-preview-of-current-pic/?do=findComment&comment=610304 I posted an AutoHotkey script to copy from Paint.NET to IrfanView. It would be simple to extend it to do steps 3 and 4 above. Then, with just a single keypress in Paint.NET you would be able to transfer your image to Paint Tool SAI. If this capability would be useful to you but you run into any problems while extending the script, then please ask here. Alternatively, if modifying the script is not something you are keen to do, then I could make the changes. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.