Jump to content
machineboy

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!

Share this post


Link to post
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   |   16 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Huion 1060 Plus

How I make GIFs >>> ScreenToGIF (Windows only, Open Source, Portable, ~600kB)

Share this post


Link to post
Share on other sites

I think he is looking for something more like Document -> Resize Document, but for only the selected layer.

 

@machineboy, consider also Filters -> Distort -> Pixelate...  and welcome to the forums!

Share this post


Link to post
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   |   16 GB RAM   |   1TB SSD   |   nVidia GTX 1660   |   Huion 1060 Plus

How I make GIFs >>> ScreenToGIF (Windows only, Open Source, Portable, ~600kB)

Share this post


Link to post
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

Share this post


Link to post
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

Windows 10 Home, version 1909 (183623.476),
   Desktop: 16GB memory, Intel Core i7-6700K @ 4.00GHz, GeForce GTX 970
   Laptop:  8GB memory, Intel Core i7-3625QM @ 2.30GHz, Intel HD Graphics 4000 or NVIDIA GeForce GT 630M
Affinity Photo 1.8.3.641 and 1.8.4.650 Beta   / Affinity Designer 1.8.3.641 and 1.8.4.650 Beta  / Affinity Publisher 1.8.3.641 and 1.8.4.651 Beta.

Share this post


Link to post
Share on other sites
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~

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites

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.


×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.