Generation Loss

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?".
Post Reply
pikasaurus
Posts: 1
Joined: 2014-04-05T00:00:14-07:00
Authentication code: 6789

Generation Loss

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Generation Loss

Post 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.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Generation Loss

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply