GIF & Image & Sprite & SpriteSheet -Wizard [Module -All OS]

Share your advanced PureBasic knowledge/code with the community.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

GIF & Image & Sprite & SpriteSheet -Wizard [Module -All OS]

Post by walbus »

GIF & Image & Sprite & SpriteSheet & Photo -Wizard - Module - All OS (SpriteTool_BF)

With this tool you can solve many problems with GIF and sprites

Fitted for GFX_Wizzard_BF

Many abilities :wink:

The tool can coloring GIF frames - CSS sheets, sprites and images
Can create CSS sheets with included frame data and delays from any GIF
Can load sheet info files for changing the sheet delays
Can load again sprite sheets with included GIF frames, all frame data and delays automatically
Can clean sprite masks
Can change sprite masks
Can handling color distance
Can change the GIF invisible color
Can grab the invisible color directly from the visible animation
Can create PNG sheets and images with invisible (transparent) color from any sprites and GIF
BucketFill with color distance and texture support - For simplest and fastest recoloring and texturing
FloodFill with color distance and texture support - For very nice recoloring and texturing
Multi stepp undo function
On demand GIF and CSS animation
Import and export with a selection rectangle, on demand justable, resizable, with alpha blending
Free rotatable frame import
Snipping function, with color distance, rotating, mirroring, resizing, alpha blending
Also full featured text import
Can handle Exif data
Supports commandline call
And many more....

The tool is very powerful and has amazing functions !

Fitted for Image_coloring_BF and Image_coloring_partition_BF

There is no comparable tool :wink:

Usable as module,
or simplest with any software as stand alone with command line :wink:

GFX_Wizzard_BF (BF) based :
http://www.purebasic.fr/english/viewtop ... 12&t=66927

To be able to maintain the code better and keep it up to date, it is included in the GFX_Wizzard_BF (BF) download package.
Named : "_MAIN_SpriteTool_BF.pb"

Simple create your own powerful BF enhanced applications

Image

Image

BF Sprite tool - Three little videos about demonstrating base functions[/b]

http://www.quick-aes-256.de/Video/Sprit ... eaning.mp4

http://www.quick-aes-256.de/Video/Sprit ... ndling.mp4

http://www.quick-aes-256.de/Video/Sprit ... import.mp4


Image

Create powerfull outputs
Image
Last edited by walbus on Fri May 18, 2018 7:53 pm, edited 63 times in total.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by Andre »

Looks very good & powerful! (even if I don't have further use for this Wizzard yet...)

Thank you for your continuous effort around GFX packages for PB :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by walbus »

Hello Andre
Thank you very much
I think you can still use the tool well :wink:
Use this tool to optimize the color of your images for output

You go like this:
Load an image into the tool
Set the Partition x slider to 50%.
Set the partition y slider to 0

If you now change the colors or brightness of the image, it will be displayed in two parts
On the left side the original, on the right side the changes
This is very cool
With the buttons "Default" and "Partition" you can toggle between the pages
Everything goes on demand

You can save a colored image, or you can write down the changed color values.

You can then simply enter these color values in the Image Coloring functions of BF and get the exact same result.

This greatly simplifies the creation of color changed or optimized images in your application.

Regards Werner
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by walbus »

Code updated d26 m02 y2018

It is now also possible to import CSS sheets not created with BF or the BF sprite tool,
or sheets which do not provide frame data
Just use a sheet info file created by BF Sprite tool and enter the data of the sheet to be imported there.
Adjust the filename and you're done.
Then load this info file instead of the sheet
The sheet is then loaded automatically and the frame data of the info file is used.
After saving with the BF Sprite Tool the info file is no longer necessary.
The BF Sprite tool enters the data directly into the sheet.
Additionally, a sheet info file is still created when saving a sheet
User avatar
OldSkoolGamer
Enthusiast
Enthusiast
Posts: 148
Joined: Mon Dec 15, 2008 11:15 pm
Location: Nashville, TN
Contact:

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by OldSkoolGamer »

Great tool as usual walbus. Question: Do you EVER sleep???
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by walbus »

Hi OldSkoolGamer
Yeah, the problem is, if it doesn't work the way it's supposed to, it won't keep me in bed,
When I start coding something, I have no peace until it's perfect, or it can't be improved.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by walbus »

Fix on BF for fast sprite output on Mac d02 m02 y2018

The Sprite Mode of the Sprite Tool didn't work on Macs, which I only noticed now.

Function for import BF sprite sheets as simple image or as sheet with all frame data added

Hint : The tool can search automatically sprite sheet frame data in a separately sheet info file and inside the sheet self

Otherwise the Sprite Tool is now finished

I don't think any other functions are necessary
If PB once supports GIF saving, I will add a GIF export function, i think...
But this is absolutely not important, the BF sprite sheets have a many better handling as Gif

Due to compatibility problems with PB I don't want to use my own GIF import and export functions
As it is now, the Sprite Tool's GIF features are one hundred percent compatible with PB
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GIF - Image - Sprite & CSS & coloring Wizzard

Post by Kwai chang caine »

What an enormous useful works !!!! :shock:
Thanks a lot, for sharing this hundreds hours of your life 8)
ImageThe happiness is a road...
Not a destination
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by walbus »

