GIF Toolkit

Share your advanced PureBasic knowledge/code with the community.
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

GIF Toolkit

Post by JHPJHP »

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

Download GIF Toolkit from My PureBasic Stuff

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

Announcements
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium Edge WebGadget
Stitch Images: SIFT
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

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

Based on information from the following resources:
- UnFREEz Source Code
- What's In A GIF - Bit by Byte
- Inside the GIF file format
- How LZW (GIF) Compression Works
- GIF89a Specification
- Netscape Looping Application Extension

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

APPLICATION
- GIFToolkit.pb: Based on scripts from the following examples.

SCRIPTS
- gif_animate.pb: Create an animated GIF from a folder of GIF images.
-- use the example gif_extract.pb to create a folder of (frames) GIF images

- gif_decode.pb: Decode an animated GIF to play in a Canvas Gadget.
-- Context Menu: Open GIF Image, Play GIF Image
-- move through frames in either direction using the arrow keys
-- set a custom Transparent / Background color

- gif_detail.pb: List the container and frame information from an animated GIF.
-- returns all the information from the various structures

- gif_encode.pb: Encode an image from a Canvas Gadget to a GIF image.
-- this example is a work in progress; still need to finish the EncodeLZW Procedure

- gif_extract.pb: Extract frames from an animated GIF creating a folder of images.
-- use the example gif_animate.pb to compile the images into an animation

- gif_patch.pb: Patch any GIF parameter; requires further coding, but should be enough to get started.
-- files are patched in-place; execute the example against the GIF located in the images folder
Last edited by JHPJHP on Fri Apr 16, 2021 5:52 pm, edited 73 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
boyoss
User
User
Posts: 74
Joined: Fri Feb 05, 2016 10:11 am

Re: GIF Toolkit

Post by boyoss »

Excellent idea
thank you for sharing
User avatar
BasicallyPure
Enthusiast
Enthusiast
Posts: 536
Joined: Thu Mar 24, 2011 12:40 am
Location: Iowa, USA

Re: GIF Toolkit

Post by BasicallyPure »

Does this require the new beta version of PB or can I run it with version 5.50?
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi boyoss,

Thank you for your comments.

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

Hi BasicallyPure,

The examples should work in any version of PureBasic, but may require some minor changes due to PureBasic Constants, etc. not existing in earlier versions of the IDE

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4891
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GIF Toolkit

Post by Kwai chang caine »

Thanks JHPJHP 8)
ImageThe happiness is a road...
Not a destination
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi Kwai chang caine,

You're very much welcome.

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

Updated:
- gif_decode.pb
-- modified the way transparency was handled
- gif_detail.pb
-- returns all available GIF information by frame

NOTE:
- this toolkit does not use the PureBasic GIF decoder
- gif_encode.pb is still unfinished (missing the LZW Encode algorithm)
- when time permits, will include a GIF to Spritesheet utility

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4891
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GIF Toolkit

Post by Kwai chang caine »

Hello JHPJHP

Thanks for sharing your great works 8)

I have try the extract and the result if strange, show by yourself :wink:

The first image extracting with your code

Image

The second image extracting with your code
And nearly all the next images extracting with your code is like the second image :|


Image

The first image extracting with JASC animation shop

Image

The second image extracting with JASC animation shop

Image

With JASC all the images is perfect :wink:
ImageThe happiness is a road...
Not a destination
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi Kwai chang caine,

Thank you for your post.

The example gif_extract.pb is working as expected...
- this can be tested using the example gif_animate.pb; combine the extracted frames into an animated GIF

Animated GIFs:
Chapter 17 of Learning Web Design, 2nd edition wrote:The optimization process saves only the pixels that change from frame to frame and throws out redundant pixels.
The result is a big savings in file size with no change in the animation’s appearance.
NB*: I will add an option to the soon-to-be-released GIF Toolkit utility, to save layered images as individual frames.

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

Updated:
- gif_decode.pb
-- modified Disposal Method
-- modified DecodeLZW Procedure
Last edited by JHPJHP on Tue Feb 13, 2018 6:37 pm, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4891
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GIF Toolkit

Post by Kwai chang caine »

Aaaaah ok !!! excuse me for disturbe you for nothing :oops:
I have a little bit thinking to that when i have see the result, but like JASC save all the image, i believe it's a problem :wink:

It's right the picture are merveillous, it's the rolls royce of the GIF :shock: i'm in the paradise :mrgreen:

So thanks again for your splendid works, like all the others of JHPJHP 8) 8)
ImageThe happiness is a road...
Not a destination
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi Kwai chang caine,
Kwai chang caine wrote:... excuse me for disturbe you for nothing
On the contrary, you are a very helpful member of this forum who not only takes the time to test the various code contributions, but also provide valuable feedback. Thank you :!:

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
walbus
Addict
Addict
Posts: 930
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF Toolkit

Post by walbus »

I am looking forward to the Sprite Sheet tool
In itself, a sprite sheet is the better GIF
Much more flexible and easier to handle
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi walbus,

I like the package aspect of a GIF, but it does have some drawbacks.

Updated:
- GIFToolkit.pb: GIF Toolkit GUI (currently only formatted for Windows, but is cross-platform)

This is an unfinished product, but should give you an idea of where I am heading...
- most of the backend scripts have already been written (see the scripts folder)
- the top GIF player will display the animation
- each button will display an area with additional settings
- the bottom filmstrip will display individual frames, controlled by the above trackbar
Last edited by JHPJHP on Tue Feb 13, 2018 6:38 pm, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
walbus
Addict
Addict
Posts: 930
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF Toolkit

Post by walbus »

Yes, with a filmstrip looks good
Last edited by walbus on Wed Mar 28, 2018 11:19 pm, edited 1 time in total.
User avatar
JHPJHP
Addict
Addict
Posts: 1763
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: GIF Toolkit

Post by JHPJHP »

Hi walbus,

Had a couple of hours today to work on the GIF Toolkit; currently only the thumbnail player and transparency coloring are completed.
- double-click the thumbnail player, while a GIF is loaded, to open the GIF in its original size

NB*: All the previous examples are still available from the scripts folder.
Last edited by JHPJHP on Fri May 18, 2018 4:28 am, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4891
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GIF Toolkit

Post by Kwai chang caine »

JHPJHP wrote:On the contrary, you are a very helpful member of this forum who not only takes the time to test the various code contributions, but also provide valuable feedback. Thank you :!:
Sincerely thanks for this great compliment, who have again more value when it come from a great master of programming like you :oops: 8) 8)
Continue to illuminate our computers with all your jewels codes :shock: 8)
ImageThe happiness is a road...
Not a destination
Post Reply