Paint.NET v3.5: "Improved rendering quality when zoomed in"

Brad Wolff recently wrote a comment on my earlier post, “Change of plans – here comes Paint.NET v3.5” :

“Rick – You mentioned that 3.5 will have “Improved rendering quality when zoomed in”. Can you elaborate on this? My fear is that we will end up having to look at the blurred mess that Windows Picture Viewer displays when zoomed in. Please tell me I am wrong!” — Brad Wolff

Brad, you’re wrong 🙂 And it’s in a good way. Paint.NET v3.5 does not use bilinear or bicubic resampling when zooming in, which is the cause of the blurred mess that you mention in Windows Picture Viewer. In fact, it is now using the same resampling algorightm for zooming in that has been employed for zooming out: rotated grid supersampling. The old resampling method was the simple nearest neighbor one. It was very fast, especially when paired with a lookup table for avoiding a per-pixel division operation. The image quality problem with nearest-neighbor is very apparent between 101% and 199% zoom levels: you end up with a moire of 1-pixel wide and 2-pixel wide samples and it just looks awful. With supersampling, we are able to achieve a smoothed look that does not blur as you zoom in.

Here’s an example from Paint.NET v3.36, where I’ve drawn a normal circle and some scribbles with the paintbrush tool. The zoom level was then set to 120%:

Here’s the same, but in Paint.NET v3.5:

At this zoom level, each pixel from the image should be drawn as “1.2” pixels on-screen. In v3.36, this entails drawing 4 pixels at 1-pixel width, and then a fifth pixel at 2-pixel width. Put another way, every 5th pixel is doubled in size. In v3.5, each source pixel ends up with a uniform width and the overlaps are smoothed together in a much more pleasing manner. (This is done on the y-axis as well — replace ‘width’ with ‘height’ in the preceding paragraph and it’s also true.) It will still maintain a “pixelated” appearance as you continue zooming in, which is what you want, but the edges between samples will look smoother.

This does come at a performance cost, but I believe it’s worth it. It also scales well with multiple cores, so it’s something that will be faster with each new CPU upgrade. I’ve also experimented with using bilinear and bicubic resampling — it’s fun, but too expensive and blurry. You would need an 8-core system for it to be comfortable.

12 thoughts on “Paint.NET v3.5: "Improved rendering quality when zoomed in"

  1. Rick Brewster says:

    Eugenio — I’d like to get an alpha out before Christmas (December 25th), but I just haven’t had as much time to work on it as I’d like. Right now I’m spending a lot of time optimizing the new selection renderer.

  2. ShK_828 says:

    wow, this looks much better, and i guess 3.5 will just be a “update/better” version of 3.36 but not quite 4.0?

  3. Gamer_World14 says:

    Wow, I cannot wait until 3.5 comes out! That would be an awesome Christmas gift for everyone if the time allows. Keep up the awesome work Rick! Looks like the supersampling you are doing is working out great for zooming in and from what I can tell, it looks a whole lot clearer.

  4. Zwicky says:

    Will this rotated grid supersampling be incorporated into Paint.NET for say, resizing/enlarging a selection? I find that has a similar problem at times.

  5. spritemoney says:

    Cannot wait for the latest paint.net to come out, in july 2009 i may upgrade to a mac, so i’m buying some stuff so i can run paint.NET, cuz it’s the best photoshop alternative out there.

  6. James says:

    PLEASE make this optional, nearest neighbour when enlarging is useful for pixel art, not everyone used PDN for editing large photos, I use it for DS spriting in which there is to be no antialiasing and I fear it would make it hard. Of course very useful for other stuff, just make it optional, please.

  7. Rick Brewster says:

    James — It doesn’t get blurry, like with bilinear/bicubic resampling. Everything still looks properly pixelated, it’s just that the edges of the enlarged “pixels” will be smoother on non-integral zoom levels. This is especially noticable at zoom levels between 101% and 199%. For integral zoom levels, those being an even multiple of 100% (e.g., 200% 300% 400% etc.), the display will be identical to before.

  8. James says:

    What do you mean by: “non-integral zoom levels”? I think I get what you’re saying, I will be able to comment once I see this in action. Thanks for your response.

  9. Rick Brewster says:

    James — What I mean by “integral zoom level” is an integer multiple of 100%. That means 100%, 200%, 300%, 400%, 500%, …, 1600%. At these zoom levels, all the image pixels can be drawn with an even number of screen pixels (e.g., at 300% each image pixel is drawn using a 3×3 pixel square on the screen). This will not be affected in Paint.NET v3.5.

    A “non-integral zoom level” would be like shown in the screenshot above. At these zoom levels it is not possible to draw every source image pixel using the same number of screen pixels. At 120% zoom, each image pixel requires a 1.2 x 1.2 rectangle to be drawn on screen, but that isn’t possible. Thus, in the current version of Paint.NET, this is done by drawing 4 rectangles of 1-pixel width, followed by 1 rectangle of 2-pixel width. It looks terrible.

  10. ecards says:

    This will be a very cool update.

    The only thing we’ll be missing then are GPU based acceleration for this.

    But Photoshop just got rid of nearest neighbor zoom late this year so Paint.Net is not far behind…

Comments are closed.