Jump to content
You must now use your email address to sign in [click for more info] ×

Nearest neighbor scaling of text and layers


Recommended Posts

AP is great, but for pixel art it's lacking a very basic feature: a nearest neighbor/hard pixel scale mode option when scaling layers, objects and text. 

Right now AP is not suitable for retaining the look of pixel art when working with layers and text, and would make a great addition since it's already so good at everything else!

Link to comment
Share on other sites

Hi machineboy and welcome to the forum,

Does turning on Nearest Neighbour in Preferences > Performance > View Quality achieve what you are after?

And when exporting, ensure you choose Nearest Neighbour in your output format too.

Win10 Home x64   |   AMD Ryzen 7 2700X @ 3.7GHz   |   48 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Wacom Intuos Pro

Link to comment
Share on other sites

But turning on nearest neighbour allows manipulation of layers using a nearest neighbour algorithm - is that not what is required?

If not, then I guess I need an example.

Win10 Home x64   |   AMD Ryzen 7 2700X @ 3.7GHz   |   48 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Wacom Intuos Pro

Link to comment
Share on other sites

Setting the view quality to Nearest Neigbour does not affect layer scaling. Also, it's impossible to create non-aliased text with AP without a proper nearest neighbour mode. Raserizing a pixelart image layer smooths it to oblivion, so unfortunately in its current state it's not possible to work with pixel art layers and text in Affinity (Pixelate filter is not viable since it doesn't remove the aliased pixels which ruins pixel art).

An example included, with

1. Original sprite

2. Scaled up with yucky aliasing

3. Horrible mush when rasterizing layer

scaled_test.png

Link to comment
Share on other sites

6 hours ago, machineboy said:

Also, it's impossible to create non-aliased text with AP without a proper nearest neighbour mode. Raserizing a pixelart image layer smooths it to oblivion, so unfortunately in its current state it's not possible to work with pixel art layers and text in Affinity

It is my belief (possibly wrong, of course) that text in Photo is a vector format. As such, it would not become pixels in the document until you export to a raster format (PNG, etc.). At the time you export I would think that the nearest-neighbor resampling option would help you.

(Note: Unlike Designer, Photo always displays in pixel mode, as it is intended for working with raster images. That can make text appear pixelated when you zoom in Photo, because the display is pixel mode. Until it is exported I don't think you'd really know how it will look, and again, the resampling you choose during export may be a determining factor. Again, my understanding may be flawed :))

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.3, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.3.1

Link to comment
Share on other sites

  • 9 months later...
On 7/1/2019 at 3:37 PM, machineboy said:

Setting the view quality to Nearest Neigbour does not affect layer scaling. Also, it's impossible to create non-aliased text with AP without a proper nearest neighbour mode. Raserizing a pixelart image layer smooths it to oblivion, so unfortunately in its current state it's not possible to work with pixel art layers and text in Affinity (Pixelate filter is not viable since it doesn't remove the aliased pixels which ruins pixel art).

An example included, with

1. Original sprite

2. Scaled up with yucky aliasing

3. Horrible mush when rasterizing layer

scaled_test.png

Totally agreed and looking forward for this problem solved~

Link to comment
Share on other sites

I did a quick test, and even scaling down to 50% results in mush. I turned on all the pixel snapping options, and switched to Nearest Neighor.

This is what I would expect (not attainable in Affinity - I had to resort to other alternatives):

good_scale50.png.29782bd7cd1264e680628d21898db68c.png

This is Affinity Photo:

bad_50_aff.png.e0912417326202a184b7d61340528433.png

The top one is scaled layer (non-destructive). It is bad. This is a reduction of the original by 50%  - and any image / pixel editor should pass this test with flying colours in my opinion: it is a simple reduction of the larger character to half pixels. Affinity fails badly here.

I tested this for fun in a number of image editors. The results are interesting:

- Photoshop (CS2), Gimp, and Affinity Photo produce similar 50% scale down results: all a mess.

- Irfanview and ProMotion NG deal a little better with this move. (not shown here)

- Krita and PhotoLine generate a good result (identical to the first one shown above).

The third one is the rasterized layer version in Affinity Photo, and it is completely unacceptable.. Not only is the transparency automatically trimmed (even when Rasterize without the trim function is selected), for some inexplicable reason Affinity Photo decides to resample the graphic, and the result is an anti-aliased mess.

Anyway, definitely room for improvement as far as Affinity Photo is concerned.

Link to comment
Share on other sites

The text tool also lacks nearest neighbor render mode.

 

However Affinity Publisher is the best pixel-perfect supporting publishing software I ever met. 👍But even in publisher, when switch to in-editor PHOTO , the image will unexpectedly turned blured.😂

Edited by ElementLee
Link to comment
Share on other sites

  • 1 month later...

I agree that this is a problem. Here is another example, this time working with icons. I'm attempting to resize a large vector down to a 16x16 icon. Using the Pixelate filter I got an excellent result (unsurprising, because the icon was designed to be resizable, and the original art was 16x16), but I can't get Photo to output that excellent result to an actual icon-sized file.

Original vector icon:
Original Vector icon

Pixelate filter applied.
Pixelate Filter

Cropped and aligned closely to a 16x16 grid. Currently sized at 840x840.
Cropped and aligned to a 16x16 grid.

LtBqUI6.png

No Affinity Photo; that's not what 'Nearest Neighbor' means. 😞
Bad resizing.

Imgur Album link

Edited by Myrddin Emrys
Adding link to album.
Link to comment
Share on other sites

  • 1 year later...

Just adding my vote to this. Loving Affinity Photo generally but, as someone who works with a lot of pixel art, this feature is sorely needed.

Ideally we need to ability to turn on 'nearest neighbour' as a raster option per layer (aka After Effects), failing that there at least needs to be the option to select which algorithm is used globally for rasterizing layers. 

Link to comment
Share on other sites

  • 3 months later...

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.