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?".
hi everyone. So I have the below script to generate contact sheets for large image files in bash/Linux. However I need to transfer this to Windows notebook at work (I am not allowed to instull Linux there).
I have installed ImageMagic for Windows
I am just so lost at how to make it all work in either command line or Window's powershell. I am still reading, but it takes time. Perhaps any advanced Windows professionals would help me with translation of the below code for Windows? I would be so very grateful. Thanks so much
jessicaC wrote: ↑2017-11-04T04:05:39-07:00I am just so lost at how to make it all work in either command line or Window's powershell. I am still reading, but it takes time. Perhaps any advanced Windows professionals would help me with translation of the below code for Windows? I would be so very grateful. Thanks so much
This simple BAT script should be almost an exact translation from your bash script to Windows CMD...
@echo off
mkdir n
for %%I in ( *.jpg ) do (
convert "%%I" -set option:mylabel "%%[w]x%%[h]\n%%[f]" -verbose ^
-font Helvetica -pointsize 15 -geometry 200x200+2+2 -auto-orient ^
-resize 200x200 -fill gray -gravity center label:"%%[mylabel]" -append "n\%%I"
)
cd n
montage -font Helvetica -pointsize 10 -background #FFFFFF -fill gray ^
-geometry 300x300+2+2 -auto-orient *.jpg contact-light.jpg
move contact-light.jpg ..\
cd ..\
rmdir /s /q n
exit /b
Copy that into a text editor and save it with a name like "myscript.bat". If the script is in the same directory as your images, you should be able to run it from a Windows command prompt or by double-clicking it in a Windows explorer (file manager) window.
To run those commands directly from the command line you'd need to change any double percent signs "%%" to singles "%".
I haven't tried working it into a PowerShell script, but it's so simple I probably wouldn't bother.