I am very new to IM and having a problem. I'm sure it's simple but I haven't figured it out. I'm trying to convert a whole folder of png files and resize them. This is what I typed in the command line:
convert C:\FullFilePath\imgs\ -resize 50% *.png
I keep getting can't find directry and can't open *.png. The file path is correct.
I tried reading up on it, but with no success.
Problem with convert -resize
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with convert -resize
Use mogrify instead of convert. It can handle a whole folder of images, resize them and then write then to the same folder overwriting your original image (bad idea) or to a new folder
see
http://www.imagemagick.org/Usage/basics/#mogrify
see
http://www.imagemagick.org/Usage/basics/#mogrify
Re: Problem with convert -resize
Can you give me the syntax? I'm still missing something. I get the following errors:
1) unable to open image ... permission denied @ error/blob.c/OpenBlob/2619
2) no decode delegate for this image format ... @ error/constitute.c/ReadImage/544
(... is just to exclude the file path)
Thanks for the reply.
1) unable to open image ... permission denied @ error/blob.c/OpenBlob/2619
2) no decode delegate for this image format ... @ error/constitute.c/ReadImage/544
(... is just to exclude the file path)
Thanks for the reply.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with convert -resize
suppose your images are in folder1. create a new directory called folder2
cd to folder 1
mogrify -path /path2/folder2 -format png -resize 50% *
or if you only want to limit it to certain format (so you don't try to convert some odd text file) in your folder1, then
mogrify -path /path2/folder2 -format png -resize 50% *.png *.gif *.jpg
I don't know if your filesystem will be case sensitive, but if it does just add the same in caps
mogrify -path /path2/folder2 -format png -resize 50% *.png *.gif *.jpg *.PNG *.GIF *.JPG
If you are on Windows, the some syntax will be different (apart from \ in place of / for paths). For example % needs to be escaped as %%.
See http://www.imagemagick.org/Usage/windows/
cd to folder 1
mogrify -path /path2/folder2 -format png -resize 50% *
or if you only want to limit it to certain format (so you don't try to convert some odd text file) in your folder1, then
mogrify -path /path2/folder2 -format png -resize 50% *.png *.gif *.jpg
I don't know if your filesystem will be case sensitive, but if it does just add the same in caps
mogrify -path /path2/folder2 -format png -resize 50% *.png *.gif *.jpg *.PNG *.GIF *.JPG
If you are on Windows, the some syntax will be different (apart from \ in place of / for paths). For example % needs to be escaped as %%.
See http://www.imagemagick.org/Usage/windows/
Re: Problem with convert -resize
Got it! Two things I was doing wrong -- I didn't escape the 50%% and I didn't have "format png" -- I don't remember seeing that before...
Thanks very much!
Thanks very much!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with convert -resize
the -format png says you want png to be the output format
Re: Problem with convert -resize
What does the *png do?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with convert -resize
it should be *.png
any way, it says look for and process all files that end in .png, but leave any files with other suffixes unprocessed.
any way, it says look for and process all files that end in .png, but leave any files with other suffixes unprocessed.