Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to capture and convert a 80x25 text screen with colors to an image format?

238 views
Skip to first unread message

Rod Pemberton

unread,
Oct 1, 2012, 12:51:08 PM10/1/12
to

I thought it'd be nice to have an image of the output of one of my programs.
So, I'd like to capture an 80x25 text screen with colors in MS-DOS (BIOS
calls) to a standard image format. I mean an image format like jpeg, gif,
tiff, png, or bmp that can be converted or resized with programs like
Photoshop or GIMP. The format doesn't really matter as long as it's a
supported type. In the end, I'll probably convert to jpeg or png.

I'm assuming the program would need to read the screen's text and colors,
and convert each character of the text to an image format using the BIOS
font for each letter of the text.

Does anyone know of utilities or code to do so?

I just had the idea and I haven't searched for such a program yet, so please
don't be hostile to me if they are easy to find.


Rod Pemberton


Marven Lee

unread,
Oct 1, 2012, 12:59:17 PM10/1/12
to

"Rod Pemberton" wrote:
> I thought it'd be nice to have an image of the output of one of my
> programs.
> So, I'd like to capture an 80x25 text screen with colors in MS-DOS (BIOS
> calls) to a standard image format. I mean an image format like jpeg, gif,
> tiff, png, or bmp that can be converted or resized with programs like
> Photoshop or GIMP. The format doesn't really matter as long as it's a
> supported type. In the end, I'll probably convert to jpeg or png.

Why not run the program in Bochs, a dos window or other
emulator and get a screen capture using the print-screen key or capture
the the window using alt-print-screen combination? You could then
paste the screen or window capture into an application such as
Photoshop. That's assuming you are using Windows, I'm not sure
if other OSes support screen capture with the print-screen key.

Just did some googling and there is a DOS TSR that can take
captures...

http://pixelmetrics.com/Snarf/index.htm


--
Marv


Richard Bonner

unread,
Oct 1, 2012, 1:47:11 PM10/1/12
to
Rod Pemberton (do_no...@notemailnotz.cmm) wrote:

> I thought it'd be nice to have an image of the output of one of my programs.
> So, I'd like to capture an 80x25 text screen with colors in MS-DOS (BIOS
> calls) to a standard image format. I mean an image format like jpeg, gif,
> tiff, png, or bmp that can be converted or resized with programs like
> Photoshop or GIMP.
(Snip)

> Does anyone know of utilities or code to do so?
>
> Rod Pemberton

*** I use Screen Thief.

If you can't find it, e-mail me.
--
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

Ivan Shmakov

unread,
Oct 4, 2012, 12:04:58 AM10/4/12
to
>>>>> Marven Lee <marv...@gmail.com> writes:

[Cross-posting to news:comp.windows.x, while keeping
Followup-To:.]

[...]

> I'm not sure if other OSes support screen capture with the
> print-screen key.

For the systems using the X Window System for graphics, xwd(1)
should do the trick. (The resulting image should be readable by
GIMP, http://gimp.org/, ImageMagick, NetPBM, etc.)

Typically, there is no "system-wide" screen (or window) capture
key binding for such systems, but certain GUI environments
provide one anyway.

> Just did some googling and there is a DOS TSR that can take
> captures...

> http://pixelmetrics.com/Snarf/index.htm

The home page reads:

--cut: http://pixelmetrics.com/Snarf/ --
Snarf captures full-screen DOS graphics, [...]
--cut: http://pixelmetrics.com/Snarf/ --

I haven't tried it myself, but I'm not that sure that it is
capable of capturing /text mode/ screens, which is (AIUI) what
the OP has requested.

IIRC, the VGA (EGA) text modes (including mode 3 = 80 x 25) are
memory-mapped to 0xB8000 (= B800:0000.) Once the respective
memory area (which is 80 x 25 x 2 = 4000 bytes long) is dumped
to a file, one can drop the attribute bytes and use pbmtext(1)
[1] to convert it to an image.

Alas, pbmtext(1) is strictly monochrome. (Perhaps there should
be ppmtextega(1) and pgmtextmda(1) just as well.)

For the font, Terminus [2] would be my choice. (Unless the DOS
software in question alters the video adapter's font to contain
any application-specific characters, that is.)

[1] http://netpbm.sourceforge.net/doc/pbmtext.html
[2] http://terminus-font.sourceforge.net/

--
FSF associate member #7257

Steve

unread,
Oct 4, 2012, 9:18:32 AM10/4/12
to
"Rod Pemberton" <do_no...@notemailnotz.cmm> writes:
>
>I thought it'd be nice to have an image of the output of one of my programs.
>So, I'd like to capture an 80x25 text screen with colors in MS-DOS (BIOS
>calls) to a standard image format. I mean an image format like jpeg, gif,
>tiff, png, or bmp that can be converted or resized with programs like
>Photoshop or GIMP. The format doesn't really matter as long as it's a
>supported type. In the end, I'll probably convert to jpeg or png.
>
>I'm assuming the program would need to read the screen's text and colors,
>and convert each character of the text to an image format using the BIOS
>font for each letter of the text.

