Need to randomley ShearRotateImage in Folder
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Need to randomley ShearRotateImage in Folder
I am having trouble getting Imagemagick to do this. This is what I have so far. I need to select any file that has *.jpg and randomly rotate and shear the images within 10 degrees.
Help
magick /Users/Username/Desktop/folder/*.jpg ShearRotateImage(const Image *jpg,"%[fx:-1+2*rand()]")
Help
magick /Users/Username/Desktop/folder/*.jpg ShearRotateImage(const Image *jpg,"%[fx:-1+2*rand()]")
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need to randomley ShearRotateImage in Folder
Your syntax is bad. You are mixing command line and API code. Also you cannot use wild cards for both input an output. You should use magick mogrify to process a folder of images. But mogrify is old technology and does not allow inline computations. So you will likely need to write a script loop over each image and process them that way. Then you can do
see https://imagemagick.org/script/command- ... .php#shear
____________________
Please, always provide your IM version and platform when asking questions, since syntax may differ.
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli
Code: Select all
magick image.jpg -alpha on -background none -shear "%[fx:10*(-1+2*rand())]x0" image.png
____________________
Please, always provide your IM version and platform when asking questions, since syntax may differ.
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
magick /Users/username/Desktop/MM10918\ copy /image.jpg -alpha on -background none -shear "%[fx:10*(-1+2*rand())]x0" image.jpg
magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.
I keep getting this error?
magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.
I keep getting this error?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need to randomley ShearRotateImage in Folder
What is your IM version and Platform/OS? If a Unix system, I can help with the script loop. If on Windows, then someone else would have to help.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need to randomley ShearRotateImage in Folder
Filenames with spaces need to be put in double quotes. You are also mixing \ and /. For Unix, only use /
Or do I misunderstand your \ copy /
Code: Select all
magick "/Users/username/Desktop/MM10918/ copy /image.jpg" -alpha on -background none -shear "%[fx:10*(-1+2*rand())]x0" image.jpg
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
I am using V7 on High Sierra. Yes there are spaces in the file names
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
magick "/Users/celvenjohnson27\ 1/Desktop/MM10918\ copy/image.jpg" -alpha on -background none -shear "%[fx:10*(-1+2*rand())]x0" image.jpg
Im using this but getting the same error directory @ error/blob.c/OpenBlob/348
Im using this but getting the same error directory @ error/blob.c/OpenBlob/348
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
Does this apply to all the .jpg files in the folder?
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
Does this apply to all the .jpg files in the folder?
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
unable to open image . this is the error Im getting
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
I got the path to work, Im not sure it is working though? They do not look rotated or sheared?
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-23
Using Mac
Using Mac
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need to randomley ShearRotateImage in Folder
Cd to the directory where you have your input and try it there
Does that work?
What exact version of IM 7?
If you file path actually has \ then use your actual file path but put double quotes about it. But are you sure about the path? Why do you want spaces. That just makes it more confusing. I do not advise doing that. But it should work if you have the correct path and use quotes.
Code: Select all
magick image.jpg -alpha on -background none -shear "%[fx:10*(-1+2*rand())]x0" image.png
What exact version of IM 7?
Code: Select all
magick -version
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-23
-
- Posts: 12
- Joined: 2018-10-10T09:26:59-07:00
- Authentication code: 1152
Re: Need to randomley ShearRotateImage in Folder
this is the error I get now after i cd the directory
magick: unable to open image 'image.jpg': No such file or directory @ error/blob.c/OpenBlob/3489.
the files are formatted as "yyyy-mm-dd-hh-mm-ss.jpg"
magick: unable to open image 'image.jpg': No such file or directory @ error/blob.c/OpenBlob/3489.
the files are formatted as "yyyy-mm-dd-hh-mm-ss.jpg"