[Upstream Bug, unfixable] Pixels on canvas are misaligned

Having tech problems? Post them here and do not worry, there is always a solution for you.
porg
Posts: 210
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

[Upstream Bug, unfixable] Pixels on canvas are misaligned

Post by porg »

BUG IS CLOSED NOW AS UNFIXABLE, SUMMARY:
  • At any zoom level (via trackpad gesture or shortcut or GUI controls) selection-frame & ruler-markers are always perfectly aligned.
  • But the zoomed-up pixels on the canvas are misaligned. The pixels are not where they are supposed to be. They have a totally irregular offset which accumulates. Only every n-th pixel is aligned with the ruler/selection-grid.
  • Making reliable selection, cut, copy, paste operations is impossible that way.
  • The developer and some community members tried all possible configurations: It always works fine on newer Macs, and it just never works on the affected Mac.
  • GraphicConverter uses standard Apple technologies for rendering the canvas.
  • With a very high probability this is a bug in the graphics drivers of Macs of that generation and graphics card series (MacBookPro 15'', Mid 2014, NVIDIA GeForce GT 750M 2 GB) on macOS Big Sur. Maybe the graphics drivers on elder macOS versions still work fine in that regard with GraphicConverter, that was not tested.
I reported this bug to Apple under FB10511386

——— Original bug report ↓ ———

Use Case: You want to perform a pixel-exact selection.

Problem: When zoomed in, the selection border goes halfway through the pixels.
  • The visualization of the border box is not aligned with the pixel grid.
  • If you drag the selection boundaries, you see the offset accumulates (e.g. 10% per pixel), so only at every n-th pixel (e.g. every 10th pixel) the borderline aligns clearly with the visible pixels.
  • That way it is impossible to work pixel exact.
▶️ Watch video (1:10, 640 ×480px, 1.5 MB, Dropbox)

Environment
  • Graphic Converter 11.6.1
  • macOS 11.6.5-6 Big Sur
  • MacBook Pro, Retina 15" (Mid 2015)
  • NVIDIA GeForce GT 750M 2 GB
  • PNG of normal resolution (72dpi aka @1x)
  • On a normal resolution screen.
Please note Screenshot Story (Still frames from video)

Extending selection 2 not aligned to pixel grid.png
Extending selection 2 not aligned to pixel grid.png (69.53 KiB) Viewed 244 times
Extending selection 4 not aligned to pixel grid.png
Extending selection 4 not aligned to pixel grid.png (71.21 KiB) Viewed 244 times
Extending selection 5 finally aligned to pixel grid.png
Extending selection 5 finally aligned to pixel grid.png (69.28 KiB) Viewed 244 times
Last edited by porg on Thu Jun 30, 2022 1:21 pm, edited 6 times in total.
porg
Posts: 210
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by porg »

Prefixed the title with [Blocker Bug]
- Because reliable selection is a very rudimentary function of a bitmap image editor/utility, upon which almost other features rely upon!
- I expect no fix, not even an explanation. Just a first reaction please! Thanks!
User avatar
forum_adm
Site Admin
Posts: 1337
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by forum_adm »

The image is drawn with zoom by the Apple toolbox. Also, the selection frame.

The display is here correct:
Screen Shot 2022-04-19 at 08.07.49.jpg
Screen Shot 2022-04-19 at 08.07.49.jpg (175.29 KiB) Viewed 210 times
So, it is a macOS issues if there is an alignment issue in some special cases.
User avatar
forum_adm
Site Admin
Posts: 1337
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by forum_adm »

Please enable the following option.

GraphicConverter scales the image to the selected zoom ratio itself. The macOS has not to make any additional scaling for the display.
Screen Shot 2022-04-19 at 10.22.jpg
Screen Shot 2022-04-19 at 10.22.jpg (298.37 KiB) Viewed 209 times
porg
Posts: 210
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by porg »

1) I experimented with the setting "Use cached scaled image for exact display" ON and OFF for the same image.
Both viewing options are unsatisfactory in their own regard. See why:


Use cached scaled image for exact display ON.png
Use cached scaled image for exact display ON.png (248.06 KiB) Viewed 206 times
Use cached scaled image for exact display OFF.png
Use cached scaled image for exact display OFF.png (191.12 KiB) Viewed 206 times


2) So I very strongly hope to be able to use GraphicConverter with the supersmooth and performant native zoom on macOS Big Sur ("Use cached scaled image for exact display" being OFF) and still be able to make an exact selection without guesswork. What exactly are the conditions for the "alignment issue in some special cases" ? Could you be specific what to test for?

- Certain display dimension/resolution?
- Image dimensions? Certain size? Odd/even width/height?
- Certain image format? (I guess not b/c during runtime you render this as uncompressed 24bit+8bit alpha I guess)

- Maybe a misconfiguration of GraphicConverter on my behalf? What are the correct display preference values in GraphicConverter for having a MacBook Pro (Mid 2014, ) with an internal 15.4'' retina screen and an external Samsung 24'' S24D390HL?