Hi,

Well, I thought you could just run the program in mode 0FH (16)
and use a graphics capture program. That is the EGA 16 color
graphics mode that the BIOS supports with 80 x 25 text. But
testing here shows that some programs do strange things. And
background colors are not supported on the machine tested.
That was using standard MS-DOS text routines and ANSI.SYS.
Bog standard DOS text with no backgound color should then
work if your program is that simple.

If you use the default colors (ick), you can run the program
in a window under Windows or OS/2 and do a screen capture.
That would not use the standard fonts if that matters.

Full up would require reading the EGA or VGA colors in use,
determine the current screen resolution, locate the in use font,
and convert the text and attributes to graphics. You could
simplify this by assuming defaults for some or all of these.

Regards,

Steve N.


Franc Zabkar

unread,
Oct 8, 2012, 5:10:55 PM10/8/12
to
On Mon, 1 Oct 2012 17:47:11 +0000 (UTC), ak...@chebucto.ns.ca (Richard
Bonner) put finger to keyboard and composed:

>*** I use Screen Thief.

I found the DOS version here:
http://www.phatcode.net/res/194/files/st204f.zip

However, the readme.txt refers to a Reference Section which is not
included in the ZIP. Do you know where I can download it?

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.

Richard Bonner

unread,
Oct 12, 2012, 8:06:43 AM10/12/12
to
Franc Zabkar (fza...@iinternode.on.net) wrote:

> On Mon, 1 Oct 2012 17:47:11 +0000 (UTC), ak...@chebucto.ns.ca (Richard
> Bonner) put finger to keyboard and composed:

> >*** I use Screen Thief.

> I found the DOS version here:
> http://www.phatcode.net/res/194/files/st204f.zip

> However, the readme.txt refers to a Reference Section which is not
> included in the ZIP. Do you know where I can download it?

> - Franc Zabkar

*** It's in the ST.doc file. If you don't have it, e-mail me.

Franc Zabkar

unread,
Oct 14, 2012, 1:41:00 AM10/14/12
to
On Fri, 12 Oct 2012 12:06:43 +0000 (UTC), ak...@chebucto.ns.ca
(Richard Bonner) put finger to keyboard and composed:

>Franc Zabkar (fza...@iinternode.on.net) wrote:
>
>> On Mon, 1 Oct 2012 17:47:11 +0000 (UTC), ak...@chebucto.ns.ca (Richard
>> Bonner) put finger to keyboard and composed:
>
>> >*** I use Screen Thief.
>
>> I found the DOS version here:
>> http://www.phatcode.net/res/194/files/st204f.zip
>
>> However, the readme.txt refers to a Reference Section which is not
>> included in the ZIP. Do you know where I can download it?
>
>> - Franc Zabkar
>
>*** It's in the ST.doc file. If you don't have it, e-mail me.

Thanks, I found it.

ftp://217.219.3.12/Soft-Bank/SoftWare/Graphic/MAKEGIF/ST.DOC

James Harris

unread,
Oct 16, 2012, 9:57:32 AM10/16/12
to
On Oct 1, 5:47 pm, "Rod Pemberton" <do_not_h...@notemailnotz.cmm>
wrote:

