Why was JPEG encoding/GIF decoding removed?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Why was JPEG encoding/GIF decoding removed?

Post by zorg »

Someguynamedpie wrote:But yeah I don't have the source anymore due to a harddrive failure but I got around the Lua linking problem somehow that I don't remember
This was the most clickbait sounding sentence i've ever read. :D
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Why was JPEG encoding/GIF decoding removed?

Post by bartbes »

Please don't double-post. And yes, we are aware. But whilst ffmpeg itself is LGPL, many of the libraries it uses are GPL, and/or patent-encumbered. Not just that, the specific interpretation of the LGPL they promote is also annoying. Basically, a pain to distribute in binary form.
User avatar
slime
Solid Snayke
Posts: 3160
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Why was JPEG encoding/GIF decoding removed?

Post by slime »

Someguynamedpie wrote:On the subject of licenses, yall are aware that most openal implementations use LGPL right
LGPL is "fine" (but still not ideal) on most platforms because we can just ship the dynamic library with LÖVE (or use one provided by the OS or installed by the user) and there will be no licensing issues.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Why was JPEG encoding/GIF decoding removed?

Post by Someguynamedpie »

bartbes wrote:Please don't double-post. And yes, we are aware. But whilst ffmpeg itself is LGPL, many of the libraries it uses are GPL, and/or patent-encumbered. Not just that, the specific interpretation of the LGPL they promote is also annoying. Basically, a pain to distribute in binary form.
Very used to auto-merging of a forum I frequent, apologies.
And dear god do not include FFMPEG :o it is very massive
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Why was JPEG encoding/GIF decoding removed?

Post by Positive07 »

You can write a libvlc wrapper for LÖVE but you can't write a GIF decoding algorithm?

Also you pointed that GIF is somehow better to APNG, LÖVE supports neither!, This is because supporting animations means that they would be tied to the update loop somehow, and that is why it was so difficult to incorporate LÖVE video, and also well because it is bloat to most simple projects.

JPEG encoding is simply stupid, there is no reason whatsoever to have it, you pointed out that it is useful for pictures, of course it is, because cameras are not that good and the loss of image quality is not noticeable in JPEG pictures. But games are not made of pictures so if you are actually encoding an image from LÖVE I can guarantee that having a lossy compression has no meaning and a lossless compression is way better. Also PNG is not that big! Your users won't care that much, and if they do then they will recompress all images.

If you don't like any of the above, write your own library! FFI, Lua or C/C++ will do!! That is the best part of this

LÖVE tries to be bloated as little as it can, it tries to ship what is needed for MOST projects and doesn't try to cover ALL use cases. Why? Well because if a developer has an specific use case and LÖVE doesn't cover then there may be another tool that does, or maybe you can easily create a library to do that!

If you need animations then probably GIF is not what you will need anyway, use Anim8 or a similar library.
If you want video then GIF probably isn't what you want, use love.video.
If you want to encode images then JPEG is not what you want because of it lossy factor, use PNG encoding instead which is great for MOST use cases.

Also libtheora is Open Source and heavily supported!! And is not a bad format, it is used all over the place, and does the job most of the time.

OpenAL is LGPL and that is why it is shipped as a separate DLL with no modifications to it's source code

libvlc is huge, LÖVE tries to be as little as it can, because as you said games are already big enough so keeping the framework little is best. Simple games will be lightweight and HUGE games will be huge because of the content and not because of the framework

If you don't like LÖVE, search for another tool, you may not be using the right one. If you don't like the politics of LÖVE go and write your own framework, bloated as hell with whatever you want. If you want to add features to LÖVE you can always fork it and work on whatever feature you may need. Or you can simply write a library to support whatever you want in LÖVE!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Why was JPEG encoding/GIF decoding removed?

Post by Someguynamedpie »

Did you miss the posts I/everyone else made? And JPEGs are great for photographs because of how efficient JPEGs are with photographs as opposed to other formats that are lossless. I don't care about filesize, and JPEG decoding is still supported so your primary point is mute anyway, which can be useful if a game provides a photobook. As I said (repeatedly) in the thread, the GIFs I used aren't animated, they're downloaded from the web and are single frame. I also said I was going to make a pure-Lua decoder, and additionally said why FFI was infeasible. I never said that theora was a bad format, nor did I suggest embedding libvlc, and I already gave a reason to not fork LOVE (My personal game engine runs on android/ios/windows/etc so it doesn't bother me much anyway).
The primary downside to using FFI in Love is you have to extract the binaries and it can be difficult to do that properly but isn't impossible, and you have to compile binaries for all of the platforms you intend to support.
User avatar
pgimeno
Party member
Posts: 3641
Joined: Sun Oct 18, 2015 2:58 pm

Re: Why was JPEG encoding/GIF decoding removed?

Post by pgimeno »

Someguynamedpie wrote:The primary downside to using FFI in Love is you have to extract the binaries and it can be difficult to do that properly but isn't impossible, and you have to compile binaries for all of the platforms you intend to support.
For one of the uses of FFI, that's true, but there are more. You can also interface with pre-existing libraries, and you can also use FFI to speed up memory management or access to some structures.

I've been considering making an FFI-based pure-luajit library for GIF decoding, after reading this thread. The LZW decoder is not that difficult. An encoder is harder to get right. I'll see if I have time in the next weeks, but I don't promise anything.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Why was JPEG encoding/GIF decoding removed?

