This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
InputUsername's profile picture

Image converter(-ish)

Started by InputUsername, 04 January 2014 - 01:46 PM
InputUsername #1
Posted 04 January 2014 - 02:46 PM
Hello everyone! Today I made an image conversion program called conv.

No, this program will not convert CC images to PNG, JPEG or any other image format. I'm sorry if I have misled you.

The normal version of the program will convert a stand-alone 'paint' image to a file that will draw the image when run. Don't worry, there will be a backup of the original image in the root directory, called /.backup_<name>.

Image files other than those created by the standard paint program are not supported yet.

How to use:
Spoiler
conv <file>

To restore the original image from a backup:
conv <file> -r

Download:
Spoiler
pastebin get vVi4Hspj conv
pastebin.com/vVi4Hspj

Changes:
SpoilerNormal version:
1.0 - wrote the entire program

Special edition:
1.0 - changed the normal version into a special edition; optimized/compacted the code.

Special edition (suggested by ElvishJerricco):
SpoilerHow to use:
conv <input> <output>

Download:
pastebin get CRvRbntW conv
pastebin.com/CRvRbntW

Media:
SpoilerA video showing how conv works: (might be unavailable)
[media]http://youtu.be/SZACKEOxXZg[/media]

As always, if you encounter any errors or if there are things you would like to have in the program, be sure to tell me.
Edited on 05 January 2014 - 06:07 AM
oeed #2
Posted 04 January 2014 - 04:26 PM
Oh I see, so it convert the image to a program which prints the image, nice idea and looks easy to use. Next thing would be nft support I guess.
ElvishJerricco #3
Posted 04 January 2014 - 10:24 PM
rather than having the .backup file, I feel it makes more sense for the user to specify both the input and output file like most command line programs. conv [in] [out]
Edited on 04 January 2014 - 09:24 PM
InputUsername #4
Posted 05 January 2014 - 06:20 AM
Oh I see, so it convert the image to a program which prints the image, nice idea and looks easy to use. Next thing would be nft support I guess.
I'm on it. Now I have to figure out how .nft files are stored.

rather than having the .backup file, I feel it makes more sense for the user to specify both the input and output file like most command line programs. conv [in] [out]
Done:
http://pastebin.com/CRvRbntW
pastebin get CRvRbntW conv_special
It's even shorter than the regular version.
Edited on 05 January 2014 - 06:28 AM