> I thought it'd be nice to have an image of the output of one of my programs.
> So, I'd like to capture an 80x25 text screen with colors in MS-DOS (BIOS
> calls) to a standard image format.  I mean an image format like jpeg, gif,
> tiff, png, or bmp that can be converted or resized with programs like
> Photoshop or GIMP.  The format doesn't really matter as long as it's a
> supported type.  In the end, I'll probably convert to jpeg or png.
>
> I'm assuming the program would need to read the screen's text and colors,
> and convert each character of the text to an image format using the BIOS
> font for each letter of the text.

How about writing the raw screen memory to a disk file? That would
keep the code you would need in your programs very simple.

I found there is a BSAVE "format" that could be used. It is basically
just a small header then the memory.

http://en.wikipedia.org/wiki/BSAVE_%28graphics_image_format%29

Then you would only need one program to convert any such image files
to PNG or Jpeg. There may be programs to do that already that you
could run under DOS.

James

Rod Pemberton

unread,
Oct 17, 2012, 6:28:23 AM10/17/12
to
"James Harris" <james.h...@gmail.com> wrote in message
news:27c29bba-7230-42a4...@l18g2000vbv.googlegroups.com...
> On Oct 1, 5:47 pm, "Rod Pemberton" <do_not_h...@notemailnotz.cmm>
> wrote:
...

> > I thought it'd be nice to have an image of the output of one of my
> > programs. So, I'd like to capture an 80x25 text screen with colors
> > in MS-DOS (BIOS calls) to a standard image format. I mean an
> > image format like jpeg, gif, tiff, png, or bmp that can be converted
> > or resized with programs like Photoshop or GIMP. The format
> > doesn't really matter as long as it's a supported type. In the end,
> > I'll probably convert to jpeg or png.
> >
> > I'm assuming the program would need to read the screen's text and
> > colors, and convert each character of the text to an image format
> > using the BIOS font for each letter of the text.
>
> How about writing the raw screen memory to a disk file? That would
> keep the code you would need in your programs very simple.

I considered what was required to do so. I also considered doing it, if
nothing else was available to do the job. I suspected that it must've been
done to capture screens of DOS games. There are at least three posted
solutions posted that should work. I didn't try ScreenThief. I did try
both SNARF in RM MS-DOS and Print-Screen for WinSE. Both work.

SNARF captured just what was on the text screen, i.e., no border, with text
colors, using the BIOS text font. I used it in RM MS-DOS. So, it's not
limited to a Windows XP DOS console. The only slight issue was the output
format was BMP. BMP doesn't seem to be very widely supported. Although,
one program did convert it.

The Print-Screen captures everything on the Windows screen, including the
console window. I.e., the image must be trimmed. The DOS console in WinSE
uses a Windows font, which I didn't want. You can change the font, but I
didn't know which was the BIOS font ... The issue with Print-Screen is that
it copies to the Windows clipboard. You must paste it into a graphics
program. I don't know if all of them or just some of them accepts clipboard
data. The clipboard can only save to a file in some special 'clp' format.
Fortunately, I have a few graphics programs installed. Unfortunately, most
aren't working due to a corrupted/restored registry a few years back. So,
they need to be reinstalled. However, I don't use graphics programs that
much to fix it ...

I don't have much experience with graphics formats, like after 1990 or so.
I'm familiar with a few formats for early 8-bit machines. I considered
maybe learning something about BMP or PNG, maybe JPG, or whatever raw image
format is needed for VESA/VBE or VGA/SVGA. From what I've seen when I was
programming the text video code for my stalled OS project, some of the video
formats for "IBM" (x86 based) PCs are similar to formats for early non-x86
PCs (Amiga, Commodore, Apple, etc.).


Rod Pemberton



Richard Bonner

unread,
Oct 28, 2012, 10:00:21 AM10/28/12
to
Rod Pemberton (do_no...@notemailnotz.cnm) wrote:

> "James Harris" <james.h...@gmail.com> wrote:

> > On Oct 1, 5:47 pm, Rod Pemberton wrote:
> > > I thought it'd be nice to have an image of the output of one of my
> > > programs. So, I'd like to capture an 80x25 text screen with colors
> > > in MS-DOS (BIOS calls) to a standard image format.
(Snip)

> > How about writing the raw screen memory to a disk file? That would
> > keep the code you would need in your programs very simple.

