GFX_Wizzard_BF - [Modules - All OS]

Share your advanced PureBasic knowledge/code with the community.
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: BucketFill advanced - GFX for PB

Post by Sicro »

Ionic Refugee wrote:What license is this source code is released under?
BSD 2-clause “Simplified” License

@walbus:
It would be nice if you also mention in your license text that it is the above license.

Additionally, it would be better if you would write the license text directly into a "License.txt" file.
Currently, in your "__Licence hint__.txt" file, you point out that the user should look into your code.

It's nice to see how you keep up developing on the code. 8)
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Thanks Sicro
Licence file is added to the download packet
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Codes updated d01 m01 y2018

New sprite functions added :
Recoloring function & alpha blending with recoloring added - all combinable with color distance
Looking very cool :o

Look for :
"rotate sprites with color distance on windowed screen and canvas" demo codes

And "BucketFill_Sprite_simple_Mask_creating_demo.pb"

Self creating mighty BF enhanced PB functions, with the "BF universal function", enhanced
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by Andre »

Hi walbus,

after a longer time I played around a bit (again) with your fantastic gfx effects, but I have no clue where (with which demo codes, ff. with which BF functions) to start with the following (possibly easy) task:

My goal is
- to stitch together several (3-5) pictures to a larger picture collage,
- change its brightness (make it more bright),
- blend some text and two GFX logos over it
(standard would be to create only a resulting large image, optional it could be animated - but it should work without spritess then and use canvas output or similar instead...)

Thanks again for your great GFX tool + probably some tips for guiding me in the right direction :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: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Hi Andre,
I have add a demo code for you to the latest BF download packet

"BucketFill_Images as_Sprites_on canvas.pb"

Use the latest download packet
Have fun :wink:
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by Andre »

walbus wrote: I have add a demo code for you to the latest BF download packet

"BucketFill_Images as_Sprites_on canvas.pb"
Thank you very much, Werner! :D

Seems exactly like what I need. Now I need to implement + adapt it into my project. I will report here about the further progress (which could need some time)... :mrgreen:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Nice to here Andre
Have fun with it
Your demo and new functions are enhanced now
Last edited by walbus on Thu Jan 04, 2018 9:58 am, edited 1 time in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Codes updated d11 m01 y2018
Many new functions, little fixes and enhancements

As sample : Sprite output with alpha blending and gradient color functions, on images, PB sprites, canvas, screen

Demo codes :
"BucketFill_Sprite_using_BF_GradientColor_Sprite.pb"
"BucketFill_rotate_Sprite_on_windowed_screen_color_distance_GradientColor.pb"

Image
Last edited by walbus on Sun Jan 14, 2018 9:57 pm, edited 3 times in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Codes updated d13 m01 y2018

FloodFill_BF updated

Now with incredible gradient color functions :shock:

This function can output colors and textures
With color distance function
Texture tiling, scrolling, clipping, adjusting
Can change colors, brightness, contrast, alpha blending
Can output on images, PB sprites, canvas

Demo code : "BucketFill_simple_FloodFill_with_gradient_colors.pb"

Image
Last edited by walbus on Sat Jan 13, 2018 1:16 pm, edited 1 time 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: BucketFill advanced - GFX for PB [Modules - All OS]

Post by Andre »

Hi Walbus,

thank you very much for your awesome GFX package :!: :D

I started to integrate the BucketFill module into my project. And my first success is the new loading screen, using the coloring + rotating + tiled background functions to create nice picture collages 'on the fly'.

Here are 3 example screens:
Image Image Image

:mrgreen:

One suggestion I have for now:
Please add 'speaking' constants for using them as function parameters, e.g. for 'mode' values (instead of the currently used 'pure' numbers). This would ease the understanding of the program code, and already the examples, a lot. I think... :wink:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Hi Andre,
Yeah, looks very good.
Nice to see that you can use it usefully
I will describe the demo codes in more detail
It's a lot of work, there have become very many

