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?".
As far as I know, Imagemagick does not traverse subdirectories. So you need to script finding each subdirectory and processing each image in the subdirectory.
Proper IM syntax reads the input image before processing such as -resize.
If you use the convert syntax for dissolve rather than composite, you do not need to do a pipe.
fmw42 wrote:As far as I know, Imagemagick does not traverse subdirectories. So you need to script finding each subdirectory and processing each image in the subdirectory.
Proper IM syntax reads the input image before processing such as -resize.
If you use the convert syntax for dissolve rather than composite, you do not need to do a pipe.
can you help me, i am new to imagemagick, i do not how to do a pipe, can you help me write, thanks
yes, so how to scripting in bash, i can process all pics, includes sub folders thanks,
Your code is already scripting in bash. It starts with
#!/bin/bash
and does its looping in bash. Only the convert and composite commands are Imagemagick.
thanks, but it only process root folder TempL, do not process sub folders such as folder1 folder2 in the TempL, how to modify the bash, it can process all pics includes sub folders in TempL?
You will have to find or list all folders you want to process and loop over each one in bash with your script. So you need an outer loop over each folder.
fmw42 wrote:You will have to find or list all folders you want to process and loop over each one in bash with your script. So you need an outer loop over each folder.
so how to write in one script, i am new to bash command, can you help me, thanks
You could use the unix command 'find' to traverse all folders and subfolders.
Provided your pictures are all jpg, something like that will list all the jpg files
found in the top directory /mnt/hgfs/L/tempL and its subfolders:
#!/bin/bash
find /mnt/hgfs/L/tempL/* -type f -name '*.jpg' | while read each
do
#display the name found: (replace the line echo "..." by the commands you you want to apply to process the $each file found)
echo "$each"
done
This assumes that your pictures are all *.jpg. In case some of them are *.JPG or *.Jpg, etc., use '-iname' instead of '-name'
option for
vonbiber wrote:You could use the unix command 'find' to traverse all folders and subfolders.
Provided your pictures are all jpg, something like that will list all the jpg files
found in the top directory /mnt/hgfs/L/tempL and its subfolders:
#!/bin/bash
find /mnt/hgfs/L/tempL/* -type f -name '*.jpg' | while read each
do
#display the name found: (replace the line echo "..." by the commands you you want to apply to process the $each file found)
echo "$each"
done
This assumes that your pictures are all *.jpg. In case some of them are *.JPG or *.Jpg, etc., use '-iname' instead of '-name'
option for
for each in `find /mnt/hgfs/L/tempL -name '*.jpg'`
now it can work well
but here are new problem, if the sub folder name contain special characters such as Korean word, special characters, it run wrong, how to process folder name that contain special characters ?