> I considered what was required to do so. I also considered doing it, if
> nothing else was available to do the job.
> I did try both SNARF in RM MS-DOS and Print-Screen for WinSE. Both work.

> SNARF captured just what was on the text screen, i.e., no border, with text
> colors, using the BIOS text font. I used it in RM MS-DOS. So, it's not
> limited to a Windows XP DOS console. The only slight issue was the output
> format was BMP. BMP doesn't seem to be very widely supported. Although,
> one program did convert it.

*** That is odd. .bmp was (is?) used by Windows. Are screen backgrounds
(wallpaper) still in .bmp format? If so, perhaps Windows PAINT might be
able to convert to .gif or .jpg.

As a DOS user, I have dozens of programs that can handle a wide variety
of formats and so sometimes get called upon by others to convert image
formats.


> I didn't try ScreenThief.

*** SCREEN Thief will output in .gif, .tif, .pcx or .bmp. I have it
output to .pcx because it's 24-bit and my NeoPaint software can handle it.

As detailed in the documentation, SCREEN Thief captures by:

"...secretly reprogramming the interrupt hardware to a different
set of vectors. When a program steals the keyboard or timer
interrupt it no longer gets first pick, but a fake hardware
interrupt generated by SCREEN Thief's resident code. This
technique works in all but a few rare instances. Another
implication is that, with some restrictions, screens can also be
captured under Microsoft Windows even though SCREEN Thief is a
DOS-hosted program."


> The Print-Screen captures everything on the Windows screen, including
> the console window. I.e., the image must be trimmed.

*** Can you not request a full screen terminal window?


> The DOS console in WinSE uses a Windows font, which I didn't want. You
> can change the font, but I didn't know which was the BIOS font ...
> The issue with Print-Screen is that it copies to the Windows clipboard.
> You must paste it into a graphics program.
(Snip)
>
> Rod Pemberton

*** I don't recall what you wanted to do with the final screen image,
Rod, but as an alternative you might try Gerald Monroe's GRABBER. It
outputs to an executable which makes it great for sending screen shots to
others.

Here is one I did on October 4th of this year:

http://www.chebucto.ca/~ak621/Images/DR_DOS-Screen.exe

It shows my C-drive root directory listing as displayed by Loren
Blaney's COLOR DIR program, along with my custom prompt.

Spartacus

unread,
Nov 13, 2012, 5:54:16 AM11/13/12
to
It is one thing to be a stupid idiot, then there is you redefining the
concept.


Rod Pemberton

unread,
Nov 14, 2012, 5:53:15 AM11/14/12
to
"Spartacus" <Spar...@invalid.invalid> wrote in message
news:k7t8ru$tel$2...@speranza.aioe.org...
> [...]

Wrong group. Wrong thread.

Did you forget which group to post to?
You need to lay off the sauce.

> It is one thing to be a stupid idiot, [...]

Apparently, you still haven't looked up "projection"
in the psychological sense.

> [...] then there is you redefining the concept.

Yes, I redefined your definition of idiocy for your benefit,
since it was clear you needed a really thorough meaning...


So, pewb, let us know when you're homeless,
cuz I like sarcastic/cynical humor ...


Rod Pemberton


Dr J R Stockton

unread,
Nov 14, 2012, 4:07:16 PM11/14/12
to
In comp.os.msdos.misc message <k5m115$857$1...@speranza.aioe.org>, Wed, 17
Oct 2012 06:28:23, Rod Pemberton <do_no...@notemailnotz.cnm> posted:
I think you have a valid idea, capturing the characters and using the
screen font, or capturing a graphic screen buffer directly, with the
caveat that something written for proper DOS may be incompatible with
modern Windows.

My program shower.pas/shower.exe, /inter alia/, captures the current
text screen, saves it, and replaces it with another.

And AFAICS my program delta.pas/delta.exe overwrites one character's
glyph (ASCII 127 ?) in the OS with something more like a DELTA, showing
how to read it. With those, it should not be unduly difficult to encode
as BMP, and Wikipedia can tell you that.

CAVEAT - delta is so old that it has no date; and shower has a non-
ISO8601 date.

But, if necessary, I can probably test them in DOS 3.3.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; WinXP.
Web <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links.
PAS EXE TXT ZIP via <http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
0 new messages