Regards Werner
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by Andre »

Thanks to the help of walbus I was able to create the final version of the 'Intro' (loading screen) of my application.

It runs fine on MacOS (El Capitan) and so does the BucketFill package :D
And I was able to create the picture collage with anti-aliasing (see the smooth white borders 8)) - just finished in the Windows version.

Here the latest screenshots (MacOS, and final version on Win10):
Image Image

To use the anti-aliasing function see the "BucketFill_rotated_Images as_Sprites_on canvas_with_edge smoothing_demo.pb" example in the package! :mrgreen:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Hi Andre,
yep, very good
Twisted images with smooth edges in a texture look simply cool 8)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Codes updated d21 m01 y2018

Fixes, changes, enhancements, new demo codes, new functions

As sample :
This function can convert on the fly, images, PB sprites, canvas
Also the function can create images and PB sprites

Code: Select all

; This function change the brightness, color, contrast - The function works with images, PB sprites, canvas
  ; The parameters are percent based - positive and negative values
  ; Source and destination must have the same size
  ; mode 0 = without creating a new output - mode 1 create a image - mode 2 create a PB sprite
  ; sprite_mode - Same PB function call for PB sprite creating
  ; Tree grey modes available mode=1, mode=2, mode=3 - mode=1 is more neutral
  Declare Image_coloring_BF(source_ID, destination_ID,
                            change_red.f=0,
                            change_green.f=0,
                            change_blue.f=0, 
                            change_contrast.f=0,
                            change_brightness.f=0,
                            change_intensity.f=0,
                            mode_grey=0,
                            mode=0,
                            sprite_mode=0)
This is a mighty function for output resized images, exactely positioned in a defined rectangle, any sizes
The function can handle a background grid, background colors, images with alpha channel
Can output as images or PB sprites
Primary this function is a complete image player for all things

Code: Select all

  Declare FitImage_BF(mode, image_ID,
                      fit_width,                ; Fit image to this width
                      fit_height,               ; Fit image to this height
                      background_color=$DCDCDC, ; Background color
                      padding=0,                ; Padding
                      grid_color=$FFFFFF,       ; Grid color
                      grid_size=5,              ; Grid size
                      grid_tiling=10,           ; Grid tiling
                      frame_color=$FFFFFF,      ; Frame color
                      frame_size=3,             ; frame_size
                      sprite_mode=0)            ; Sprite mode for PB sprite output
                                                ; mode 0 = image output
                                                ; mode 1 = Without background
                                                ; mode 2 = PB sprite output
                                                ; mode 3 = Without output - You can use GetFitSize_Width_BF and GetFitSize_Height_BF for get the calculated width and height
                                                ; This function can output images and PB sprites
                                                ; Look the FitImage demo cod
; This function load and rotate automaticaly photos with EXIF data
; Important as sample for many "Handy" photos
; The function is parameter compatible to LoadImage and can replace it
; Its more and more needed for primary using this function

Code: Select all

  Declare LoadPhoto_BF(image_ID, path$)                                   
Sample code for this three functions : "BucketFill_FitImage_demo.pb"

And more...
Last edited by walbus on Tue Jan 23, 2018 9:20 am, edited 5 times in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: BucketFill advanced - GFX for PB [Modules - All OS]

Post by walbus »

Hint :
Function FitImage_BF enhanced

Code: Select all

; You can use the GetFitSize_BF function to get results for proportional resizing with many BF functions
; GetFitSize_Width_BF and GetFitSize_Height_BF give back the calculated proportional width and height
GetFitSize_BF(ImageWidth(image_ID), ImageHeight(image_ID), fit_width, fit_height)
Debug GetFitSize_Width_BF() ; Give back the calculated proportional width from GetFitSize_BF
Debug GetFitSize_Height_BF(); Give back the calculated proportional height from GetFitSize_BF
Last edited by walbus on Mon Jan 22, 2018 11:08 pm, edited 4 times in total.
Post Reply