How to resize DOSBox screenshots without losing quality

Updated: August 16, 2024

A brief intro for those of you wondering what this is about. DOSBox is an emulator for MS-DOS, an operating system from before the Windows 95 era. Y'know, DOS. Great. It lets you take screenshots of games and programs running inside the emulator window.

I've written about DOSBox many times before, as early as 2006 when I created this website. Then, I crafted a number of articles that highlighted my success in reviving old DOS-era games, the 80s and 90s classics. The best thing, DOSBox lets you emulate both IPX and Serial connectivity, so you can even play multiplayer games on your LAN. Recently, I also wrote a tutorial that shows how to resize/rescale the DOSBox window so that you can play the old, ancient titles with good clarity on modern HD/UHD displays. And that, finally, brings the question. If you take screenshots of these old games in say a 1920x1440px window, do you get same-size images? The answer is no. So how do we fix that? Aha.

Teaser

A bit more background, 4:3 vs 16:10

I've been playing a bunch of DOS games in the past few months, most notably the superb F-16: Combat Pilot. While gaming, I took some screenshots (by default, Ctrl + F5), and I discovered that while my game window was big and clear, the saved PNG files came out at a measly 320x200px. Unusable on a modern computer.

Playing the game

Game window, after the necessary DOSBox tweaks - 3K display.

Original image

A screenshot; quite small, no.

You can enlarge these images in many different ways. For instance, use the resize function in any one image editor like say GIMP, IrfanView or Okular. But most of the time, the images will turn out fuzzy, because the programs will try to interpolate the information between pixels, and come up with something that didn't exist in the DOS era: extra pixels. Therefore, the goal is to resize these images without making them look cheap or blurred.

But then, the question is, what aspect ratio do you use?

The "original" DOS resolution was, for the most part, 320x200 pixels. But the actual monitors had the 4:3 aspect ratio. That means you don't really get "square" pixels. In other words, DOSBox screenshots will look funny (squashed) when simply, proportionally enlarged on modern displays. To wit:

Resize, 16-10 ratio

Look at the artificial horizon indicator. It's not a perfect circle. It should look like this:

Resize, 4-3 ratio

I created both these images by resizing the original 320x200px screenshot. The "problem" is that modern displays do not take into account the non-square nature of pixels, and so you end up with the weird squashing, even though, technically, 320x200 translates into the lovely 16:10 aspect ratio.

And so, if you want to resize images, you actually need to "break" the proportional aspect and force the 4:3 ratio for your screenshots. We will do that shortly, the only question is, what tool should one use?

ImageMagick convert

I found the ideal tool for this task to be the command-line utility called convert, part of the ImageMagick open-source image manipulation suite. The program is available for a variety of operating systems, so if you're a Windows person, you're in luck. In Linux, the installation and usage are trivial, as you most likely get the utility as part of your distribution.

To convert, open a terminal window (or cmd), and run:

convert INPUT -filter point -resize 1900x1440! OUTPUT

For example:

convert flight_032.png -filter point -resize 1920x1440! big.png

We instruct convert to use the point filter - no interpolation, no extrapolation, and we use a 4:3 ratio. You can choose any size you like, say 800x600, 1920x1440, and so forth. Whatever suits you best. Now, the really elegant part is, the enlarged images won't be much bigger than the original.

I noticed, for the F-16 simulator, the images usually go from 6-8 KB to about 20-25 KB. Not much. Using any other conversion method (program), I would get images at least 3-4x times bigger, and with the undesired fuzziness. For example the image I used right below, downscaled from 1920x1440px to 800x600px in a regular image viewer weighs 108 KB, roughly four times more than the bigger image, which itself is a much enlarged version of the DOS screenshot, 36x increase at only 3x size penalty. Some wicked mathematics, right there.

Example of resizing

Conclusion

You can enjoy old DOS games without compromising on any of the modern perks. DOSBox lets you have the fun of "new" technology (networking and big displays), so you don't need any special hardware to play these ancient titles. The only "problem" is that screenshots come out tiny.

The way around it is to use ImageMagick to enlarge the images. Use the point filter to recreate the glory of big pixels, and be mindful of the resolution tricks. While technically the aspect ratio is 16:10, you want things visually shown as 4:3, so do some numbers before you resize your files. Finally, if you have lots of them, you can create a script that will run through all of the images, one by one. Should you need help with that, ping me, and perhaps I can create another little guide. Well, there you are. Enjoy, and see you around.

Cheers.