GFX_Wizzard_BF - [Modules - All OS]

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

GFX_Wizzard_BF - [Modules - All OS]

Post by walbus »

GFX_Wizzard_BF

GFX_Wizzard_BF is the compatible successor and further development of BucketFill_advanced

Graphic enhancement for PB graphic functions

Sprites with alpha blending also for canvas


Enhanced GIF handling functions


100% full editable source codes :!:

Rock stable :!:

Can directly draw on canvas gadgets, PB sprites, images and screen

This tool create all graphic effects and sprites itself, screen mode is available, but not needed ! :o

Works fine on Windows, Linux and Macintosh

Enhance your Graphic !

http://www.nachtoptik.de
Author W. Albus ©

The codes are too large for the forum
Please download the latest code package here :

http://purearea.net/ - The official PB support site

Visit purearea net - For news, codes, annoncements, PureBasic purchase and trial versions

Image

Direct download :
http://www.purearea.net/pb/download/mod ... ard_BF.zip (14.1 MByte)
Last update: 3rd July 2021

What can do this tool :
Can output all PB graphic functions with textures, images or photos
Can output all things animated directly on images and canvas with a function similar PB FlipBuffers
Can directly output on images, PB sprites, canvas, screen, full automatic
Simple extensible with many functions from the PB graphic librarys
Supports the vector graphic library
Supports CSS sprites
Inclusive creating tool for creating CSS image sprite sheets from GIF pictures
Enhanced GIF output with many features
GIF output same sprites directly on images, canvas and screen
Can output sprites on images and canvas without a needed screen mode
Rotating and mirroring for sprites, images, photos and textures
Functions for creating professional photo retouching tools
Functions for creating phantastic effects with any photos, textures or pictures
Replacing colors with other colors
BucketFill - Replacing colors with textures, pictures or photos
FloodFill - Supports colors, gradient colors, textures, pictures or photos
Recoloring textures and sprites
Output sprites and textures with invisible color and alpha blending
Color distance function for sprites invisible color
Color distance function for texture bucket fill and flood fill
Color distance function for standard fill with a color
Simple enhancing many PB standard graphic functions
Can use textures or sprites with any size
Can use masked sprites
Can use Images with alpha channel as sprites
Can create high quality standard sprites with included mask from any pictures with alpha channel
Can create pictures with alpha channel from masked sprites
Can create gradient color sprites
Can use JPG encoded standard sprites with included mask
Can use all self maded sprites
Mask cleaning function for JPG encoded sprites available with the special color distance function for sprites
Using defined parties from textures or sprites
Creating pattern with any sizes from sprites and textures or both combined
Declaring start position for each texture or sprite output
Multiple texture or sprite output
Automatic tiling function
Automatic scrolling function
Can output fine looking seamless photos (Works also with textures)
Manipulating FloodFill Buffer available
Manipulating BucketFill Buffer available
FloodFill and BucketFill Buffer register any modified pixel automatically
Custom MessageRequesters with automatic font size adaption
Create dynamic and resizable GUIs with automatic adaption of gadgets (and their font size, image size, etc.) to the new window size
Many functions for DPI-aware outputs
Enhanced Gadgets_BF with greatly enhanced innovative features
Easily create your own powerful custom Gadgets_BF
You can endless create and manipulate sprites and textures
All functions are easy to combine
And many more....

Many samples come directly added to the modules

Amazing possibilities :o
Image
The BF Image button can make fine seamless animations, tousends variants available

BF advanced can simple output seamless photos directly on images or canvas (Works also with textures)
Image

Image

BucketFill advanced can automatically create high quality masked sprites from pictures with alpha channel
Image

Be creative, make your own professional photo retouching tool with BucketFill advanced
It is simple, you get all things you need for developing very quick and high efficient photo retouching :shock:
Image

Normaly you can not use masked sprites with JPG compression as sprites
Compression artifacts in the as invisible declared color you become not invisible
Same problems you get mostly you use fill or retouch functions for creating sprite masks from any pictures
BucketFill advanced can automatically clean the sprite masks
So you can use also lossly compressed images or any hand maded sprites simple with BF advanced :wink:
Image

Looking, right the originale photo, left the demo result, created in one minute !
The needed demo code for texture and photo brush you found here :
http://www.purebasic.fr/english/viewtop ... 12&t=67278
Image

A phantastic feature - BucketFill advanced can output all PB graphic functions with textures, images, photos
Directly on images and canvas - with alpha blending and flicker free animations
:shock:
Image

Incredible sprite output, with alpha blending and gradient color functions, on images, PB sprites, canvas, screen
Image

Image

Incredible texture flood fill, with color distance, alpha blending, gradient color and many more, for images, PB sprites, canvas
Image

