Page 1 of 1

Generation Loss

Posted: 2014-04-05T00:29:05-07:00
by pikasaurus
Hi. I'm really new to window command prompt and image magick. I am attempting to try to replicate Burny's code here:

Code: Select all

for i in {0..2001}; do 

convert GenerationLoss_step$i.jpg -rotate 90 -quality 85 GenerationLoss_step$(($i+1)).jpg

if [ $(($i%100)) -ne 0 ]; then
 rm GenerationLoss_step$i.jpg
fi
#
# (( i % 100 )) && rm GenerationLoss_step$i.jpg

echo -n "."

done
I've gotten it to do one iteration, but no more. I am running this through the command prompt (correct right?). If you have any advice, walkthroughs, or places where I should research, I would be much obliged. Again, apologizing ahead of time for being so noob.

Re: Generation Loss

Posted: 2014-04-05T04:42:55-07:00
by snibgo
That looks like Unix script to me. Windows isn't Unix. You can install cygwin to run Unix scripts, or you can translate it to Windows.

Re: Generation Loss

Posted: 2014-04-05T06:28:39-07:00
by snibgo
A translation to Windows BAT is:

Code: Select all

%IM%convert rose: GenerationLoss_step0.jpg

echo off

for /L %%i in (0,1,1999) do (
  set /A NEXT=%%i+1

  %IM%convert GenerationLoss_step%%i.jpg -rotate 90 -quality 85 GenerationLoss_step!NEXT!.jpg

  set /A x = ^(%%i/100^)*100
  if !x!==%%i (
    echo .
  ) else (
    del GenerationLoss_step%%i.jpg
  )
)

echo on
The outputs can be browsed to see the degeneration. It's quite instructive to change the quality setting. "100" gives a vast improvement.