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

[Off-computer] Easy image converter

Started by RichardG867, 15 May 2013 - 11:06 AM
RichardG867 #1
Posted 15 May 2013 - 01:06 PM
You guys may have seen this converter, but you need GIMP and Matlab to do yourself. Not cool.
This one is all made in Java, no extra dependencies. Just open it to run.

Get it now!

It will ask you for the source image, destination file, the ComputerCraft image size (a full 8x6 monitor is 82x40) and whether to stretch or fit. Use pastebin to get the destination file in your computers and paintutils to draw it:
image = paintutils.loadImage("imageFileNameHere")
paintutils.drawImage(image, 1, 1)

Simple as that.

Disclaimer: Uses color approximation algorithms stolen from WorldEdit, in turn stolen from a StackOverflow question.
Tjakka5 #2
Posted 15 May 2013 - 02:50 PM
Soo…
I can get a MLP picture in my minecraft?
You sir, have made my day…

EDIT: Ha, just notest that you're THE RichardG, that's quite… special(?)
nutcase84 #3
Posted 15 May 2013 - 03:06 PM
Wow. +1 awesomesauces for you.
PSanf420 #4
Posted 15 May 2013 - 04:48 PM
I made a little program, and a couple of images to do most of the work for the user.

Check this out: http://pastebin.com/shjRbR5J

Type "pastebin get shjRbR5J setup", then run setup, then type "display ftb_logo" or "display star". The images were made for a bank of 8x6 advanced monitors. I reused the wrap code from the reddit post. Now people can put their images on pastebin, and people can use this little program to display them. The program isn't quite perfect, as it isn't clearing the background color, but I think that's mostly becuase I used png files for my source data.


Soo…
I can get a MLP picture in my minecraft?
You sir, have made my day…

EDIT: Ha, just notest that you're THE RichardG, that's quite… special(?)

YES YOU CAN! Do the above then type "pastebin get nNnQQYcq mlb_logo" then type "display mlb_logo" Check this out http://i.imgur.com/Rr4MXZ9.png
RichardG867 #5
Posted 15 May 2013 - 05:12 PM
If the background isn't getting cleared, your images have non-zero alpha as transparent
PSanf420 #6
Posted 15 May 2013 - 05:28 PM
If the background isn't getting cleared, your images have non-zero alpha as transparent

Yup. In the CC files for the images, all the transparent pixels in the originating image where converted into whitespace. Not a big deal. I just added a couple lines of code to the script to set the background color to black, and clear the screen.
RichardG867 #7
Posted 15 May 2013 - 05:37 PM
Oh, I get it now. Transparent pixels are set to whitespace, although I may add a background color option.
jesusthekiller #8
Posted 18 May 2013 - 05:07 PM
I guess I know why you used java for that :P/>

Anyways, good job, I love it :)/>
lordphoenixmh #9
Posted 06 June 2013 - 12:13 PM
You said a full 8x6 monitor is 82x40, but what about 2x3, or 4x6?
superaxander #10
Posted 07 June 2013 - 05:19 AM
You said a full 8x6 monitor is 82x40, but what about 2x3, or 4x6?
Just connect it(this for when it's on the left just replace left with another side if you want) and run this program

local x, y = peripheral.call("left", "getSize")
print(tostring(x)..”x"..tostring(y))
Blockbreak9000 #11
Posted 07 June 2013 - 12:42 PM
Another good thing to do is to set the text scale to 0.5 so you get double the size (4x resolution).
jakejakey #12
Posted 20 October 2016 - 02:35 PM
Dropbox link is broken :/
If anyone has the program, would you mind uploading it to mediafire or something?
Bomb Bloke #13
Posted 20 October 2016 - 02:59 PM
http://www.computercraft.info/forums2/index.php?/topic/19044-bitmap-images/

http://www.computercraft.info/forums2/index.php?/topic/23056-gif-api/