This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > October 2007 > curve fitting in PSP





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author curve fitting in PSP
Bruce

2007-10-23, 3:17 am

A few weeks ago, someone asked how to extract a curve. The question was
a bit vague but it got me thinking about this because I have been
working with a similar problem.

I have picked up many useful tips from this site, so here is my
contribution. It's a bit complicated, so I have included a trivial demo
to show the process.

The concept is that you start with some raster curve and need to extract
a polynomial that fits the curve. By using a vector path in PSP, it is
easy to trace over the raster curve. The node points in the path can now
be read by a PSP script (thanks Suz) and processed to give the
polynomial coefficients.

The attached files are:

curve_fit_demo.pspimage
Sample image to demonstrate the script

bw_svd.py
Python curve fitting routines must be located in the Python libraries
folder.
e.g., "C:\Program Files\Jasc Software Inc\Paint Shop Pro 9\Python Libraries"

bw_curve_fit.PspScript
Script that you uses the curve fitting routines. The vector must be selected

Bruce

Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews