GIF Toolkit

Developed or developing a new product in PureBasic? Tell the world about it.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

GIF Toolkit

Post by JHPJHP »

Hi tatanas,

If you're not already aware, PureBasic includes a built-in GIF decoder.
Creating a memory example only requires the CatchImage function and a DataSection.
Instead of a DataSection with a simple path and filename, I chose to create a binary version packed into an IncludeFile.

A new example has been added to the latest version of Windows Services & Other Stuff.
- Other_Stuff\AnimatedGIF\UseGIFImageDecoder_Memory.pb
- Other_Stuff\AnimatedGIF\includes\DataSection.pbi

NB*: DataSection.pbi was created using the Bin2Data tool written by ts-soft.

----------------------------------------------------

A new example has been added to the latest version of GIF Toolkit.
- GIF_Toolkit_SRC_BIN\scripts\gif_decode_memory.pb
- GIF_Toolkit_SRC_BIN\scripts\includes\decode_memory_procedures.pbi
- GIF_Toolkit_SRC_BIN\scripts\includes\decode_datasection.pbi

gif_decode_memory.pb
- very similar to gif_decode.pb

decode_memory_procedures.pbi
- two updated procedures: _DecodeMemoryGIF, DecodeMemoryGIF (formally _DecodeGIF, DecodeGIF)

decode_datasection.pbi
- created using the Bin2Data tool written by ts-soft.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- some minor improvements
- squashed a couple bugs

NOTES:
All downloads require an access key.
Access key is emailed after a one time $20 CAD donation.
Good for all current and future scripts, programs, and updates.
Last edited by JHPJHP on Sat Jan 21, 2023 1:53 am, edited 3 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- added a DPI include file
- added command parameter: SetDPI
- some minor improvements to the Viewer

DPI Include File: \includes\DPI_sources.pbi
Command Parameter: SetDPI: Set with executable to activate DPI scaling

Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- added a Negative color palette option to the In-Place Editor
- fixed a small issue that occurred when setting a custom color palette
- numerous small improvements

NB*: Spider Web Drawing has also been updated to include a Negative color algorithm.

Image
Last edited by JHPJHP on Wed Oct 27, 2021 7:46 pm, edited 2 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- significant improvements to the Image Editor
- various other improvements
- created both x86 and x64 binaries
- squashed a couple small bugs

Image Editor
Previously objects could only be selected and deleted from the Graphics List.
Objects can now be selected and deleted directly from the display area.
Z-order determines which overlapped object receives focus.
Z-order can be modified from the Graphics List via drag n' drop.
In addition to setting X/Y parameters, selected object can also be moved using the arrow keys.
Ctrl + Arrow Keys will change frames.
Last edited by JHPJHP on Sat Jan 21, 2023 1:53 am, edited 2 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- small fix to the In-Place Editor
- significant improvements to the Custom Color Palette algorithms

In-Place Editor
After a previous update, the Apply buttons were not working as designed.

Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- improved image editor
- squashed a couple bugs

Squashed Bugs
After updating to PureBasic 6.01 LTS beta 1 (x86/64) the GIF Toolkit wasn't working as expected. Upon closer examination I found an If/Then argument that was missing nested brackets; this same If/Then argument was used in numerous places throughout the code. This also led me to another problem that was quickly fixed.

Thanks to the patches in the latest release of PureBasic I was able to find and fix the problem.

Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- some minor improvements
- squashed a bug

Squashed Bug
After updating to PureBasic 6.01 LTS beta 2 (x86/64) the bottom filmstrip wasn't showing when the application was first opened.

NB*: Free executables (x86/x64) can be downloaded from My PureBasic Stuff; see FREE STUFF.

Image
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: GIF Toolkit

Post by jamirokwai »

Hi JHPJHP,

great work. I donated and am fiddling with the source code, because I need a GIF encoder for a project. I am planning to write my own export-procedures, and wanted to have a small head-start :-)

While working with script/gif_encode.pb, all exported images are black. I am using PB 6.01 on Windows 11 and MacOS. While investigating the exported GIF, it shows only 2 colors. Maybe that helps finding the issue!?

Would be great to have a working example, so I can understand exporting GIFs/animated GIFs better.

Thanks!
Regards,
JamiroKwai
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi jamirokwai,

Please see the following post: viewtopic.php?p=521941#p521941
netmaestro not only completed the encoder but also included the NeuQuant algorithm ported by wilbert.

Because of the additional optimizing algorithms a GIF encoder requires to be relevant, my preference is FFmpeg.
The following projects used FFmpeg for the high quality GIF output:
- Deform Image: MLS
- Video Snipping Tool

Good luck.
Locked