BMP to GIF Converter

Just starting out? Need help? Post your questions and find answers here.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

If I start with an 8 bit BMP it works in color here. I emailed you an example.

I'll email you the BMP too.
-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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I used your 24-bit bitmap, used FreeImage() to convert to an 8-bit one and then saved as a gif. I ended up with just grey colors in the image.
I may look like a mule, but I'm not a complete ass.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I didn't use FreeImage to convert it from a 24 to 8 bit BMP - I can get an 8 bit BMP out of the software that it comes from..
-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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Ah, that explains it! FreeImage, when converting from 24 bits to 8-bits, seems to select a gray-scale palette.

By the way Karbon, with the help manual which comes with FreeImage, there is a table in the appendix which lists the supported bit depths for each image type etc. :)

In this instance, however, I'd consider gdi+ as it makes a much better job of converting a 24-bit bitmap to a gif.
I may look like a mule, but I'm not a complete ass.
BarryG
Addict
Addict
Posts: 4131
Joined: Thu Apr 18, 2019 8:17 am

Re:

Post by BarryG »

srod's tiny code is fantastic, but is there a way to tweak it so it can save a GIF from an image in memory, rather than from a file? Because SaveImage() doesn't support #PB_ImagePlugin_GIF yet. Thanks.
Post Reply