Jump to content

Recommended Posts

Posted

For small/pixel art kind of work, it's sometimes not quite clear how nearest neighbor resizing operates. Sometimes, it works exactly as expected, while other times it seems to start "one pixel off" or something and the whole resizing becomes just a mush of pixels.

Attached below, a recent case: a small 138x67 pixel raster image. the pixels are doubled horizontally, and I was attempting the resize to half the width to normalise those double pixels. The end result was a 69x67 pixel image where visibly the nearest neighbor calculation was off by one pixel. In the end, I fixed this by undoing, shifting the image layer by one pixel to the right, and redoing the resizing. Other times though, with exactly the same operation / trying to de-double pixels, it works just fine without having to first nudge the image. Just confused/not quite sure if I'm missing something obvious...

1.png

2.png

3.png

Posted
32 minutes ago, patrick_h_lauke said:

also notice the semi-transparent pixel there on the right of the resulting image, again leading me to think the algorithm started somehow "off by one" when trying to work out the neighbors

And you should look at the upper right corner of the original image, there is a slight gap there. Makes me think that it is not 168 pixels wide, Make your grid have 1 pixel divisions and check it.

This is from a zoomed in view of a screenshot from your first image. 

1776724456_ScreenShot2020-10-31at6_31_22AM.png.7bbcd14cb6927f3f7555fbc320400a24.png

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Posted (edited)
37 minutes ago, Old Bruce said:

And you should look at the upper right corner of the original image, there is a slight gap there. Makes me think that it is not 168 pixels wide, Make your grid have 1 pixel divisions and check it.

This is from a zoomed in view of a screenshot from your first image. 

1776724456_ScreenShot2020-10-31at6_31_22AM.png.7bbcd14cb6927f3f7555fbc320400a24.png

 

Looks like the the canvas is only 137.8 pixels wide, but I'm probably being fooled by an artefact of the view scaling.

Edited by anon2
Posted

how on earth would a document have a non-integer dimension like that? this was copy/pasted from another raster image, with pixel-snapping etc turned on. and, even assuming it somehow did have a width of 137.8 or whatever, why did that not show in the document resize dialog when it first opened?

gah, some days, i wonder why i bother trying to do pixel-accurate stuff in affinity photo...

Posted
1 minute ago, patrick_h_lauke said:

how on earth would a document have a non-integer dimension like that? this was copy/pasted from another raster image, with pixel-snapping etc turned on. and, even assuming it somehow did have a width of 137.8 or whatever, why did that not show in the document resize dialog when it first opened?

gah, some days, i wonder why i bother trying to do pixel-accurate stuff in affinity photo...

I edited my comment. The apparent non-integer size may be an artefact of the view scaling.

Posted

Have you tried using the Move Tool to select the layer in your original document and then use the Transform Panel to change the width to 69 pixels from the original 138?

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.