FanofSMBX Posted April 15, 2019 Share Posted April 15, 2019 I would like to report an apparent glitch with the Resize Image "Nearest Neighbor" algorithm when downscaling. https://i.imgur.com/K3C7Z47.png As you can see in this image, the sprite I am downscaling is symmetrical, though I have no doubt this could affect the downscaling of nonsymmetrical sprites as well. When I downscaled the sprite (shown here rescaled for detail) from 14x16 to 12x16, it lost its symmetricality, which seems like a glitch. Oddly enough, the apparently different Nearest Neighbor algorithm used for scaling selections does not have this glitch. If this behavior is not intended and you need more examples, I will be happy to help as I use Paint.NET for pixel art all the time. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 15, 2019 Share Posted April 15, 2019 If you can make a video to show this, that would help a lot. You won't necessarily get the same results with Image->Resize vs. Move Selected Pixels if what you're selecting and transforming is not the entire image. 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...
HyReZ Posted April 15, 2019 Share Posted April 15, 2019 I would think that using a 'Nearest Neighbor' algorithm would compensate for the fact that you cannot have half a pixel. Quote Link to comment Share on other sites More sharing options...
FanofSMBX Posted April 16, 2019 Author Share Posted April 16, 2019 5 hours ago, Rick Brewster said: If you can make a video to show this, that would help a lot. You won't necessarily get the same results with Image->Resize vs. Move Selected Pixels if what you're selecting and transforming is not the entire image. Here you go: Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 16, 2019 Share Posted April 16, 2019 Can you also attach the image that you're using? 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...
FanofSMBX Posted April 16, 2019 Author Share Posted April 16, 2019 18 minutes ago, Rick Brewster said: Can you also attach the image that you're using? Here you go. This image is horizontally symmetric, so that's how I could tell that if the downscaled image to 12 pixels wide, which is a multiple of two like 14 is, was not symmetric then that seemed like an issue. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted April 16, 2019 Share Posted April 16, 2019 Cacodaemon? 😁 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 16, 2019 Share Posted April 16, 2019 Okay thanks for the video and the image! I'll look into this for 4.1.7, and I'll reply to this post when it's resolved 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...
HyReZ Posted April 16, 2019 Share Posted April 16, 2019 Here is a link to some nfo that expains what is going on in the various downscaling algorithms:https://en.wikipedia.org/wiki/Bicubic_interpolation Quote Link to comment Share on other sites More sharing options...
HyReZ Posted April 16, 2019 Share Posted April 16, 2019 (edited) I love puzzles and this thread has one indeed! I tested the effects on symmetry of the icon by using horizontal pixel reduction using the resize feature of PDN. I three cases using the resize feature on the image; from 14 x 16 px to 12 x 16 px; resulted in the destruction of veritical bi-lateral symmetry. I resized by using Nearest Neighbor, Bilinear, and Bicubic Interpolation and got the same result. When I resized the icon by dragging across two pixels inward along its vertical axis; bi-lateral symmetry was maintained but the color count increased from 8 colors to 75 colors. Edited April 16, 2019 by HyReZ Correcting spelling and adding more nfo! Quote Link to comment Share on other sites More sharing options...
FanofSMBX Posted April 27, 2019 Author Share Posted April 27, 2019 By the way, here is another example image (the left one is 32x32px). It is horizontally and vertically symmetrical (one quadrant mirrored for the other three). It is another sprite from Link to the Past before anyone accuses me of not giving credit You can see that resizing it to 50% ruins the symmetrical nature of it. Interestingly, I realized through tests, that if I resize it to 15x15, it looks resized great. It is perfectly symmetrical, well that is if you add in the top row and left column of pixels yourself, but still looks much better. I hope that this is helpful to narrowing down the problem. @Rick Brewster Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 3, 2019 Share Posted May 3, 2019 I just spent some time investigating this, and I'm not actually convinced that there is a problem/bug here. Subjectively, yes it certainly doesn't work well for your scenario. However, nearest neighbor resampling doesn't give any promises about symmetry. In fact, it explicitly doesn't, and it can't. Take the following sample image, where I've drawn a symmetrical, aliased, filled circle and then added red dots to every other pixel: The red dots are the pixels you'd expect to be picked up when using nearest neighbor resampling and reducing the image from 16x16 to 8x8 (a 50% reduction). In fact, these aren't the pixels that are actually used -- if you take the red dot layer and shift it down-and-right by 1 pixel, then those are the pixels that get picked up. But, the result is the same: you are picking up pixels that are not distributed symmetrically. They are distributed evenly. You can, of course, craft up a resizer that does do things symmetrically. However, it will only be symmetric for some cases, not all. You as the artist are just going to have to be intentional about this kind of resizing: which rows and columns can you remove and still retain your desired result? That's an answer that the human brain is currently better at doing on a case-by-case basis. The fact that Image->Resize and Move Selected Pixels produce different output is unfortunate, but may also just be "a math thing". In fact, MSP produces different output if the image is resized from the left edge vs. the right edge Image attached so you can play with it yourself. circle16x16.pdn.zip 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...
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.