A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T10:04:29-07:00
Code: Select all
proc="path 'M $xb,$yb A $rad2,$rad2 0 0,0 $xc,$yc A $rad1,$rad1 0 0,0 $xr,$yr Z"
I tried the shell script. But i didn't get the output.
Is that above line correct?
'M => starts with single quotes but i don't know where does it end. could it be a problem?
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T10:25:07-07:00
I just added the single quotes at the end of Z.
And i got the following error.
Code: Select all
proc="path 'M $xb,$yb A $rad2,$rad2 0 0,0 $xc,$yc A $rad1,$rad1 0 0,0 $xr,$yr Z'"
Code: Select all
convert: unable to open image `M 113.846,479 A 312.467,312.467 0 0,0 205,307 A 210.734,210.734 0 0,0 321,340.177 Z':
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-08-30T10:31:01-07:00
First if this is really about my script, pagepeel, then it should be moved to
viewforum.php?f=26 .
More importantly, I do not see any connection between my script, pagepeel, and the syntax you are trying to use.
Please clarify what you are trying to do!
It looks like you are trying to set up some path arguments for a -draw command as per
http://www.imagemagick.org/Usage/draw/#mvg_settings
I do not know what that has to do with my script arguments.
Last edited by
fmw42 on 2013-08-30T10:37:53-07:00, edited 1 time in total.
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T10:34:58-07:00
I m really sorry. I didn't check all the forum topics. I wrongly created the topic here.
It is your script.
pagepeel.sh
485th line
Code: Select all
proc="path 'M $xb,$yb A $rad2,$rad2 0 0,0 $xc,$yc A $rad1,$rad1 0 0,0 $xr,$yr Z"
this line is coming in the else part..
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-08-30T10:40:17-07:00
agriz wrote: I m really sorry. I didn't check all the forum topics. I wrongly created the topic here.
It is your script.
pagepeel.sh
485th line
Code: Select all
proc="path 'M $xb,$yb A $rad2,$rad2 0 0,0 $xc,$yc A $rad1,$rad1 0 0,0 $xr,$yr Z"
this line is coming in the else part..
OK. So what is the problem?
What command line did you use to run my script that caused a problem? Please provide that command line and your input image?
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T10:45:29-07:00
Code: Select all
convert pagepeel_1_5220d651643a9.mpc \( -size 322x480 xc:white -fill black -stroke black -draw 'polygon 113.846,479 321,340.177 321,479' -transparent black +write pagepeel_corner_mask.png \) \( -clone 0 -clone 1 -alpha off -compose copy_opacity -composite -compose over pagepeel_2_5220d6516441f.mpc +swap -flatten \) \( -size 322x480 xc:none -fill black -stroke black -draw path 'M 113.846,479 A 312.467,312.467 0 0,0 205,307 A 210.734,210.734 0 0,0 321,340.177 Z' \) \( -size 322x480 xc:black -sparse-color barycentric '205,307 white 256.8,383.2 hsb(0%%,0%%,25.0004%%)' -evaluate pow 0.5 -level 0x90% \) \( -clone 4 -clone 3 -compose copy_opacity -composite +write pagepeel_gradient_mask.png \) -delete 0,1,3,4 -compose over -composite pagepeel.jpg
The input file and background files are same file. so same width and height.
but input file is jpg and background file is png.
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T11:08:54-07:00
i found the problem :
it should be
Code: Select all
-draw "path 'M 113.846,479 A 312.467,312.467 0 0,0 205,307 A 210.734,210.734 0 0,0 321,340.177 Z'"
I missed that.
Code: Select all
pointsb=`awk -v a2="$a2" -v b2="$b2" -v c2="$c2" -v yb="$yb" -v yc="$yc" \
'BEGIN { for (y=yc; y<=yb; y++) { x = a2*y*y+b2*y+c2; print x, y }; }'`
I am learning shell script. But this line is very complex for me to understand.
i know awk is used to assign the variables. It has lot of keywords in one line.
Can you please explain it?
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-08-30T14:35:56-07:00
Are you suggesting that there is an error in my script? Or was it just your misunderstanding?
agriz
Posts: 237 Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308
Post
by agriz » 2013-08-30T14:39:17-07:00
parabola must be working good without any problem.
But i believe the ark has a problem.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-08-30T15:13:55-07:00
I will look into it when I get a chance. Very busy right now. Thanks.