- My suggestion for you is to use
-append instead of -splice . - Image size may vary, but you can recognize the width by running
identify -format %W image1.jpg .
So, one possible command to achieve the desired:
convert \ input.jpg \ -size $(identify -format %W input.jpg)x20 gradient: \ -append \ output.jpg
Update:
The above command works on Linux, Unix or Mac OS X, but not on Windows. On Windows, the easiest way to achieve the same thing would be to use something like these two commands:
for /f "usebackq delims= " %I in (`identify -format %W input.jpg`) do set width=%I convert input.jpg -size %width%x20 gradient: -append output.jpg
The above is for direct execution in the cmd.exe window. If you put the commands in a batch file, you need to change %I to make it %%I :
(Sorry, I donβt have a Windows system right now to check the exact syntax ...)
Update2: Windows bat alternative for Bash built-in command
Kurt pfeifle
source share