Converting greyscale pictures

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

Post Reply
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Converting greyscale pictures

Post by Timendus »

Does anyone know of a simple command line tool that converts greyscale images (BMP, or whatever) to two layers of data (preferably .db statements)? Nothing funky like that iStudio or graphics studio or whatever it's called, I just want to give it a filename as a command line parameter and have it spit out the bytes, either in a file or back to the console.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

My friend wrote a java program that does this with interlaced data, do you want me to ask him for it?

And Spencer's assembler has the abilty to just include a bitmap, but I think it is only black and white.
Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

There is that old program by Ian Graf i think? Gray83 or GCP or something?

Wouldnt be too hard to whip up a tool?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Isn't early morning going to surport this?
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

I used gcp, it worked very well.
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Hmm, I'm currently fighting with GCP, but it doesn't want to open my pictures... Ah, I can't use lower case characters in my filenames, just brilliant... and the "a" switch to disable the bugged adjust screen still flashes the adjust screen which makes my DOS box go fullscreen and black... :?

EarlyMorning is going to support this, but all my pictures are different sizes, so I'd have to make a new spritesheet for each picture, and I wasn't able to load/copy'n'paste my pictures into it, so I'd have to redraw them. EarlyMorning is very good for RPG development, but a bit over the top for my goals. I just want to include a directory full of images, without having to redraw them to two seperate layer images all the time.

Anyway, I could use either of these options, but none really satisfy me... Maybe I'll write my own tool.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I wanted to write a proper tool to scan my program source for specific includes and add the two layer bitmap data there, but I was lazy :). I wrote a quick and dirty PHP script that goes through a directory with 256 color bitmaps and for each bitmap it goes through the data twice with str_replace to create two new bitmaps; one with lightgrey>black and darkgrey>white and one with lightgrey>white and darkgrey>black.

I added a call to this script to my Latenite build script for this project, so now when I press F5 in Latenite all my greyscale images get converted to two layer images which Brass then includes before PTI runs my program to show the pretty new imagery 8)

Now THAT's a proper debug cycle :P

If you want to do the same, unzip this to your Latenite/Templates/Projects folder:
http://timendus.student.utwente.nl/docs ... mplate.zip

!! Warning: Requires that you have a PHP interpreter properly installed on your computer, and hasn't been tested with bitmap images that weren't generated with MS Paint. In short: it sucks. But it works like a charm :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Hahaha very nice stuff ... and you did it pretty quickly too! :).

Now you can stop getting on Ben's case about including such an option :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Posted: Sun 5-3-2006 14:48
Posted: Sun 5-3-2006 16:47

Less than two hours appearantly 8);)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Post Reply