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:

Re: GIF Toolkit

Post by JHPJHP »

Hi Karellen,

Thank you for your post, it is nice to know that the Toolkit or the scripts therein might find a use.

Cheers :!:
User avatar
FourthStone
User
User
Posts: 26
Joined: Mon Dec 11, 2017 8:44 am
Location: Australia

Re: GIF Toolkit

Post by FourthStone »

Have been following this thread for a while now as I am interested in saving GIF files from my art drawing program. You're programs are really fantastic :D

Question for JHPJHP or others if someone knows, I hope it is ok!

I've been looking at the gif_encode script and trying to work out if I can specify multiple frames for image source to be saved as GIF rather than the example which just saves one frame directly from the canvas gadget? From what I can tell it only currently saves 1 frame and I can't workout how \outputbuffer is set or if multiple frames are supported :oops:

My program displays an animated sequence of images and can save each frame as PNG files, however ideally I want to be able to export all frames as GIF.

Hope you can offer any advice thank you :?:
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi FourthStone,

The example gif_encode.pb is unfinished.. I have not gotten around to completing the LZW encoding algorithm.

Take a look at this post by netmaestro: GIF Workshop alpha 1 - All platforms.

Good luck.
User avatar
FourthStone
User
User
Posts: 26
Joined: Mon Dec 11, 2017 8:44 am
Location: Australia

Re: GIF Toolkit

Post by FourthStone »

Thank you JHPJHP, that looks like what I'm after :D



Edit by André: deleted all following posts with senseless personal attacks including publicly posted PM. Back to topic please! :D
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- improved Extract Frames
- improved GIF Details
- other minor enhancements
- squashed a couple bugs

Extract Frames
Transparent background color can now be set for both PNG and GIF files.
- changing the transparent GIF background color may force a Disposal Method change

GIF Details
Added a button to open a window with a zoomed version of the GIF details.
- pressing the GIF Details button more then once will toggle text color

NOTE
Left-Double-Click inside the thumbnail GIF area to set the location back to the current folder.
Right-Double-Click inside the thumbnail GIF area to set the location back to the default folder.
Last edited by JHPJHP on Wed Apr 10, 2019 2:35 pm, edited 2 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

GIF Toolkit

Post by JHPJHP »

Updated:
- threaded animation
- optimized color tables
- squashed a couple bugs

Threaded Animation
Switched from a timer display to threaded for improved GIF animation.

The update also includes a new standalone script gif_patch.pb and an improved version of gif_decode.pb. Both files can be found in the scripts folder.

NB*: The example gif_patch.pb can modify GIF parameters in-place. In a future release it will be added to the main application, accessible through a user interface.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- added an In-Place Editor window
- squashed some bugs

In-Place Editor
Double-click a GIF icon from the main window to open the In-Place Editor.
Some GIF options are not accessible in this mode; might be updated in a future release.

NB*: The examples located in the scripts folder have also been updated with multiple improvements.
Last edited by JHPJHP on Sat Apr 27, 2019 11:20 am, edited 1 time 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 Custom Palette window to the In-Place Editor
- added Clear Comment checkbox
- numerous minor improvements
- squashed a few more bugs

Custom Palette
Press the ButtonImageGadget to open the Custom Palette window.
Includes a group of predefined palettes, as well as the ability to set a user-defined palette.
Some of the predefined palettes will populate the custom palette fields for easy manipulation.

NB*: Individual palette colors can be changed from the In-Place Editor window.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- added the option to set individual palette changes to all frames
- squashed a few bugs

Reset All Frames: Reset values in all frames; providing the In-Place window had not been previously closed; applied values can also be reset.
Apply All Frames: Changes made to the current frame will be applied across all frames, excluding palette changes; see NOTES.
Apply Modified Frames: Only the changes made to individual frames will be applied.

NOTES:
The option to set palette changes across all frames occurs when the mouse leaves the modified palette, providing other palettes exist.
Setting a custom palette is global by default.
Both apply buttons will save palette changes to individual or all frames.
Last edited by JHPJHP on Sat May 29, 2021 11:30 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:
- enhanced Color Palette
- added Arrow Keys frame selection
- added Drag and Drop GIF loading
- added a new Thumbnail Viewer graphic
- added quick access Directory buttons
- fixed a bug that would crash the program under some conditions

Color Palette
Moving the mouse pointer over the color palette will display an image of the current frame.
Real-time color changes will show in the pixels of the opened image that reference the palette index the mouse pointer is over.
Select a palette index to set the color reference with the user-defined color.
Select a previously set palette index to reset the default color, providing the mouse pointer has not left the color palette since the index was first updated.

Arrow Keys
From the In-Place Editor frames can be changed using the arrow keys. If the mouse pointer is over the color palette, the Index image is also updated.

Drag and Drop
Drag and drop a single GIF onto the Thumbnail Viewer or GIF File List to alternately load an animation.
Last edited by JHPJHP on Mon Aug 02, 2021 8:33 pm, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- enhanced the Animation Viewer window
- fixed a couple issues

Animation Viewer
The new animation viewer is Windows only.
Double-click the thumbnail animation to open.

A version of this feature has been included in Windows Services & Other Stuff; adapted from Book & Viewer & Magnify (Image_Viewer).

NB*: While the GIF Toolkit scripts are cross platform, currently only the Windows version is supported.
Last edited by JHPJHP on Fri May 10, 2019 7:07 am, edited 7 times in total.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: GIF Toolkit

Post by RSBasic »

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

Re: GIF Toolkit

Post by JHPJHP »

Hi RSBasic,

Thank you for the thumbs-up :wink:

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

Updated:
- enhanced the Animation Viewer
- added Program Parameter support (context menu "Open with")
- small changes to the Image Editor
- included additional ORBO animated GIFs
- fixed a couple issues

Animation Viewer
Encoded images are now scaled to fit the desktop.
Added frame data, close button, pause/play button, and navigation buttons.
Touched-up the viewer graphic using GIMP.

NB*: The size of the download has increased due to the additional GIF, but the animations are so good that I feel the trade-off was worth it.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Updated:
- added Show/Hide frame data button
- enhanced the Animation Viewer buttons
Last edited by JHPJHP on Wed Dec 09, 2020 5:41 pm, edited 1 time in total.
tatanas
Enthusiast
Enthusiast
Posts: 199
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: GIF Toolkit

Post by tatanas »

Hi JHPJHP !

I'm using your Gif Toolkit to load splash window in my application. Until now it was easy because the gif file was stored in the install folder.
Now I would like to compile the gif file with my exe (through IncludeBinary).

So here is my question : Can I use your toolkit this way ? the _DecodeGIF function need a file to be read not a pointer of the image in memory (the one I can get from my DATASection)

Thanks for your help.
Windows 10 Pro x64
PureBasic 6.04 x64
Locked