Please help with the batch file
Please help with the batch file
We are fast migrating from Xnconvert.
Can you please help us formulate a batch file which will do these two simple actions:
crop image by 10 pixels from all sides
sharpen image by 20%
overwrite all png files in folder:
C:\test
Thanks a lot!!!
PS: I understand this script can be run in a batch command file (bat)?
Can you please help us formulate a batch file which will do these two simple actions:
crop image by 10 pixels from all sides
sharpen image by 20%
overwrite all png files in folder:
C:\test
Thanks a lot!!!
PS: I understand this script can be run in a batch command file (bat)?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Please help with the batch file
What version of IM? Have you read any of the documentation?
What does "sharpen image by 20%" mean?
What does "sharpen image by 20%" mean?
snibgo's IM pages: im.snibgo.com
Re: Please help with the batch file
yes I am currently reading the manual - was thinking this was a rather simple operation but being a noin programmer will take some time to formulate properly.....we installed ImageMagick-7.0.8-14-Q16-x64
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Please help with the batch file
Yes, it is simple, for example:
But I don't know what you mean by "sharpen image by 20%".
Code: Select all
magick mogrify -shave 10x10 -sharpen 2 *.png
snibgo's IM pages: im.snibgo.com
Re: Please help with the batch file
well - there must be a grading of the sharpening? or like sharpen one step?
Re: Please help with the batch file
can it just sharpen the images once?
Re: Please help with the batch file
fantastic1
what does this mean? can you please help?
-sharpen 2
what does this mean? can you please help?
-sharpen 2
Re: Please help with the batch file
please forgive me for this super dumb question but how do I set the directory for the imagemagick to operate via a BAT file? Can you please show me an example of the full script file in a bat?
Re: Please help with the batch file
another super dumb question - can I run the whole script inside a BAT file which will contain all instructions? can someone please show me an example of such file if this is possible?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Please help with the batch file
Sorry, I am not a Windows user. But about sharpening. -sharpen RadiusxSigma or -sharpen 0x2 for example with sharpen with a Gaussian function whose sigma=2 (standard deviation). The larger the sigma the more sharpening. The radius=0 means for the function to find the optimum radius or window size for the Gaussian function. So I usually leave it at 0. See https://imagemagick.org/script/command- ... hp#sharpen
Another sharpening tool is -unsharp, which is similar to -sharpen, but has more tuning arguments. see https://imagemagick.org/script/command- ... hp#unsharp
For examples, see https://imagemagick.org/Usage/blur/
Another sharpening tool is -unsharp, which is similar to -sharpen, but has more tuning arguments. see https://imagemagick.org/script/command- ... hp#unsharp
For examples, see https://imagemagick.org/Usage/blur/
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Please help with the batch file
I suggest you experiment with "-sharpen" or "-unsharp" to find the parameters that give you what you want. If you provide before and after images of "sharpen image by 20%", perhaps we can suggest the settings.line7 wrote:well - there must be a grading of the sharpening? or like sharpen one step?
The command I showed can be put in a BAT file. And that's it, a complete script. It will change all the PNG files in the current directory.
To change to a directory, use the Windows "cd" command first.
snibgo's IM pages: im.snibgo.com
Re: Please help with the batch file
glads to see you here! I made a quantum leap today and was able to create this batch script file which should supposedly work fine but id does not work(((( can someone please take a look?
it seems to run code fine but then nothing is performed on the pictures...they remain the same...
Code: Select all
cd "C:\test"
mogrify -shave 10x10-sharpen 2 *.*
pause
Re: Please help with the batch file
I changed the code to make the changes more prominent and still it does not operate on the pictures - please help!)
Code: Select all
cd "C:\test"
magick mogrify -colorspace gray -shave 10x10 -sharpen 2 *.jpg
pause
Re: Please help with the batch file
my antivirus (Comodo) was blocking the bat file - now it seems to work great!)))))!)!)!)!))!)!)!)
Re: Please help with the batch file
I noticed my CPU is taking like 30% of its power (this is a 16 core xeon E5-2680) to modify 28 images in like 40 seconds (thought this was easy:) - I wonder if shave is resource intensive? can this be done by simple cropping? images are all 1 mb size and 2300X1900 PIXELS WIDE