I'm currently handling this by resizing everything to an arbitrary width of 800px, using the -wave operator, and the resizing again down to thumbnail size, as follows:
Code: Select all
FOR %a IN (*.jpg) DO convert %a[800x] -auto-orient -background none -wave 10x1600 -chop 0x10 -resize 290x290 %athumb.png
I can see a few possibilities. The issue is that I need to know the image width in pixels to tell -wave how to shear the image. Here are the Ideas I have:
1. Drop the command line into a batch file and use that to first interrogate IM for the image width, second drop the width into an environment variable, and third use that to calculate and supply the width (x2) to -wave. The problem is that I can't get this to work in a batch file- see my topic, "Getting command line to work in windows batch file."
2. Some way I haven't figured out of supplying the image width to -wave, perhaps using fx. I haven't managed to get this to work, though I noticed an example where it was done apparently to supply a value to -rotate:
Code: Select all
\( -clone 0 -rotate `convert null: -format '%[fx:rand()*30-15]' info:` \) \
just using a percent escape to provide the width x2 to -wave doesn't work... am I missing something?
I'm new to IM but confident I can get it to work... eventually. Some advice on how best to proceed would be very helpful and appreciated.
Much thanks!
Mike