You have just finished setting up your brand new Raspberry Pi but when you boot up for the first time you wonder where the black border on the display comes from?

Fear not, young Raspberry Pi apprentice, there is a simple solution.

One thing to know before you start, because this article is from 2021 and the ground has moved: the black border it describes comes from the legacy graphics stack. Since Bookworm, Raspberry Pi OS uses the KMS driver, and on a modern HDMI monitor the Pi does not draw that border at all any more. If you are on a current image and still see one, read the last section first — the culprit is usually the screen, not the Pi.

Disable Overscan

First, let’s talk about the solution. And if you are interested (there is no harm to knowledge), I will give a bit of background that will help you remember if it was enabling or disabling overscan – I used always to mix this up.

Enter in the Terminal

sudo raspi-config

Go to “2 Display Options”, “D2 Underscan” and choose “No”. (On a current image that entry may not be there at all, because it belongs to the old display stack. If it is missing, skip to the last section.)

Finish and reboot.

But why?

It’s pretty confusing isn’t it? You select “Underscan” and in the next menu items, it says “Overscan”.

To understand this feature, we need to go back to the era of cathod-ray tubes (CRT), and yes, it’s been a while.

The Raspberry Pi can not only be connected via HDMI, but also has an analog FBAS/composite output. This can be used to connect it to a classic CRT monitor.

CRT monitors have the inherent problem that the visibility of the screen’s outer edges cannot be guaranteed. Depending on the device, the manufacturers concealed these areas, for example, through the housing, since a clean image was no longer guaranteed at the edges due to the tube curvature.

So, if the Raspberry Pi were to use the entire screen area, part of it would no longer be visible on analog monitors. The size of this area is not standardized.

Therefore, the Pi works with such a wide border around the image that all pixels are still visible even with a heavily cropped CRT monitor. With the digital output via HDMI, this problem doesn’t play a role since flat screens don’t have the overscan problem due to their technology.

Unfortunately, the Raspberry Pi does not automatically disable this safety feature when connected via HDMI.

That’s why you need to disable Overscan yourself.

If anyone knows why that hasn’t been set as a default, please let me know.

Back in 2021, Raspberry Pi Imager 1.6 let you tick a box to disable overscan while writing the card, which is what the screenshot below shows. That option is long gone from the Imager — the advanced settings there are now about the host name, the user, Wi-Fi and SSH.

On a current Raspberry Pi OS

Two things have changed since this was written.

The configuration file has moved. It is /boot/firmware/config.txt now, not /boot/config.txt, and the setting in it is:

disable_overscan=1

More often, though, the border on a current image is not the Pi’s doing. With the KMS driver the Pi sends a clean, full-size picture; if you still see a black frame around it, it is usually a television applying overscan of its own. The fix is then in the TV’s picture menu, under a name like “Just scan”, “Screen fit”, “1:1” or “Full pixel”, depending on the maker.

And on picframe3 there is nothing to set here at all. It renders straight onto DRM/KMS at the mode the screen asks for, so the old overscan border does not arise — if something looks wrong, picframe3 doctor lists the modes your screen actually offers, and display.mode names one if the automatic choice is not the one you want.

Conclusion

I have been told by readers that they spent hours searching for a solution to this black border problem.

Well now, you know how to fix this. Tell your friends!