Many thanks KCC
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by walbus »

Direct download as executables for Windows, Linux and MacOS, now available from my Website

http://www.nachtoptik.de
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by walbus »

Code updated and enhanced d10 m04 y2018

The BF sprite tool can now handle PNG with invisible color and alpha blending

The tool can not only read but also write this format
Sprite sheets can be created and imported with this tool
The same applies to sprites

As a special feature, the tool can convert masked sheets and sprites to PNG with invisible color 8)

This new feature is quite amazing :wink:

They can also be freely scaled and colored, also color distance is available and clipping
BF contains functions that make these sheets extremely easy to use

See the demo code in the BF download package, named :
"SheetMaster_BF_Using_CSS_Alpha_Sheet_BF.pb"
Last edited by walbus on Thu Apr 12, 2018 7:24 am, edited 1 time in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by walbus »

I have uploaded another new version
With the new function to create PNG sheets with invisible color,
the missing GIF store functionality of PB can be completely replaced
The output function for the frames is very powerful, it is much better than handling and outputting GIF frames
Here is the header of the output function for the frames

Code: Select all

Declare Sprite_CSS_sheet_grab_frame_BF(texture_ID,
                                         frames,                ; Numbers of frames
                                         frame,                 ; Selected frame - For GIF compatibility the first frame is 0
                                         frame_width,           ; Frame width
                                         frame_height,          ; Frame height
                                         frames_in_a_row=0,     ; Frames in a row - Preset 0, then BF calculate self
                                         output_width=0,        ; Resizing - Define the output width - Preset zero = without resizing 
                                         output_height=0,       ; Resizing - Define the output height
                                         texture_clip_x=0,      ; Startposition inside the texture - Preset 0
                                         texture_clip_y=0,      ; Startposition inside the texture - Preset 0
                                         texture_clip_width=0,  ; Endposition inside the texture - Preset 0 = full texture width
                                         texture_clip_height=0) ; Endposition inside the texture - Preset 0 = full texture height
The necessary frame data for this function can be read out automatically from each BF sheet

Code: Select all

GetFrameData_fromSheet_BF(path_1$) ; Get all frame date from the sheet and use the BF frame variables
Define frame_width=GetGIFandCSS_Frame_width_BF() ; Frame width
Define frame_height=GetGIFandCSS_Frame_height_BF() ; Frame height
Define frames=GetGIFandCSS_Frames_BF() ; Count frames in the sheet
After reading the frame data the delays are also available
The complete delay handling is then only a single line of code

Code: Select all

If delay : delay=0 : frame+1 : EndIf : If frame=>frames : frame=0 : Else : delay+Delay_BF(1, GetGIFandCSS_delay_array_BF(frame)) : EndIf
Another BF function can automatically save all frame data in any string

And of course also read out again
It's all automatic

Thus, the frame data for any number of different sheets can be easily managed as strings
Last edited by walbus on Wed Apr 11, 2018 1:57 pm, edited 2 times in total.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by Kuron »

In all likelihood, I will never be able to use PureBasic again. However, your contributions with your two graphics libraries are the most comprehensive and impressive libraries I have seen created for PB. You have an amazing talent and dedication. Never think you are not a valued member of the community.
Best wishes to the PB community. Thank you for the memories. ♥️
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo -Wizzard [All

Post by walbus »

Thank you for your kind words Kuron.

I wish you all the best for the future.

Best regards Werner
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: GIF & Image & Sprite & SpriteSheet & Photo Wizzard [All

Post by walbus »

Code updated d22 m04 y2018

There is no comparable tool :wink:

Usable as module,
or simplest with any software as stand alone with command line :wink:
Last edited by walbus on Fri Apr 27, 2018 9:30 pm, edited 2 times in total.
Post Reply