Cut/crop sine wave shape into image?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
oeoeo
Posts: 10
Joined: 2015-12-04T17:36:18-07:00
Authentication code: 1151

Re: Cut/crop sine wave shape into image?

Post by oeoeo »

This is more of a proof-of-concept right now but I work for a company that (surprise!!) does internet ads. We currently pay people to build them and I'm toying with the idea of making aesthetically "interesting" (and I use the term loosely) ads automagically. This sine wave one was one submitted to get done that way.

I have no good idea why yours does not work for me, however.

I do know that changing the loop to this seems to help:

Code: Select all

 
for ((i=0; i<len; i++))
do
  y="${yArr[$i]}"
  yy=$(echo "scale=6; $amplitude*${y%%%}*.01*2+$row")
  yy=$(echo "${yy}" | bc)
#  yy=`echo "scale=6; $amplitude*${yArr[$i]}*2/$qrange+$row" | bc`
  coordArr[$i]="${xArr[$i]},$yy"
done

  
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cut/crop sine wave shape into image?

Post by fmw42 »

Did you try my alternate suggestions?
oeoeo
Posts: 10
Joined: 2015-12-04T17:36:18-07:00
Authentication code: 1151

Re: Cut/crop sine wave shape into image?

Post by oeoeo »

Did you try my alternate suggestions?
Yep. I get the syntax error message.

Mysteries of the cosmos...

Either way, I appreciate your help and commend your abilities. It's been fun getting my head in bash scripting.
Post Reply