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

The HLTI Format (Haddock's Lua Table Image Format)

Started by HaddockDev, 23 October 2016 - 07:49 PM
HaddockDev #1
Posted 23 October 2016 - 09:49 PM
Well, my internet went out so I don't have a full post, but I will be updating it.

Meet HLTI.

HLTI is a format that I've been working on for a bit, and it is 100% a good idea! (not)
Remember the title? Remember how it mentioned Lua tables? Remember how it mentioned image format?
Yeah, do the math. What comes out? One giant file full of Lua tables.

This is currently VERY SLOW, and VERY UNOPTIMIZED! If your converting a image from paint to HLTI,
  • It takes a minute to convert from paint in an emulator :(/>
  • It makes a 80 kilobyte file if you don't specify the width and height when your converting from paint (even more when your running it on a monitor, as without width and height it uses the screen width and height) And when I say big, I mean big.
  • It has to do everything, ONE BY ONE! Every pixel in paint is 6 lines in a Lua table. Brackets and all (4 lines without counting brackets) So that means it just crawls through the conversion process. A lua table contains the X, Y, the Type (only color at the moment), and the Color which is under BackgroundColor.
tl;dr nothing to jump up and down in excitement about
ScreeniesRendering an image

Another one


Converting from paint (Compressed to uncompressed, basically) (Don't mind the error)

How do I get this? Via pastebin, of course!
HLTIView (view images) pastebin get gyGhgsxM hltiview
HLTIPaint (convert paint to HLTI) pastebin get kDe9nFRf hltipaint

How do I incorporate this into my program(s)?
There is currently no API. I am working on one at the moment to make your lives easier. Technically there is one (look at the programs i've provided) but you need to get this working yourself.

But whenever I do release this, please just give credit and I won't complain.
Edited on 23 October 2016 - 08:14 PM
H4X0RZ #2
Posted 23 October 2016 - 09:53 PM
So this basically is like the normal paint format, but a lot bigger and slower? I get that it might've been a nice learning experience but are there any advantages over using the standard, or another image format?
HaddockDev #3
Posted 23 October 2016 - 10:01 PM
So this basically is like the normal paint format, but a lot bigger and slower? I get that it might've been a nice learning experience but are there any advantages over using the standard, or another image format?
Well, not really. You do have flexibility (lets say, I add text for example) but a huge disadvantage is that if somebody makes another variant of this, viewers cannot use the new variant because they have a viewer that doesn't support it. It was mainly just a lil "make me better at lua" project more than anything.

Lets say user Bob creates a variant of this that allows use of Lua scripts.
Bob posts his image, saying its a game, providing proof and all that jazz.
People download the image, view it with a non supported viewer, and well they go back to the thread to complain.
Bob then says you need a custom viewer.
People download the viewer, and they get to play their game.
Edited on 23 October 2016 - 08:06 PM
CrazedProgrammer #4
Posted 24 October 2016 - 12:39 AM
Great satire.
Lupus590 #5
Posted 24 October 2016 - 08:28 AM
Lets say user Bob creates a variant of this that allows use of Lua scripts.
Bob posts his image, saying its a game, providing proof and all that jazz.
People download the image, view it with a non supported viewer, and well they go back to the thread to complain.
Bob then says you need a custom viewer.
People download the viewer, and they get to play their game.

Bob should have written on his thread that everyone would need the special viewer on his thread before people complained. Perhaps Bob should have read my tutorial on writing a good post for your program? [/shameless_plug]
LDDestroier #6
Posted 24 October 2016 - 01:37 PM
This format seems a lot like the format I use for PAIN, but not as optimized. And the PAIN format is already not very optimized.