Image

BoxGo_BF and LineGo_BF - Very nice animated boxes and lines
Image

DrawText_BF - Nearly endless abilities for text output
Image

Image

Image

Image

Image

Simple create your own powerful BF enhanced applications
Image

Image

Image

Image

Create powerfull GIF and sheet outputs
Image

ImageGadget_BF - Many abilities- simplest for using
You can scroll text blocks and images on all directions at the same time
You can output also images with invisible background
You can output without Gadget frames and visible background
You can use same the PB ImageGadgets, inclusive his flags and gadget states
Inclusive FitSize, no unwanted resizing of the ImageGadget
Automatic proportionally correct fitting of images and text
Full compatible with the PB ImageGadget
Image

Inclussive progressbar professional (PP)
Image
Last edited by walbus on Tue May 29, 2018 6:20 pm, edited 418 times in total.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Replace any colors with textures - little base code

Post by Mistrel »

Can you provide some example images and their result?
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Replace any colors with textures

Post by walbus »

Added
Last edited by walbus on Sat Dec 23, 2017 6:49 pm, edited 91 times in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Replace any colors with textures - little base code

Post by wilbert »

If you don't mind using a recent PB version, you can also use VectorSourceImage to fill with a texture.
Windows (x64)
Raspberry Pi OS (Arm64)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Replace any colors with textures

Post by walbus »

Primary, yes, but it has to many restrictions and can not handle color distance
Last edited by walbus on Sat Dec 23, 2017 6:52 pm, edited 22 times in total.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Replace colors with textures - Full featured procedure

Post by Mistrel »

I see how it works now. There is a similar feature for bucket filling with a pattern in Photoshop. Thanks for the illustration. :)
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 617
Joined: Mon May 09, 2011 9:36 am

Re: Replace colors with textures - Full featured procedure

Post by VB6_to_PBx »

if you move the Window partially off Screen and back again ,
then that part of the Texture gets erased :(

How can erasing be prevented ??
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Replace colors with textures - Full featured procedure

Post by walbus »

This is a Windows "feature", just use a canvas, it doesn't happen there.
Otherwise, you will have to redraw the content yourself.
Look at #PB_Event_Repaint
Last edited by walbus on Sun Dec 24, 2017 11:15 am, edited 4 times in total.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Replace colors with textures - Full featured procedure

Post by #NULL »

would not a CustomFilterCallback() work for this too? drawing one image onto the other and in the callback check for the target color, and if pixel is appropriate draw the source color (or even blend it).

for the bucket/floodfill there is FillArea() but that only supports a fixed border color.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Replace colors with textures - Full featured procedure

Post by walbus »

added
Last edited by walbus on Sun Dec 24, 2017 11:20 am, edited 4 times in total.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Replace colors with textures - Full featured procedure

Post by #NULL »

but your code can be adjusted for use with sprites, which are not officially supported by CustomFilterCallback().
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Replace colors with textures - Full featured procedure

Post by walbus »

Added
Last edited by walbus on Sun Dec 24, 2017 11:20 am, edited 5 times in total.
WilliamL
Addict
Addict
Posts: 1214
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Bucket Fill advanced & Sprite support for Images and Can

Post by WilliamL »

Hey walbus,

I just tried your new versions (d20 m11 y2016).

The old 'image' version just gave me a blank screen and it may have had something to do with WindowOutput needing to look for a re-draw event (possibly).

The new 'image' version just give me an error 'invalid memory access' on this line (456) and the window is never opened.

Code: Select all

    CopyMemory(*drawing_buffer_grabed_image, DrawingBuffer_(),
               MemorySize(*drawing_buffer_grabed_image)) ; Refresh image
The new CanvasGadget code gives me many pictures (works ok) but then gives me the same error on line 464.
MacBook Pro-M1 (2021), Sonoma 14.3.1 (CLT 15.3), PB 6.10b7 M1
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Bucket Fill advanced & Sprite support for Images and Can

Post by infratec »

In the code are no checks if something was ok or not.

It should be always:

Code: Select all

If StartDrawing()
and

Code: Select all

If drawing_buffer_grabed_image
In the else path you can add debug messages to see when it fails.

For better reading also an * should be used to see that it is a 'pointer', but that's only a personal point.

Bernd
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Bucket Fill advanced & Sprite support for Images and Can

Post by infratec »

And for demo codes inside of a pbi listing I use always

Code: Select all

CompilerIf #PB_Compiler_IsMainFile
  EnableExplicit
CompilerEndIf
at the beginning and

Code: Select all

CompilerIf #PB_Compiler_IsMainFile
:
:
CompilerEndIf
to write the demo code at the end of the file.
So you don't need to change something when you include it in an other file or project.

Bernd
Post Reply