generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: any gif frame pixel decoders in lua?

Previous Thread :: Next Thread 
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
03 Apr 2017 07:48 PM
to convert gif format to { frame, frame, frame... } where frame is { delay, pixeldata, pixeldata, pixeldata, pixeldata... }
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Apr 2017 07:49 PM
no idea.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Apr 2017 01:43 AM
It would be impractical to do it in Lua. If you're doing this off Roblox just use a C/C++ library and extend it through Lua.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
04 Apr 2017 03:15 PM
ik i was wondering if there were libs on reading this in lua
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:24 PM
so no libs at all that can do

local frames = gif:getFrames()
local data = {}
for i, frame in ipairs( frames ) do
local info = {}
data[ i ] = info
for k, pixel in ipairs( frame:getPixels() ) do
info[ k ] = pixel
end
end
print( jsonencode( data ) )
?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:29 PM
im sure there are
just find them yourselves or find one in C/C++ and just write a wrapper

It shouldn't even take more than an hour
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:30 PM
Yourself*

I think I have 1 too many chromosomes
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:30 PM
idk much about decoding binary xddd
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:31 PM
also is there a way to get a text editor to show pure binary instead of unicode characters so i can copy and paste it and decode it myself somewhere else?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:32 PM
Get a hex editor.

And by 'write a wrapper' I mean just that, I don't literally mean write one yourself I'm saying find an existing one.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:33 PM
idk anything about watever u said :D
Report Abuse
VegasGoldenKnights is not online. VegasGoldenKnights
Joined: 03 Apr 2008
Total Posts: 78577
05 Apr 2017 11:33 PM
Call23re2 made that.
https://twitter.com/call23re/status/830906190607634432

At the time he didn't have gif. Idk if he finished it or not


If you're seeing this post, it means I'm either dead (leaving behind a very fabulous looking corpse) or my soul has been captured by pixies!
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:34 PM
So I just googled "gif-decoder c++" and found this
github/alxhill/gif-decoder

Just write Lua functions from C/C++ that extend that API to Lua.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:35 PM
That one I sent you looks like it sucks.
Although there are plenty out there
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:36 PM
ima have to look that up too, i dont know much about C or C++ (i can write a good bit of it but i dunno how to make it work with other languages)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:43 PM
Here's the pure minimum you need to really do to get it to work with Lua:

// prints all args to stdout
int print(lua_State* L)
{
// params are on the lua stack which can be fetched via lua_to*, lua_check*, etc. (check reference for a list of all of them)
int numparams = lua_gettop(); // number of arguments passed
for (int idx = 1; idx <= numparams; idx++) {
const char* str = lua_checkstring(L, idx); // converts the value on the current stack frame at `idx` to a string and returns it (lua errors if it can't be converted)
puts(str);
if(idx < numparams)
puts("\t")
}
return 0; // returns 0 values to lua
}

inb499%ofthispostiscensored
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:43 PM
tl;dr:
all Lua C functions only have 1 param (the lua state) and all args passed to it will be on the stack. the return value is the number of values the function returns.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:45 PM
wouldnt it just be easier though to convert it already in lua, like i could copy the bin to a module script and then do the decoding there?
and that would be like the most basic way to do it
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:49 PM
No, because that means you're going to have to learn the GIF format, and doing all that in Lua would be really slow also.

Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:50 PM
it would take longer for me to understand how to do it in C/C++ e.e i have to like start all over
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:51 PM
I'm not saying to do it all in C/C++ I'm ###### ### # ##### LIBRARY that does it FOR YOU EXTEND SAID LIBRARY to lua via the C API
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:52 PM
I'm not saying to do it all in C/C++
I'm saying
GET A LIBRARY that does it FOR YOU
EXTEND SAID LIBRARY to lua via the C API

print(roblox) ---> cancer
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:54 PM
ye but i havent got around to being able to understand whats being returned from each files functions, that example had like many different files and theres a lot going on with needing interaction from other files
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Apr 2017 11:57 PM
You don't need to understand what they're doing, you just need to understand their API.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Apr 2017 11:58 PM
i found this but if i figured out how to read and convert this data i would be super happy
wiki pedia
/wiki/GIF#Example_GIF_file
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image