Jump to content

Pixel grid rendering problems when zooming


Recommended Posts

I noticed that at certain zoom levels the pixel grid is rendered unevenly. This gives the image a 'speckled' appearance as if it had light grey dots all over it.

The effect is easily seen when using Ctrl+Scroll on the mouse wheel to zoom.

Attached is a zoomed version of the problem, at a zoom level around 480%.

 

I noticed this with and without hardware acceleration.

 

To reproduce:

1. Start with new image (white background) and pixel grid enabled

2. Ctrl+Scroll mouse until around 400%-500% zoom (I was at 448% but visible at other zoom levels)

--> pixel grid has speckled appearance

 

Issues/Expectations

 

It seems that there are a few issues that cause this effect:

1. when two pixel grid lines overlap they get darker

 -> expected: pixel grid should have a uniform color

2. adjacent pixel grid lines do not necessarily have their pixels in the same position, causing a seemingly random (Moiré-like) pattern

 -> expected: pixels in adjacent lines should line up

3. the pixel grid spacing varies, probably due to rounding. The attached example shows a spacing of either every 4 or 5 pixels.

 -> expected: hard to avoid. perhaps a different zoom mode that only allows zoom levels that result in a uniform pixel size?

 

Otherwise, perhaps solid lines could be used below a certain zoom level to avoid the dotted line Moiré effect. 

 

Diagnostics

Application    paint.net 4.0.21 (Final 4.21.6589.7045)
Build Date    Montag, 15. Januar 2018
Install type    Classic
    
Hardware accelerated rendering (GPU)    True
Animations    True
DPI    96,00 (1,00x scale)
Language    en-US
    
OS    Windows 7 Enterprise Service Pack 1 x64 (6.1.7601.65536) (0x4)
.NET Runtime    4.0.30319.42000
Physical Memory    16.263 MB
    
CPU    Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Speed    ~2712 MHz
    Cores / Threads    4 / 8
    Features    DEP, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, XSAVE
    
Video Card    NVIDIA Quadro M2000M
    Dedicated Video RAM    4.034 MB
    Dedicated System RAM    0 MB
    Shared System RAM    7.875 MB
    Vendor ID    0x10DE
    Device ID    0x13B0
    Subsystem ID    0x80D5103C
    Revision    162
    LUID    0x0001CBCC
    Flags    None
    Outputs    2
    
Video Card    Intel(R) HD Graphics 530
    Dedicated Video RAM    192 MB
    Dedicated System RAM    0 MB
    Shared System RAM    1.632 MB
    Vendor ID    0x8086
    Device ID    0x191B
    Subsystem ID    0x80D5103C
    Revision    6
    LUID    0x0001CEE3
    Flags    None
    Outputs    0

 

pixelgrid.png

Edited by g t
Link to comment
Share on other sites

Thanks for the reply. I understand that the uneven spacing between grid lines is probably unavoidable.

 

However, issue #1 (that grid pixels get darker when plotted on top of each other) seems like a minor bug.

 

Issue #2 (that grid pixels do not line up) would seem to me to be avoidable too (probably depends on the algorithm), so any 'errors' would at least be distributed evenly across the grid.

 

An attached zoomed in image shows these two problems more clearly, so the upper horizontal line starts at offset 1 and the lower at offset 0.

 

If this solution is too difficult, I would suggest again using solid lines at non-integral zoom levels.

 

The uneven grid rending is very distracting when editing zoomed images as it appears the image has 'randomly' scattered light grey pixels on an otherwise white background.

pixelgrid2.png

Link to comment
Share on other sites

  • 4 months later...

I've got a fix for issue #1 that'll be in the upcoming 4.1.2 update. This was pretty easy to fix by rendering to a layer* first at full opacity, and then composing the layer on top of the canvas with the desired opacity. Compare this to 4.1.1 and earlier where the grid pixels were all drawn directly to the canvas at the desired opacity -- so, as you saw, grid pixels that overlapped would get darker.

 

* a Direct2D layer, not a Paint.NET layer :)

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 3 years later...
On 9/27/2018 at 12:51 AM, Rick Brewster said:

I've got a fix for issue #1 that'll be in the upcoming 4.1.2 update. This was pretty easy to fix by rendering to a layer* first at full opacity, and then composing the layer on top of the canvas with the desired opacity. Compare this to 4.1.1 and earlier where the grid pixels were all drawn directly to the canvas at the desired opacity -- so, as you saw, grid pixels that overlapped would get darker.

 

* a Direct2D layer, not a Paint.NET layer :)

Sorry to revive this old thread but i either never noticed it or this issue seems to be back at least as of 4.3.12? i haven't checked in a while as i rarely work with pixelart. Having grid enabled still seems to generate some funky patterns when zooming out past a certain point:
2089847942_pixelgrid.png.984ddf706f086de32ca64dcd26ef1fbc.png  (increased contrast for the sake of visibility)

Not sure if it's the same scope as the original issue but i reckon an easier fix would be to stop rendering the grid at smaller zoom levels entirely, say, under 600% zoom, similar to how photoshop does it, showing it only when you actually go in up close.

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

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...