BIT8IMG TOOL - convert images to 8bit console pictures

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
KKZiomek
Posts: 7
Joined: 27 Mar 2017 17:57

BIT8IMG TOOL - convert images to 8bit console pictures

#1 Post by KKZiomek » 25 May 2017 16:25

I know that sprite.exe and editor.exe used with 8bit pictures in the console exist, but carlos's utilities only allow for manual painting of the sprites inside the console window. My tool takes usual imagefiles and turns them into .spr files that can be displayed with carlos's sprite.exe program. Only .bmp files are supported FOR NOW, BUT I will add support for much more formats in the near future!

Here's a sample image of firefox's logo converted with my tool:

Image

And here is the readme file for usage and more info about the tool:

BIT8IMG.EXE By KKZiomek
Version 1.0 Build 003
(Used along carlos's sprite.exe)

Info:

I am sorry for the large size (106kB) of the tool, and about
the lack of support for other image formats like .png and .jpg.
They will be added in the near future along with code optimization
(because for now the code sucks honestly), and other cool features.
I will also consider changing image loading library, or even switching
completely to WinAPI to shrink the size of the program.

Usage (commandline helpfile output):

{
BIT8IMG.EXE v1.0 By KKZiomek
Commandline HELPFILE
Program build 003 - may crash rarely!

DESCRIPTION:
Creates console 8bit sprites from image files.
The only supported extension is only bmp for now.
Outputted spr files can be used with carlos's sprite.exe
in order to display them in the console from batch file.
Further alterations to the spr file can be made using
carlos's editor.exe.

USAGE:
The usage is very simple. Following commands exist:
BIT8IMG filename Converts "filename" image to 8bit spr file.
BIT8IMG help Displays this helpfile.

END OF HELPFILE.
}

Copyright (c) KKZiomek 2017
[If you modified the source and recompiled the tool, add information about it on the
top of this file. See license.txt for more details about modification]


Download:
https://mega.nz/#!ecgRnRhZ!NtZkJTte_r6u ... tq8pL4WslI


ENJOY!
KKZiomek

misol101
Posts: 384
Joined: 02 May 2016 18:20

Re: BIT8IMG TOOL - convert images to 8bit console pictures

#2 Post by misol101 » 25 May 2017 17:52

Nice :)

Any chance you could add output support for GXY files too? (used by gotoxy and cmdgfx)

KKZiomek
Posts: 7
Joined: 27 Mar 2017 17:57

Re: BIT8IMG TOOL - convert images to 8bit console pictures

#3 Post by KKZiomek » 26 May 2017 08:01

Of course I can. Is there any specification for gxy files? If you give me the format of gxy files I will do it, but expect it next week because I have important things going on over the weekend. :D

I will also try to add more input formats like .png and .jpg by then.

KKZiomek

misol101
Posts: 384
Joined: 02 May 2016 18:20

Re: BIT8IMG TOOL - convert images to 8bit console pictures

#4 Post by misol101 » 29 May 2017 03:35

KKZiomek wrote:Of course I can. Is there any specification for gxy files? If you give me the format of gxy files I will do it, but expect it next week because I have important things going on over the weekend. :D
Not really, but I'll try to provide a simplified one here. Gxy is a subset of the control codes used by gotoxy.exe. It is a human-readable (text) format, where control codes are preceded with \ . There is no header and no meta-data. The very minimal subset needed is:

Set color: \xx where first x is the foreground color 0-f, and second x is the background color 0-f (I know this is 'backwards' to how e.g. the color command puts it, but it's just how I like it). So, for example, \e4 is yellow text, dark red background.

Special characters: \gxx where xx is the hexadecimal ASCII value of the character to be written. If the character is not a special character, it can be written as-is. A simple approach that I use is to write SPACE, 0-9, A-Z, a-z as they are, and encode the rest of the characters. You could also skip encoding altogether, but the resulting file would be less readable in most text editors.

Transparent character: \- means this character should be skipped without writing it

Newline: \n starts next row of characters (cursor column will be the same as the start column for the first row written)


hello.gxy:

Code: Select all

\e4Hello\n\a2Cruel \f5World\g21
Would be printed as:
Hello
Cruel World!

in three different colors
Last edited by misol101 on 30 Oct 2019 17:10, edited 1 time in total.

KKZiomek
Posts: 7
Joined: 27 Mar 2017 17:57

Re: BIT8IMG TOOL - convert images to 8bit console pictures

#5 Post by KKZiomek » 01 Jun 2017 12:35

I just noticed your reply @misol101 . I will add the gxy support, hopefully by the end of the week, because I am busy often this week.

DQ2000
Posts: 13
Joined: 07 Aug 2019 17:26

Re: BIT8IMG TOOL - convert images to 8bit console pictures

#6 Post by DQ2000 » 15 Oct 2019 10:50

Can you add the normal console code?

Post Reply