Post by Positive07 »

Someguynamedpie wrote:Did you miss the posts I/everyone else made? And JPEGs are great for photographs because of how efficient JPEGs are with photographs as opposed to other formats that are lossless. I don't care about filesize, and JPEG decoding is still supported so your primary point is mute anyway which can be useful if a game provides a photobook.
Are you gonna encode photographs? Because if you just need to encode screenshots from your game then PNG is better suited. If you are gonna encode photogaphs, where did you get them from in the first place? JPEG's?

JPEG decoding is supported, this is so as you said you can make a photobook or similar, I find no reason why you would encode this photos back though when they are already in the format you want.

We are talking about encoding here
Positive07 wrote:JPEG encoding is simply stupid, ...
And when I said that I totally meant in a game engine, so don't take it out of context, I think it's a great format for photographs as you said, but not that great for screenshots or game assets. That is why JPEG encoding as a part of LÖVE is pointless.
Someguynamedpie wrote:As I said (repeatedly) in the thread, the GIFs I used aren't animated, they're downloaded from the web and are single frame. I also said I was going to make a pure-Lua decoder, and additionally said why FFI was infeasible.
Fine with me!
Someguynamedpie wrote:I never said that theora was a bad format, nor did I suggest embedding libvlc
Someguynamedpie wrote:Psh, love.video only supports theora, libvlc supports literally everything (cough including DVDs)
Someguynamedpie wrote:I already gave a reason to not fork LOVE (My personal game engine runs on android/ios/windows/etc so it doesn't bother me much anyway).
Fine then, don't complain that much about LÖVE, it is this way and won't change unless it's needed, and you haven't proven a point about why this features you are asking for are actually needed in this game framework. And if you have a personal game engine you like better than LÖVE just go and use that! I'm sure you would be happier if you didn't have to complain about the lack of JPEG encoding support in LÖVE
Someguynamedpie wrote:The primary downside to using FFI in Love is you have to extract the binaries and it can be difficult to do that properly but isn't impossible, and you have to compile binaries for all of the platforms you intend to support.
I agree to this, yet that isn't that hard either
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Why was JPEG encoding/GIF decoding removed?

Post by Someguynamedpie »

pgimeno wrote:
Someguynamedpie wrote:The primary downside to using FFI in Love is you have to extract the binaries and it can be difficult to do that properly but isn't impossible, and you have to compile binaries for all of the platforms you intend to support.
For one of the uses of FFI, that's true, but there are more. You can also interface with pre-existing libraries, and you can also use FFI to speed up memory management or access to some structures.

I've been considering making an FFI-based pure-luajit library for GIF decoding, after reading this thread. The LZW decoder is not that difficult. An encoder is harder to get right. I'll see if I have time in the next weeks, but I don't promise anything.
I actually am using FFI types to aid in decoding.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Why was JPEG encoding/GIF decoding removed?

Post by Someguynamedpie »

Positive07 wrote:
Someguynamedpie wrote:Did you miss the posts I/everyone else made? And JPEGs are great for photographs because of how efficient JPEGs are with photographs as opposed to other formats that are lossless. I don't care about filesize, and JPEG decoding is still supported so your primary point is mute anyway which can be useful if a game provides a photobook.
Are you gonna encode photographs? Because if you just need to encode screenshots from your game then PNG is better suited. If you are gonna encode photogaphs, where did you get them from in the first place? JPEG's?
..you're missing the point. I retracted my need for encoding anyway
JPEG decoding is supported, this is so as you said you can make a photobook or similar, I find no reason why you would encode this photos back though when they are already in the format you want.

We are talking about encoding here
Positive07 wrote:JPEG encoding is simply stupid, ...

And when I said that I totally meant in a game engine, so don't take it out of context, I think it's a great format for photographs as you said, but not that great for screenshots or game assets. That is why JPEG encoding as a part of LÖVE is pointless.
I understand that but I thought you were dismissing jpegs entirely.
Someguynamedpie wrote:As I said (repeatedly) in the thread, the GIFs I used aren't animated, they're downloaded from the web and are single frame. I also said I was going to make a pure-Lua decoder, and additionally said why FFI was infeasible.
Fine with me!
Someguynamedpie wrote:I never said that theora was a bad format, nor did I suggest embedding libvlc
Someguynamedpie wrote:Psh, love.video only supports theora, libvlc supports literally everything (cough including DVDs)
Someguynamedpie wrote:I already gave a reason to not fork LOVE (My personal game engine runs on android/ios/windows/etc so it doesn't bother me much anyway).
Fine then, don't complain that much about LÖVE, it is this way and won't change unless it's needed, and you haven't proven a point about why this features you are asking for are actually needed in this game framework. And if you have a personal game engine you like better than LÖVE just go and use that! I'm sure you would be happier if you didn't have to complain about the lack of JPEG encoding support in LÖVE
What exactly is wrong about critiquing a library or piece of software? What is wrong with using LOVE occasionally? Am I banned from using LOVE because I have my own game engine?
Someguynamedpie wrote:The primary downside to using FFI in Love is you have to extract the binaries and it can be difficult to do that properly but isn't impossible, and you have to compile binaries for all of the platforms you intend to support.
I agree to this, yet that isn't that hard either[/quote]
Its -very- hard to get a proper cross compiler setup and FFI isn't even enabled on iOS compiles of LuaJIT.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests