Page 1 of 1
mimic series of photoshop layer styles
Posted: 2014-08-01T17:17:13-07:00
by fluxist8070
Hi,
I am a new IM user and have been hacking around and checking docs for around 30 or so hours. I have some questions.
There is a specific output from PS I would like to mimic. Here is an example-
The only diffeences in the reference, I'll need a transparent background. Which, is totally doable.
Here is the command line code I've got so far, I'm using IM for windows. (Side question, is IM for linux better for any reason?)-
Code: Select all
convert Hawk.jpg -transparent white -fill #C3C3C3 -opaque #000000 -resize 300X300 -shade 220X45 hawkGlass.png
This gives me this output so far-
Things I'm having trouble with-
converting a jpg to a png and then changing the image(transparent background, shade, etc); adding a drop shadow. I'm a little confused about the clone command. I know the examples are in Unix and I'm not sure about the syntax for Windows cmd.
I appreciate any help!
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T18:22:06-07:00
by fmw42
I know the examples are in Unix and I'm not sure about the syntax for Windows cmd.
Most things are the same for Windows and Unix. Some things like line ending are different if you want to continue to another line in the same command. Unix uses \ and Windows ^. Similarly if you want to escape some character, Unix uses \ and Windows ^. In Unix all parenthesis need escaping. In Windows this is not necessary. In Unix, colors need double quotes. I don't think that is needed for Windows.
I am not a Windows user, so some Windows expert can give you more comments. But do see
http://www.imagemagick.org/Usage/windows/
I have quite a few unix bash shell scripts for IM at my link below. But they can be run on Windows with Cygwin installed. See
http://im.snibgo.com/cygwin.htm
If you post your input image, we can probably help you work out commands to closely match what you can do in Photoshop.
The clone command is used to duplicate some previous image (or processed image) and needs to be used in parenthesis. It is the combination that is what allows you to process an image multiply times and then later combine them. See
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone
http://www.imagemagick.org/Usage/basics/#seq_combine
http://www.imagemagick.org/Usage/basics/#complex
http://www.imagemagick.org/Usage/files/#write
http://www.imagemagick.org/Usage/layers/ and especially
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/compose/
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T18:57:32-07:00
by fluxist8070
Thank you for the reply!
Here is the default image I'm working with.
I've seen most of these links.
I guess what I was confused about is how the slashes and parens translate in windows. Thanks for the help on that!
So if I want to convert a jpg to a png and then edit the image in the command line, I can to that by formatting in the karats for the slashes and I should be good to go right?
Thanks again!
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T20:29:57-07:00
by fmw42
So if I want to convert a jpg to a png and then edit the image in the command line, I can to that by formatting in the karats for the slashes and I should be good to go right?
Not sure what you are asking. Perhaps post a command line for reference.
But there is no need to first convert the jpg to png. It is done simply by reading in the jpg and using png for the suffix of the output.
Any thing you need to do with parens, do not need ^. But if you want to split a very long command into multiple lines for readability, you need to end each line with ^.
Sor for example
Code: Select all
convert image.jpg ^
( -clone 0 ...some processing... ) ^
( -clone 0 ...some processing... ) ^
-compose over -composite ^
result.png
Try this command.
I added -blur to make the bevel wider. I negate the image so that the alpha channel is the correct polarity. I use -alpha copy to add the alpha channel as a copy of the negated image. I turn alpha off so that the alpha channel is not blurred, then turn it back on at the end.
Code: Select all
convert hawk.jpg -resize 300x300 -negate -alpha copy -alpha off -blur 0x2 -shade 220X45 -alpha on hawk_bevel.png
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T21:53:20-07:00
by snibgo
On Unix to Windows: technically, these aren't differences between Unix and Windows. These are differences between the bash shell and the cmd shell. You can run bash under Windows. There is probably a version of cmd for Unix, but no sensible person would want to do that. Windows comes supplied with shells other than cmd (eg Powershell).
Anyhow: the other main difference is that Windows cmd scripts, when run in a BAT file, need every percent sign % doubling. This is to avoid confusion with the script parameters %1, %2 etc that are not doubled.
Yes, as a rule of thumb: to convert an ImageMagick Unix command into a Windows command, replace every caret ^ with a backslash \, and double every percent %.
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T21:57:56-07:00
by fluxist8070
Works Great!
Made some tweaks based on your advice-
Code: Select all
convert hawk.jpg -resize 300x300 -negate -alpha copy -alpha off -blur 0x2 -shade 720X60 -alpha on ( -clone 0 -background black -shadow 100x1+10+10 ) -compose Dst_Over -composite hawkGlass.png
Is there a way to add transparency to the whole image? I know you can set an alpha to do transparency and do an overlay layer, but I might need a value to tweak it.
Thanks again! You've saved me a ton of time and help me to get better at this. So I definitely appreciate it!
Re: mimic series of photoshop layer styles
Posted: 2014-08-01T22:05:44-07:00
by fmw42
not quite sure what you are asking? do you just want to reduce the overall alpha value? if so, this will reduce by half. It just turns on only the alpha channel, multiplies by 0.5, then turns on all channels. Windows syntax with new lines
convert hawk.jpg -resize 300x300 -negate -alpha copy -alpha off -blur 0x2 -shade 720X60 -alpha on ^
( -clone 0 -background black -shadow 100x1+10+10 ) -compose Dst_Over -composite ^
-channel a -evaluate multiply 0.5 +channel hawkGlass2.png
Re: mimic series of photoshop layer styles
Posted: 2014-08-02T09:04:21-07:00
by fluxist8070
Yep. That was it! I'm used to multiply also darkening the image. I didn't realize that in IM it just makes it transparent.
Thanks for your time and help!
Re: mimic series of photoshop layer styles
Posted: 2014-08-02T10:04:04-07:00
by fmw42
fluxist8070 wrote:Yep. That was it! I'm used to multiply also darkening the image. I didn't realize that in IM it just makes it transparent.
Thanks for your time and help!
You have to select only the alpha channel for that. With -channel you can select which combination of channels you want to work on. You must remember to turn them all back on afterwards.