Monday, April 1, 2013

KWin Magnifier Plugin Improvements

Over the years I've been in KDE, one thing has always bothered me, as I am sure many users feel the same way as I. The topic that comes up the most, and honestly, is the most important of all other developments in KDE, is that of pixel perfection. 

It is really bothersome when I've seen so many developers worry about less pressing things like porting to this new "Qt 5" and "QML" nonsense. Or adding more features, porting to other platforms, etc.

But what about refining existing basics? I think that is more important, every developer I know simply does not care about pixel perfect alignment, as if they've got more important things to do with their time.

However, there is a bit of a problem - not every developer has vision as fantastic as mine and are not as keen at picking out these glaringly obvious sore thumbs of GUI elements that could be as much as 1 pixel misaligned!

So it finally struck me! What if every developer could easily see these obvious issues? If they can see them, they will fix them and hold off every release until every one of these pixel misalignment issues are fixed.

The past two weeks I've been working on revamping the KWin Magnifier plugin, a plugin traditionally used to help those who are disabled. But then again, I guess revamping it to help those developers that are disabled (because they cannot see things at a subpixel level, sadly) is just as much of an aid as the Magnifier's original purpose.

What exactly did I do? Well, the magnifier now shows, upon hovering over an area, the alignment and values of the subpixels of your monitor. This was actually quite complex to do, as I had to dig into a lot of X code in querying the display type and calculating and rendering the result properly.

This is especially important because each display type, e.g. CRT, OLED, LCD have different designs of their layout of pixels on the screen. So in order to properly match this with the image before it is rendered to screen, one needs to take this into account.

Before, using regular KWin Magnifier:

After, using the new KWin SubPixel Magnifier:

I believe the results speak for themselves, really. From now on I expect every developer to stop what they are doing and use this useful plugin to eliminate all of these types of bugs.

Don't forget to report your bugs, and most importantly..mark anything that is rendered incorrectly, anything that is off by 1 or more pixels as HIGH PRIORITY and RELEASE BLOCKER, so that we can all work hard and eliminate these horrendous sights.