3) Workaround / compromise for me would be to use caching for image scaling and zoom numerically and not via trackpad. Is there an option that trackpad zooming remains as fine as typically Mac, but only snaps at the full multiple supported zoom factors?

Use cached scaled image for exact display ON and zooming numerically.png
Use cached scaled image for exact display ON and zooming numerically.png (254.79 KiB) Viewed 206 times
User avatar
forum_adm
Site Admin
Posts: 1337
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by forum_adm »

Please set the interpolation to none. So, you will get sharp pixel borders. Also, it is faster.

I will check the trackpad issue.
porg
Posts: 210
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by porg »

Thanks for the hint. Tried that. Learnings:

1) "Use cached scaled image for exact display" OFF always leads to a misaligned grid regardless of the interpolation setting.
- Purely macOS bug? Should I file a bug at Apple? If so, what are the proper termini to through into it?
- Or could there still be a misconfig with my display options (resolution...?) which leads to a calculation error, hence that offset which accumulates?

2) With Interpolation NONE I get sharp pixels with all zooming methods (trackpad, numerical, cmd—+/-).

3) "Use cached scaled image for exact display" ON is:
- slow but still tolerable with shortcut-zooming (CMD—+/-)
- unbearably slow with trackpad gestures (zooming is slow (5-10secs beachball each gesture) and also dragging the selection boundaries is very sluggish)

Preliminary verdict: The typical workflow in Preview.app of a rough selection in totale view, then quickly zoom towards a selection edge/boundary, move it pixel exact, then pan to next edge/boundary or zoom out entirely, is not possible in an efficient AND reliable matter as it is in GC.

I really hope there is a solution to this. B/c I like GC a lot otherwise, it has a lot of huge efficiency benefits, and would like to buy it. But zoom & select is a key feature in a bitmap editor which needs to work fast AND exactly. Looking forward for an answer. Any hint appreciated. Willing to also reset or try preference-file you send me or whatever helps to determine what's going on to resolve this. Thanks
User avatar
forum_adm
Site Admin
Posts: 1337
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by forum_adm »

I changed now the trackpad support. It zooms to the predefined steps.

The zoom is here really fast with the old external trackpad.

I will change the zooming to the more modern scroll view magnification. But that requires a lot of internal changes and testing. That will be done for the version 11.7.
porg
Posts: 210
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by porg »

1) "Modern scroll view magnification" refers to a framework/technology which Apple offers for Mac apps?
a) Will this fix my issue (selection always aligned to pixel grid at all zooming levels, be it full multiples like 200% or any smooth floating point zoom like 513,21%)?
b) while still being amazingly fast, because running native and GPU accelerated?


Thanks for your snapping zoom feature efforts. Tested it.
These are my observations/recommendations:

2) GraphicConverter > Preferences > General > Display Content > Section Image
Omit the option "Zoom" and instead insert these two options:

Code: Select all

                       Zooming Engine: (•) Native   (on GPU, very fast, less accurate)
                                       ( ) Software (on CPU, always pixel exact display, slower)

Trackpad zoom snaps to fixed steps in: [ ] Native Zooming  [√] Software Zooming

UX design rationale: Smooth zooming is by far more desirable. Zoom snapping is only an "acceptable" compromise in combination with pixel exact display. Or an alternative for a minority of users or use cases.
Please no public release! Your users will notice this very basic function quickly and I predict you will get complaints!
Hence I propose making it optional per zooming engine. Defaults as depicted.

3) UX improvement regarding zoom snapping regarding rounding

Do not round up/down purely mathematically!
- Zoom in, in, in, then letting go of your fingers, and the last zooming rounding is again a small zoom-out is an irritating UX. The last rounding shall always be in the zoom direction!

So it should be:
- Zoom in, in, in, let go, last rounding is as a zoom in (even if it would be mathematically closer to zoom out).
- Zoom out, out, out, let go, last rounding is as a zoom out.

4) Performance is practically unacceptable

Zooming 5-100%: Instant
Zooming 100-500%: Noticibly laggy (1-5secs behind)
Zooming 500%+: Beachballs, GC hangs for a minute or longer, need to force quit it.
- JPEG, 1.4MB, 2448 x 3264 (8 Megapixels)
- Graphic Converter 11.6 on macOS 11.6.5
- MacBook Pro 15'' (Mid 2014, NVIDIA GeForce GT 750M with 2 GB VRAM, 16GB RAM)

Something in your algorithm seems to get exponentially worse when zooming in.
I have to crash reports. Want them by email?

Honest feedback: This is not useable as-is. I really hope that 1) "Modern scroll view magnification" for v11.7 is what I hope it to be.
User avatar
forum_adm
Site Admin
Posts: 1337
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany

Re: [Blocker Bug] Selection border not aligned with pixel grid - Impossible to reliably tell which pixel selected

Post by forum_adm »

Thanks for your feedback.

I made the zoom gesture steps now an option.

Regarding the values. The Apple zoom gesture just return to the app a factor for the new zoom value. I just apply that.
Screen Shot 2022-04-22 at 09.53.jpg
Screen Shot 2022-04-22 at 09.53.jpg (322.07 KiB) Viewed 172 times