• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Nearest Neighbor scaling off by 1 pixel on the edges

Explorer ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

I'm a pixel artist who uses Photoshop to create high resolution versions of my pixel art (among other things).  To increase the resolution, I typically transform>scale my layers using the nearest neighbor.

 

I recently noticed that if you scale everything 400% (where 1 pixel becomes 16 pixels in a 4x4 grid), it breaks a little bit on the edges of the image.  It appears as though the top and left edges (user's left) produce an edge that is only 3 pixels wide.  Meanwhile, the bottom and right edges produce an edge that's 5 pixels wide.

 

That small amount isn't breaking any of my printed artwork, but I've begun working on a digital project that's going to be scaled down 50% after this.  The idea is that the finished product will be scaled up 200% from what I originally drew.

 

When I do this, the odd rows of pixels are creating an anti-alias effect that breaks the pixel art effect.

I'm going in and manually fixing the rows manually now, but this seemed worth reporting.

 

(I know my workflow of scaling up to scale down sounds insane, but I draw some pretty insane pixel art and I need to scale like this to achieve a certain effect in my project)

3 pixels intead of 4 on the top edge3 pixels intead of 4 on the top edge5 pixels instead of 4 on the right and bottom edges5 pixels instead of 4 on the right and bottom edges3 pixels instead of 4 on the left edge3 pixels instead of 4 on the left edge

 

I am assuming this is a bug or some other problem.  I'm somewhat new to Photoshop, so this may be a feature I can't wrap my head around.  If there's a better way to scale my art up without using nearest neighbor (or settings I need to change in nearest neighbor), please let me know.

"Be Excellent to Each Other." William Preston Esquire & Theodore Logan

Views

2.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

I have only resized screenshots using image > image size with nearest neighbor (200%, 400%, 600% etc), I have never done it with other tools... So I would be curious if even if theory says that the result should be the same, comparing 400% upscale with NN interpolation using transform vs. image size.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

We would need to see the originals image before any resizing is done. Sizing with Nearest Neighbor will destroy any anti aliasing that original image may have had in the first place.  The discrepancy in stroke line thickness may be the results of the interpolation method. How did you create the stroke line the begin with. Many Photoshop tools do some anti aliasing.  You also fail to state when you scale down 50% if you used Nearest Neighbor. You know Nearest Neighbor will destroy anti aliasing it will not be creating an anti-alias effect. You need to create your art without any anti aliasing if you are going to be scaling the images down and up in size using Nearest Neighbor.  Interpolating an image loosed some image quality. Scaling down you need to discard some details, Scaling up you need to invent detail you do not have.

 

Using Nearest Neighbor is for hard edge image to begin with not antialiased edges.  Here is a ellipse stroked with a 4px hard round brush note the edges are not hard.

Capture.jpg

 

Here is the same ellipse stroked with a 4px pencil note no anti aliasing

image.png

 

The image will still change in quality downsizing and upsizing.  Here I down size 50% upsize 200% and downsized 50% and Upsized 200% so the imags is the sam size it begain.  It easy to see the difference in quality.

image.png

 

Use AI create vector art if you want to scale your art.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

Referring to the original post:

I would use for the Transform parameters X,Y,W,H  units pixels instead of inches.

Otherwise round off errors may happen

 Best regards --Gernot Hoffmann

.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

LATEST

If width and height are not the same percentage change not only rounding may come into play distortion will be in the resize. The width and height change must be constrained to keep the image current aspect ratio. Rounding is a math by product. If the changes are not a multiple of the current width and height  rounding will happen. You can not have fraction of a pixel. You have a pixel or not. 

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines