Microsoft veteran explains Windows quirk that made videos play in Paint
- Reference: 1760537687
- News link: https://www.theregister.co.uk/2025/10/15/windows_paint_video_chen/
- Source link:
In a [1]post on Microsoft's Old New Thing blog, Chen explained that it's all about green screen technology and making the best of the limited resources available to the OS at the time.
Windows used a technique familiar to video production, chroma-keying. "The media player program didn't render the video pixels to the screen," he explained. Instead it rendered video pixels to a graphics surface shared with the graphics card and told the graphics card that whenever a green pixel was written to the screen, a video pixel from the shared graphics surface should be written instead.
[2]
"There are a few advantages to this approach," he explained.
[3]
[4]
First, the pixel format didn't need to be the same – you could specify that the shared graphics surface had a pixel format that matched the video, so no need for any pesky conversion. Second, the content could be updated without a full paint cycle, meaning video performance could remain brisk even if the rest of the user interface threads were crawling.
You could use two shared graphics surfaces and flip between them to avoid tearing and have the screen update at once for the entire frame.
[5]
However, things went awry when users took a screenshot from the media player and pasted it into Paint. Rather than the video frame, users would get whatever Windows had provided the graphics card to use for its overlay. "These special surfaces were called 'overlays'," said Chen, "because they appeared to overlay the desktop."
[6]Windows 95 was too fat to install itself so needed help from the slimmer 3.1
[7]Why Microsoft has the name of an old mouse hidden in its Bluetooth drivers
[8]Why Windows 95 left a handy power saving feature on the cutting-room floor
[9]Microsoft veteran's worst Windows bug was Pinball running at 5,000 FPS
"Your screenshot was a screenshot of the desktop screen, and it contains green pixels where the video would go."
Opening the image in Paint meant Windows sent those green pixels to the graphics card. However, if the media player was still running and the overlay was active, those green pixels would get replaced by the pixels of the video.
"The video card doesn't know that the pixels came from Paint. Its job is to look for green pixels in a certain region of the screen and change them into the pixels from the shared surface."
If you moved the Paint window so it no longer overlapped the media player, the true nature of the bitmap was revealed: "It's just a bunch of green pixels."
[10]
These days, content is now rendered to a full desktop image before being sent to the monitor, and the compositing process that once caused video to play in odd places and green pixels turning up unexpectedly is a thing of the past.
It's something to remember when looking at a television presenter who has made some poor wardrobe choices and appears partially transparent. Windows could also have a few issues in the early days of desktop video. ®
Get our [11]Tech Resources
[1] https://devblogs.microsoft.com/oldnewthing/20251014-00/?p=111681
[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aO_FFOn9xi7tYQe4a8qY5AAAARY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aO_FFOn9xi7tYQe4a8qY5AAAARY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aO_FFOn9xi7tYQe4a8qY5AAAARY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aO_FFOn9xi7tYQe4a8qY5AAAARY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2025/09/29/chen_windows_95_install/
[7] https://www.theregister.com/2025/09/17/chen_bluetooth_driver/
[8] https://www.theregister.com/2025/09/09/chen_windows_95_hlt/
[9] https://www.theregister.com/2025/09/09/dave_plummers_worst_windows_bug/
[10] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_offbeat/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aO_FFOn9xi7tYQe4a8qY5AAAARY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[11] https://whitepapers.theregister.com/
Re: when the answer comes right out of nowhere
Phone might be listening to conversations, transcribing them and then shipping to advertisers for targeting.
I also found many such coincidences.
That said I often say: "Oh man, I'd love to buy a lawnmover (or some other thing that I don't typically would use). I wonder which company has discounts right now." etc. I am yet to see an ad pop up with such a thing. Maybe they treat it as an outlier and remove from targeting.
Fun!
Ahh the bad old days... Even most newscasters can now wear green (or blue) --unless they have particularly old equipment .. they can also just use giant monitors and forego the green screen approach entirely these days too.
Re: Fun!
This is the future: https://www.youtube.com/watch?v=gUnxzVOs3rk
Combo of screens and unreal engine. Absolutely brilliant
Re: Fun!
With large-format mega-res monitors -- and a decent visibility angle -- they don't have to look off-screen to see the final composited video which lets them observe exactly to what they were gesturing. Of course, they still might out of habit/tradition.
Early MPEG cards did the same. Is this really "surprising" to anyone?
The early RealMagic MPEG decoder accelerators, and even WinTV cards, and some early GPUs worked in this exact way.
Show a particular colour. Have the video-out signal loop through the accelerator card... that card replaces any purple/green/whatever pixels in the image with the video stream it's trying to render.
0% CPU usage, the accelerator card does all the work, no complicated software or trying to pass more info down the very-limited ISA/PCI/VLB bus speeds of the time. With the advanced ones, they even detected the size of the overlay area to replace with video, and resized the video to fit (so I could resize my TV window to be in a tiny box in the corner of the screen while I got on with other things). The "TV app" was basically just an always-on-top purple window. You could just use Paint to do the same, or even a large box inside Write/Wordpad/whatever.
I've seen cards with literal VGA In/VGA Out that work that way, ones that used PCI bus mastering and DMA to do it, etc.
Pick up any old RealMagic or Hauppauge WinTV card and they work this way. I think early Voodoo's worked this way too.
when the answer comes right out of nowhere
This had confused me for so long I was talking to someone about it the other day and then this article comes out of nowhere with the answer to put it to bed