You are not logged in.

#1 2017-08-18 08:09:48

itti
Member
Registered: 2007-06-01
Posts: 77

[xrandr] render in higher resolution then scale down?

Hi,

i have a somewhat strange question but my hope is that someone around here can maybe help me or point me into the right way.

So the situation is that I foolishly bought a 27" 4k lcd monitor a few days ago. It's native resolution is 3840x2160. Turns out this is not an ideal resolution to work with when dealing primarily with text.

Because I didn't want to bother with various GUI toolkits and application specific HiDPI modes and/or scalings I chose the pragmatic way to drive the screen in a lower resolution. So right now I set the output to 2560x1440. This is much better on the eyes concerning font sizes,  UI elements etc. but of course it is somewhat blurry.

A friend of mine bought the same monitor and uses it as a second screen for his Macbook. Apparently Mac OS has some simple "scaling" settings which seem to work the impossible magic of scaling the output to something looking like my 2560x1440 but without it getting blurry. I analyzed a screenshot of my friends Mac desktop and found out that pixel wise it is rendered in 5k (5160x2880) but the screen is still driven with it's native resolution (3840x2160). It seems that Mac OS somehow does something akin to anti aliasing as it is done in 3D applications. It renders an up-scaled (2560x1440) image using a higher resolution (5k) before compressing it down to the chosen output resolution (4k).

Now I'm trying to emulate this with xrandr's "--scale" and "--panning" options. This is what I got so far (my primary screen is 1080p and sits left of the 4k screen):

xrandr --output eDP1 --auto --output DP1 --mode 3840x2160 --panning 5120x2880+1920+0 --scale 1.3334x1.3334 --right-of eDP1

This gives me a 5K output compressed down to 4K. But that's not what I want. I want to render 2560x1440 but scaled to 5K and then compress that down to 4K. Is something like that even possible?

Offline

#2 2017-08-18 08:39:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,650

Re: [xrandr] render in higher resolution then scale down?

Uhm... You are literally describing the HiDPi setup which you are attempting to avoid. So instead of trying to circumvent that with a strange pseudo solution (if just scale the output with no consideration of anything to an absurd resolution and then scale down, you are not going to suddenly have bigger text, as evident)

And the image will be blurry either way, because most modern monitors can't really deal with not being driven at their native resolution without things getting blurry, if you try to scale that beforehand that won't matter since the monitor will still drive a subpar resolution

I suggest you read https://wiki.archlinux.org/index.php/HiDPI and you will notice that you won't have to deal with all that much, depending on the applications you are using.

The fact that you have a second non HiDPi screen further complicates things, since you can't have different X Server DPI values for different screens.

Last edited by V1del (2017-08-18 09:02:46)

Offline

#3 2017-08-18 10:41:20

itti
Member
Registered: 2007-06-01
Posts: 77

Re: [xrandr] render in higher resolution then scale down?

Maybe I wasn't specific enough. What I want to do is to render a 2560x1440 desktop scaled up to 5120x2880 (that would be factor 2x2) but I want to output this on my native resolution of 3840x2160 (that would be factor 0.75x0.75). My reasoning was that compressing down a larger image should be less blurry.

Also with regard to UI scaling options I want my UI to be unscaled for the 1080p screen.

Last edited by itti (2017-08-18 10:42:55)

Offline

#4 2017-08-18 14:37:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: [xrandr] render in higher resolution then scale down?

To be frank, I think you are barking up the wrong tree.  As V1del points out, driving an LCD display at anything other than the native resolution is a (bad) compromise.  The final output can only be at the native resolution; it *will* get rescaled someplace; and scaling in the display is probably the worst place to do so.

My hunch is that you would get much better results if you were to take a good look at the arrangement of your subpixels and ensure that hinting is optimized. https://wiki.archlinux.org/index.php/Fo … on#Hinting


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB