UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Image / NSImage – getting weird 'sub-pixel' like artifacts

Forums > SwiftUI

Hello - been trying to figure this one out the last day or so.

I have an image that I am displaying and even if the scale / frame size exactly matches the original I am getting a weird (almost sub-pixel like display - when at 1X or maginified to any above 2X, 5X, 16X). Interpolation is .none

I took the same image / JPEG and exported to both JPEG and PNG from Photoshop and had no issues with those versions.

I also tested some strict checkerboards of B&W and in color and had no similar issues.

Do I have a cursed JPEG of some sort?

Zoom in on these in Preview or Photoshop to see... Chrome blurs/interpolates on zoom in.

one with weird splits (original JPG - screenshot is PNG) Weird split of some singular pixels in left and right halfs

exported JPG from Photoshop (normal / solid pixels singletons - screenshot is PNG) Expected singular pixel display

general UI at the moment (is a remake of an old GUI I did for JPEGTRAN back in like 2005... trying to learn SwiftUI) Cursed UI

2      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.