PureBasic Forum
http://forums.purebasic.com/english/

Spider Web Drawing
http://forums.purebasic.com/english/viewtopic.php?f=12&t=65601
Page 2 of 3

Author:  JHPJHP [ Sat Apr 30, 2016 12:11 am ]
Post subject:  Re: Spider Web Drawing

Hi Keya,

I take it you still haven't downloaded PureBasic Interface to OpenCV ? I spent a couple days writing Spider Web Drawing, and a couple years on the former.
- version 2.4.12 has 18 more relevant examples (don't let an examples legacy tag fool you)

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

Hi Andre,

Thank you for your stamp of approval, it means a lot.

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

Hi dobro,

I have absolutely no doubt that your code is original, you have more then proven your skills as a programmer; my attempt at humor was a fail.

Thank you for the link, I can see how the video inspired you, same as the image in my first post inspired me.

Author:  dobro [ Sat Apr 30, 2016 1:38 am ]
Post subject:  Re: Spider Web Drawing

JHPJHP wrote:
my attempt at humor was a fail.

no no !! :lol:

I do not master the English language, and use
Google translator, so necessarily the nuances are erased :lol:

Author:  JHPJHP [ Sat Apr 30, 2016 4:36 am ]
Post subject:  Re: Spider Web Drawing

Hi dobro,

Cheers.

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

Based on comments from wilbert I've updated the code and binaries for better cross-platform compatibility.

Updated:
- replaced ico files with png files
- added a few CompilerIf statements
- ...

Compiler Options/Use Icon is still set to an ICO file, but I've included an ICNS file in the binaries folder for the Mac OS.

Author:  wilbert [ Sat Apr 30, 2016 5:29 am ]
Post subject:  Re: Spider Web Drawing

JHPJHP wrote:
Based on comments from wilbert I've updated the code and binaries for better cross-platform compatibility.

It's working now on OSX without any modification :)

Author:  idle [ Sat Apr 30, 2016 5:49 am ]
Post subject:  Re: Spider Web Drawing

Great effect! I looked this morning before my cup of coffee and got quite frustrated repeatedly trying to wipe the cobwebs out of my eyes
so I could see what I was looking at. :lol:

Author:  JHPJHP [ Sat Apr 30, 2016 9:16 am ]
Post subject:  Re: Spider Web Drawing

Hi wilbert,

Thanks for the heads up, I'm glad it's fixed; I've applied the same solution to LSB (Least Significant Bit) File Embedding.

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

Hi idle,

Thank you. If coffee isn't working for you I suggest something a little stronger. :)

Author:  JHPJHP [ Sun May 01, 2016 3:37 am ]
Post subject:  Re: Spider Web Drawing

Updated:
- improved the grayscale algorithm
- fixed an incorrect Constant
- applied some general code-cleanup

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

Demonstrated in the application Barbouille (Pure_autoPaint) written by dobro, drawing with different shapes produces varying effects.

I'm not going to apply any additional effects to this project, but if you're so inclined...

Modify:
Code:
LineXY(nX1, nY1, nX2, nY2, RGB(nR1, nG1, nB1))

With one of the following shapes (or draw your own):
Code:
Ellipse(nX1, nY1, nX2 - nX1, nY2 - nY1, RGB(nR1, nG1, nB1))
Box(nX1, nY1, nX2 - nX1, nY2 - nY1, RGB(nR1, nG1, nB1))

At a minimum adjust the following values to optimize the result:
- there are various others parameters that can enhance the effect
Code:
nDistance.f = 100
If nDistance > 25 : nDistance - 0.1 : EndIf

NB*: As a side note, this effect including 100+ other effects have been available in PureBasic Interface to OpenCV for awhile.

Author:  JHPJHP [ Mon May 02, 2016 10:23 am ]
Post subject:  Re: Spider Web Drawing

Updated:
- added 4 color spaces
-- Convert to YUV / YCrCb
-- Convert to XYZ
-- Convert to HSV / HSB
-- Convert to HLS

Switched from using Point / Plot to direct pixel manipulation.
- matched closely the standard I became accustomed to while working with OpenCV
- should offer improved speed (not needed here, but required in future projects)

The added color spaces were not intended as a decorative effect...

My intention is to convert a few more examples from PureBasic Interface to OpenCV, but some of the requirements call for an alternate color space from the standard RGB. This project seemed the perfect place to host / test the Procedures, as I was in the process of switching to direct pixel manipulation anyway.

NB*: Update also includes various other improvements not worth documenting.

Author:  JHPJHP [ Wed May 04, 2016 6:16 am ]
Post subject:  Re: Spider Web Drawing

Updated:
- added 4 color spaces
-- Convert to YIQ
-- Convert to Hunter LAB
-- Convert to CIE-LAB
-- Convert to CIE-LUV

JHPJHP wrote:
The added color spaces were not intended as a decorative effect...

My intention is to convert a few more examples from PureBasic Interface to OpenCV, but some of the requirements call for an alternate color space from the standard RGB. This project seemed the perfect place to host / test the Procedures, as I was in the process of switching to direct pixel manipulation anyway.

NB*: Update also includes some minor bug fixes and improvements.

Author:  walbus [ Wed May 04, 2016 9:39 am ]
Post subject:  Re: Spider Web Drawing

Very impressive !

Author:  wilbert [ Wed May 04, 2016 10:07 am ]
Post subject:  Re: Spider Web Drawing

JHPJHP wrote:
Switched from using Point / Plot to direct pixel manipulation.

If you want to keep it cross platform, you also need to examine and respect DrawingBufferPixelFormat() .
It's very inconvenient the formats on Windows, OSX and Linux are different.

Author:  JHPJHP [ Thu May 05, 2016 6:32 am ]
Post subject:  Re: Spider Web Drawing

Hi walbus,

Thank you for the complement, it's very much appreciated.

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

Hi wilbert,

I'm not sure about Linux, but I believe the issues with OSX are fixed, please let me know.

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

Working with OSX motivated me to take a second look at the color space algorithms. Most of the associated Procedures have been updated because of this, returning more accurate results.
- I used the example cv_cvtcolor.pb from PureBasic Interface to OpenCV as a guide for comparison

Author:  wilbert [ Thu May 05, 2016 7:19 am ]
Post subject:  Re: Spider Web Drawing

JHPJHP wrote:
I'm not sure about Linux, but I believe the issues with OSX are fixed, please let me know.

Yes, it's working again :)

Author:  idle [ Thu May 05, 2016 7:47 am ]
Post subject:  Re: Spider Web Drawing

it's working on Linux

Author:  JHPJHP [ Thu May 05, 2016 2:59 pm ]
Post subject:  Re: Spider Web Drawing

Hi wilbert,

Thank you for confirming it worked in OSX. I have PureBasic installed in an OSX VM, but I had concerns that the RGB order may still have been a problem.

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

Hi idle,

Thank you for confirming it worked in Linux, I've now installed PureBasic in a Linux OS VM.

If you have a moment I've noticed a few problems.
- elementary OS 0.3.2 Freya (64-bit)
- Built on Ubuntu 14.04
- PureBasic 5.42 LTS (Linux - x64)

The program opens with a window inside another window. The first (outside) window is the correct size, and the second (inside) window is smaller with scroll-bars, hosting all the Gadgets. Both windows have a title bar with the small closing-X, and the first window is transparent.
- have you seen this before, and if so do you know a way to correct it

I've updated the RunProgram (default image viewer) with the application shotwell.
- is this a standard Linux image viewer, and if not what is the default image viewer

Thank you.

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

NB*: I'm pleasantly surprised that all 10 color spaces remained consistent across all three IDE's / OS'.

Page 2 of 3 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/