GIF encoder/decoder

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

GIF encoder/decoder

Post by Shannara »

Yes, I've done a search for one on these forums, and came up with nothing usable. The results either said read the beginner FAQ (which has nothing concerning GIFs), or claim copyright issues, which does not exist in most places anymore.

Why have a GIF one? Because I need an lossless image format that both PB and VB (& directx) can read and display. The format cannot be BMP :) So... I tried JPEG, but no matter what compression setting I use in Photoshop, the resulting image still looks.. quarky.

So I'm looking to use GIF. PureArena has "loadgif.pb" example that do not really load gifs. It uses a stupid movie gadget and loads a gif image in there.. quite useless for any real world application :(

I was thinking about making a dll in PB that will load a PNG image and pass it to PB, but haven't figured out how to do that, and put it in a VB Picture object, so.... im stuck with GIFs :D

Please note that I am not looking for a workaround as there is already an image plugin found:

viewtopic.php?t=6005

What I am looking for is Fred to start adding in support for more image formats, as it seems that that image formats supported in PB is quite small.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

PNG is lossless and has MUCH greater quality than gif. Jpeg pictures can also have many more colors.
But anyway, gif files are small.

but can vb read png?
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

I am for this one too.

JPG displays with a better quality gradiant pictures for instance, but for the others ones, GIF quality is excellent, and the file size is smaller.
- Registered PB user -

Using PB 4.00
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Post by Lebostein »

Yes! Why 'png' and not 'gif'? The gif-format is very frequently in use. In new versions of PureBasic I can load 256-color Bitmaps, its time for loading gif's too.

Please :D

Thanks!
plouf
Enthusiast
Enthusiast
Posts: 281
Joined: Fri Apr 25, 2003 6:35 pm
Location: Athens,Greece

Post by plouf »

firstly i have to admit that i am a PNG fan too ;)
and yes png can be 256 color and higly compressed too :evil:
anyway the gif prob is with its license if i am not wrong
(ye i know it has expire in many countries but still is prob)

pb added the image 'plugin' way thus anyway (who knows) can make a plugin elchoni has made one for win BMP, JPG, GIF, ICO, CUR, WMF and EMF
check in pureare user-libs
Christos
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Check out this post for a gif loader :
viewtopic.php?t=6005&highlight=ole+image

You aren't going to find any freeware encoders out there because of the patent. And before someone says that it's expired - it isn't in all countries.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

Thanks for the link Karbon ;)

I am using it right now, very nice ! :D
- Registered PB user -

Using PB 4.00
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

That is true, however, I could of sworn it has expired in france, and if it has, any remaining patants do not apply to Fred, but does apply to people who lives in the country where the patent still exist.. so the "it's still patant in some countries" do not hold water here (if...france..)
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

france here ^^
- Registered PB user -

Using PB 4.00
StarHawk
User
User
Posts: 55
Joined: Sun Nov 02, 2003 7:27 am

A workaround...

Post by StarHawk »

I got into with Fred over this very issue some months ago. I don't want to stir up hard feelings, but yes, this is needed. Now, you can use this code to display a GIF:

InitMovie()
LoadMovie(0,"YOUR GIF FILE NAME.gif")
PlayMovie(0,WindowID())

But watch out for compatibility issues. This is not "native" support of a GIF. If you use this, you may run into trouble on older computers or computers that have some DLL incompatibility issues or damaged or missing. If your requirements are to run on a Windows XP only, then it should work just fine.

P.S. GIF license is expired in almost all countries as of June, and even a few other countries were only about 6 months to 1 year longer. So in any event, in about 1 year, all GIF patents expire.
Post Reply