Hi,
Can anyone give me the commands to apply drop shadows to series on transparent png images? Basically, I want the script to go through all the png files in a folder, apply a drop shadow effect and then save and overwrite the previous image (which has no shadows).
I'd like the commands for Windows, if possible.
Thank you,
Filip.
Drop shadows
-
- Posts: 4
- Joined: 2013-09-19T11:44:57-07:00
- Authentication code: 6789
Re: Drop shadows
Ok, so this
gives me what I want for one image. All I need is how to apply it to an entire folder.
Of course, any other suggestions on a better command would be welcomed.
Code: Select all
convert image.png ( -clone 0 -background black -shadow 80x3+0+8 ) -reverse -background none -layers merge +repage image.png
Of course, any other suggestions on a better command would be welcomed.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Drop shadows
For shadows in IM, see http://www.imagemagick.org/Usage/blur/#shadow
For looping through files in Windows, type "help for" or "forfiles /?".
For looping through files in Windows, type "help for" or "forfiles /?".
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2013-09-19T11:44:57-07:00
- Authentication code: 6789
Re: Drop shadows
Yeah, sorry, but I can't figure it out.
In other words.. can anyone write it for me?
In other words.. can anyone write it for me?
Re: Drop shadows
I am not a Windows expert but try this untested code on a TEST FOLDER of images and see what happens:
I have just tried and it does not work!
Code: Select all
::Turn of displaying the code on the screen
@echo off
:: Read all the png images from the directory, modify and save with the same name
for %%f in (%1\*.png) do ( convert "%%f" ( -clone 0 -background black -shadow 80x3+0+8 ) -reverse -background none -layers merge +repage "%1.png" )
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Drop shadows
Your use of %1 is incorrect. Command on the same line as "for" mustn't be bracketed. Brackets are for putting the command on a separate line. For example, put one of these in a command file, and ALWAYS call it with the name of a directory.
Code: Select all
for %%f in (%1\*.png) do %IM%convert "%%f" ( -clone 0 -background black -shadow 80x3+0+8 ) -reverse -background none -layers merge +repage "%%f"
for %%f in (%1\*.png) do (
%IM%convert "%%f" ^( -clone 0 -background black -shadow 80x3+0+8 ^) -reverse -background none -layers merge +repage "%%f"
)
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2013-09-19T11:44:57-07:00
- Authentication code: 6789
Re: Drop shadows
@snibgo
That sort of works... it just seems to make several copies of the results, plus some files which only contain shadows. And the original files remain intact.
That sort of works... it just seems to make several copies of the results, plus some files which only contain shadows. And the original files remain intact.
Re: Drop shadows
I will have to check that out when I have time snibgo as I have a couple of examples on my website similar to the code I posted.Brackets are for putting the command on a separate line.