Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411426 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 10:44:10 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Any interest in a stream going over Gif Encoding / LZW compression in C?
Pages: [1]
Print
Author Topic: Any interest in a stream going over Gif Encoding / LZW compression in C?  (Read 2113 times)
ProfessorSil
Level 0
*


View Profile
« on: October 26, 2019, 04:45:05 AM »

Hey everyone,

So recently I took on the task of implementing a system to record and export GIFs directly from our game (https://store.steampowered.com/app/1103550). If you've ever looked at the GIF file format spec you'll know that it requires you to encode the pixel data using LZW compression (https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch). So I spent a couple of days looking around at various implementations and trying other people's libraries for GIF encoding. Eventually I ended up writing my own LZW compression algorithm implementation in C which turned out to be a really cool learning experience for me. So now we can easily export GIFs straight from the game itself:

We can even edit and review the pixel data before encoding:


I've also recently starting doing some programming live streams on Twitch (https://www.twitch.tv/piggybankstudios). I realize I really love explaining stuff and talking to people about the implementation details of doing large scale projects. I figured there might be some people here that might be interested in making GIFs or compression in general that would be interested to see the code that I wrote for this system. I can't say that I am an expert on compression, far from it, but I'd love to spend some time going over this implementation with anybody who cares to listen. And if, by chance, there is someone who is actually good at compression I'd love to hear and talk to them about what I've written and get some feedback.

So if you are interested in watching a stream about GIF encoding or LZW compression please post a comment here. If I get enough interest I will plan a time and do a stream soon.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #1 on: October 27, 2019, 10:04:12 AM »

Not interested in a stream, but am interested in a C implementation for GitHub along with a blog post or beefy readme. Problem with streams is people can not watch video at their own pace. So for me it’s a waste of my time. But with written content I can jump around at any pace I like.
Logged
Daid
Level 3
***



View Profile
« Reply #2 on: October 27, 2019, 10:54:07 AM »

Not interested in a stream, but am interested in a C implementation for GitHub along with a blog post or beefy readme. Problem with streams is people can not watch video at their own pace. So for me it’s a waste of my time. But with written content I can jump around at any pace I like.
https://github.com/nothings/single_file_libs#images
Has 2 public domain gif writers. With one of those it took me relatively little code to add gif writing to my game engine: https://github.com/daid/SeriousProton2/commit/a3f0ca336da633d045ebfdb954321458a46ce69e

But my reason was to be able to quicker get gifs to post in devlogs and stuff.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
ProfessorSil
Level 0
*


View Profile
« Reply #3 on: October 27, 2019, 12:26:50 PM »

Yeah so the main reason I figured a stream would be more useful is because there are already implementations out there that you can go look through. And they're probably more portable and packaged like a normally library or single header file. My LZW encoder is kind of embedded in my own style and wouldn't be all that easy to pull out and make into an easily integratable library. So what I would actually like to provide is a way for people to have a more human explanation of the algorithm from somebody that has written one of these implementations. I don't really expect people to copy and paste my algorithm implementation. I would hope that I could help explain it to people that find the algorithm hard to understand or want an example of how it could be implemented in an existing project.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #4 on: October 28, 2019, 08:35:37 AM »

To be clear, I'm personally interested in this topic and your thoughts on the matter. I just don't like how slow to consume videos are compared to written content. It's like 100x slower for me than jumping around a blog post. But that's just me. Maybe a video would be more popular overall!
Logged
ChaoticEdge
Level 0
**


View Profile WWW
« Reply #5 on: August 01, 2020, 11:04:45 PM »

Sorry, I'm a bit late to the party, but I would be very interested. I started making a gif reader/player that would stream directly into an OpenGL texture for use in game. It kinda worked, but there were a few bugs so I gave up on it.
Logged

Cheezmeister
Level 3
***



View Profile
« Reply #6 on: August 10, 2020, 04:22:54 PM »

I would watch that VOD.

Sounds like an experience roughly like that one time I used PortAudio for procedural audio the hard way, or that time I installed Arch, or bashed my head against Emscripten (when it was new and almost documented) until it finally worked.

In other words, not that complicated but sounds complicated until you do it and realize it's not that complicated, but few people do it because it sounds complicated...something like that?

Kudos, and yeah link the video if you make one!
Logged

෴Me෴ @chzmstr | www.luchenlabs.com ቒMadeቓ RA | Nextris | Chromathud   ᙍMakingᙌCheezus II (Devlog)
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic