im_fx_curves.pl
im_fx_curves.pl
Hello all
I am battling with the im_fx_curves.pl script provided on the imagemagick site. this is a perl script that allows you to make adjustments similar to photoshop curves: http://www.imagemagick.org/Usage/script ... _curves.pl
the only modification I have made to the script is changing the path to my perl, I am using macports perl, so the first line of this script is changed to #!/opt/local/bin/perl
I have installed Math::Polynomial from cpan
I am copying an example from inside the script, the example it gives is
./im_fx_curves.pl -p 0,20 100,90 20,80 70,50
When I run this dummy example, I get an error that says
usage: $q = $p->interpolate([$x1, $x2, ...], [$y1, $y2, ...]) at ./im_fx_curves.pl line 55
I do not know how to read perl, but line 55 of the perl script is
my $poly = Math::Polynomial::interpolate( @ARGV );
has anyone been able to get this script to work? Can any of you perl or imagemagick gurus see what I am doing wrong? Has any body got this script to successfully work for themselves?
I am battling with the im_fx_curves.pl script provided on the imagemagick site. this is a perl script that allows you to make adjustments similar to photoshop curves: http://www.imagemagick.org/Usage/script ... _curves.pl
the only modification I have made to the script is changing the path to my perl, I am using macports perl, so the first line of this script is changed to #!/opt/local/bin/perl
I have installed Math::Polynomial from cpan
I am copying an example from inside the script, the example it gives is
./im_fx_curves.pl -p 0,20 100,90 20,80 70,50
When I run this dummy example, I get an error that says
usage: $q = $p->interpolate([$x1, $x2, ...], [$y1, $y2, ...]) at ./im_fx_curves.pl line 55
I do not know how to read perl, but line 55 of the perl script is
my $poly = Math::Polynomial::interpolate( @ARGV );
has anyone been able to get this script to work? Can any of you perl or imagemagick gurus see what I am doing wrong? Has any body got this script to successfully work for themselves?
Re: im_fx_curves.pl
You might need something else installed - are there any notes about needing any other software, minimum requirements etc. at the top of the code ?
Re: im_fx_curves.pl
Nope Bonzo, I see none. My perl script is exactly the same as this one, bar the path to perl
http://www.imagemagick.org/Usage/script ... _curves.pl
http://www.imagemagick.org/Usage/script ... _curves.pl
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: im_fx_curves.pl
I have a bash shell script, curves, that does something like PS. see the link below
Re: im_fx_curves.pl
I see "This is a perl version using the Math::Polynomial library"
I pressume you need to install, activate or whatever you do with Perl.
Also in Anthony's other script:
I pressume you need to install, activate or whatever you do with Perl.
Also in Anthony's other script:
# ASIDE:
#
# Gabe Schaffer created a perl version using the Math::Polynomial library
# (not a standard perl install) in "im_fx_curve.pl"
#
Re: im_fx_curves.pl
Thank you bonzo and fmw42 for taking the time to help me.
fmw42 I have got that shell script working. I am going to abandon the perl script. I will mess around with it now and hopefully come up with the results i am after.
Thank you once again.
fmw42 I have got that shell script working. I am going to abandon the perl script. I will mess around with it now and hopefully come up with the results i am after.
Thank you once again.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: im_fx_curves.pl
I hosted the script in IM Examples. I just copied and pasted your command and it ran perfectly...imagegem wrote: I am copying an example from inside the script, the example it gives is
./im_fx_curves.pl -p 0,20 100,90 20,80 70,50
When I run this dummy example, I get an error that says
usage: $q = $p->interpolate([$x1, $x2, ...], [$y1, $y2, ...]) at ./im_fx_curves.pl line 55
I do not know how to read perl, but line 55 of the perl script is
my $poly = Math::Polynomial::interpolate( @ARGV );
Code: Select all
im_fx_curves.pl -p 0,20 100,90 20,80 70,50
I have no idea why the Math::Polynomial::interpolate() function is producing a usage message, unless the module has changed since I last installed a personal copy.7.560*u^3-11.946*u^2+5.087*u+0.200
I'll update and see if that is the case.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: im_fx_curves.pl
yes it looks like the Perl module changed....
This was found in the packages "examples/migration.pl" file...
switching to a [x1,x2,..], [y1,y2,...] input format... Arrggghhhhh.....
It will probably take some study to get the function fixed. Perhaps the original author, Gabe Schaffer, would help.
In the mean time you could try switching to the gnuplot function fitting method in "im_fx_curves"
This was found in the packages "examples/migration.pl" file...
Worse still it appears to no longer follow a x1,y1, x2,y2, .... type of input for the pointsMath::Polynomial version 1.000 broke backwards compatibility with earlier versions. This example demonstrates how legacy code using Math::Polynomial version 0.04 can be adapted to use a more current version of Math::Polynomial.
switching to a [x1,x2,..], [y1,y2,...] input format... Arrggghhhhh.....
It will probably take some study to get the function fixed. Perhaps the original author, Gabe Schaffer, would help.
In the mean time you could try switching to the gnuplot function fitting method in "im_fx_curves"
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: im_fx_curves.pl
Okay a new version that works has now been uploaded (give it an hour or so to appear)
The old one has been renamed "im_fx_curves_old.pl"
The old one has been renamed "im_fx_curves_old.pl"
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: im_fx_curves.pl
thank you anthony