joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.74k stars 381 forks source link

Pixel perfect not so perfect #2571

Open BridgeHeadland opened 3 years ago

BridgeHeadland commented 3 years ago

Hi! Could you guys add an output to a future update? I would appreciate if you added a pixel perfect like output that inflates, for example the 320x200 resolution to, for example 3456x2160, instead of 3200x2000, if DOSBox-X is displayed on a 4K monitor.

Wengier commented 3 years ago

@ant-222 is the author of the pixel-perfect feature and may want to take a look when he has time.

DaVince commented 3 years ago

"Pixel perfect" refers to the fact that it performs integer scaling. That is, it increases the size to an exact multiple of the resolution - like 3200x2000 being exactly 10 * 320x200. This is done so that each original pixel takes up an exact amount of pixels (10 for each 1 pixel in this case) without having imperfections that would show up with non-integer scaling.

Take, for example, the resolution you mention. If you divide 3456 by 320, you will find that the scaling factor there is 10,8 which is not an exact number. That means that most original pixels can be stretched to take up 11 pixels but once every so often a pixel is going to have to take up 10 instead, making it look, well, ugly. Maybe not for a scaling factor of 10 but it's usually immediately noticeable at smaller scaling factors.

To visualize what I mean, I've resized a screenshot once by exactly 2 and another time by 2.3.

2x (pixel perfect eg. integer scaling): image

2.3x (non-integer scaling): image

I hope you can see what is happening and why exact integer scaling is the way to go, even if you lose a little bit of screen real estate. More info over at https://github.com/ant-222/DOSBox-pixel-perfect

BridgeHeadland commented 3 years ago

"Pixel perfect" refers to the fact that it performs integer scaling. That is, it increases the size to an exact multiple of the resolution - like 3200x2000 being exactly 10 * 320x200. This is done so that each original pixel takes up an exact amount of pixels (10 for each 1 pixel in this case) without having imperfections that would show up with non-integer scaling.

Take, for example, the resolution you mention. If you divide 3456 by 320, you will find that the scaling factor there is 10,8 which is not an exact number. That means that most original pixels can be stretched to take up 11 pixels but once every so often a pixel is going to have to take up 10 instead, making it look, well, ugly. Maybe not for a scaling factor of 10 but it's usually immediately noticeable at smaller scaling factors.

To visualize what I mean, I've resized a screenshot once by exactly 2 and another time by 2.3.

2x (pixel perfect eg. integer scaling): image

2.3x (non-integer scaling): image

I hope you can see what is happening and why exact integer scaling is the way to go, even if you lose a little bit of screen real estate. More info over at https://github.com/ant-222/DOSBox-pixel-perfect

Keen 4K

All this I am aware of, and personally I do not care that the pixels are not so perfect or identical with each other. All I want is to run thse softwares in an inflated pixel perfect output just to fill the screen (expect the black sidebars; it's 16:10 softwares, not 16:9), even if it looks ugly, and it does not look quite as bad if the image is then inflated to 4K, as you see. Another thing: I know pixel perfect is not aspect ratio. :)

DaVince commented 3 years ago

Ah, then I apologize for overexplaining :) It sounds like you might want the openglnb option instead.

BridgeHeadland commented 3 years ago

Ah, then I apologize for overexplaining :) It sounds like you might want the openglnb option instead.

The openglnb option in DOSBox-X stretch the whole picture to the current Windows resolution, 3840x2160 in my case.

DaVince commented 3 years ago

And with aspect=true?

BridgeHeadland commented 3 years ago

And with aspect=true?

If I set the aspect to true, I get the resolution of 2880x2160 (I have 4K monitor, you know), which is like the aspect ratio. Not very inflated pixel perfect, I think.

BridgeHeadland commented 3 years ago

Will the borderless pixel perfekt be fixed in any update in the near future? Are there enough requests in it at all?

Wengier commented 3 years ago

Will the borderless pixel perfekt be fixed in any update in the near future? Are there enough requests in it at all?

Further updates to the pixel-pixel perfect feature are certainly possible, but of course they only happen when @ant-222 has time.