Jump to content




[Off-computer] Easy image converter


10 replies to this topic

#1 RichardG867

    IC2 Developer

  • Members
  • 178 posts

Posted 15 May 2013 - 12: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.

#2 Tjakka5

  • Members
  • 256 posts

Posted 15 May 2013 - 01: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(?)

#3 nutcase84

  • Members
  • 708 posts
  • LocationIn My Lonely Little Computer Corner

Posted 15 May 2013 - 02:06 PM

Wow. +1 awesomesauces for you.

#4 PSanf420

  • Members
  • 10 posts

Posted 15 May 2013 - 03: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.


View PostTjakka5, on 15 May 2013 - 01:50 PM, said:

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

#5 RichardG867

    IC2 Developer

  • Members
  • 178 posts

Posted 15 May 2013 - 04:12 PM

If the background isn't getting cleared, your images have non-zero alpha as transparent

#6 PSanf420

  • Members
  • 10 posts

Posted 15 May 2013 - 04:28 PM

View PostRichardG867, on 15 May 2013 - 04:12 PM, said:

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.

#7 RichardG867

    IC2 Developer

  • Members
  • 178 posts

Posted 15 May 2013 - 04:37 PM

Oh, I get it now. Transparent pixels are set to whitespace, although I may add a background color option.

#8 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 18 May 2013 - 04:07 PM

I guess I know why you used java for that :P

Anyways, good job, I love it :)

#9 lordphoenixmh

  • Members
  • 9 posts

Posted 06 June 2013 - 11:13 AM

You said a full 8x6 monitor is 82x40, but what about 2x3, or 4x6?

#10 superaxander

  • Members
  • 595 posts
  • LocationHolland

Posted 07 June 2013 - 04:19 AM

View Postlordphoenixmh, on 06 June 2013 - 11:13 AM, said:

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))


#11 Blockbreak9000

  • New Members
  • 2 posts
  • LocationBavaria, Germany

Posted 07 June 2013 - 11:42 AM

Another good thing to do is to set the text scale to 0.5 so you get double the size (4x resolution).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users