Page 1 of 2

Colorize - how to turn on

Posted: 2013-05-19T08:40:20-07:00
by brubru
Hello everyone.
In photoshop "hue/saturation" layer have a "colorize" option, if I turn it on, it gives a very different result, how can I do this in imagemagick?

Re: Colorize - how to turn on

Posted: 2013-05-19T12:35:14-07:00
by fmw42

Re: Colorize - how to turn on

Posted: 2013-05-21T09:09:56-07:00
by brubru
"-modulate" work like this layer on screen in PhotoshopImage , but i need with colorize, like on this screen Image.
I tried to do it, but so far without results.
Помогите пожалуйста решить эту задачу.

Re: Colorize - how to turn on

Posted: 2013-05-21T10:26:16-07:00
by fmw42
I am not really sure what you are trying to do and what you mean by with colorize. But try

convert image \( -clone -modulate ... \) -compose colorize -composite result

Note that modulate in IM uses different values that in photoshop

see

http://www.imagemagick.org/script/comma ... p#modulate


If you can post links to your input image and the modulate values and output form PS, then perhaps we can suggest a more complete or close solution. You may never get exactly the same results, because IM may not be using the same colorspace for modulate as in PS or for colorizing.

Re: Colorize - how to turn on

Posted: 2013-05-22T05:10:41-07:00
by brubru
I know about modulate.
Now i'm try to solve this another way.
So, I need to recreate the Photoshop action on imagemagick.

And now i was faced with another challenge, I want to create a new layer of the same size as the original image, fill it with color and apply the mod soft-light, then save.
I try this command - "system ('convert 1.jpg \ (-clone 0-fill" # 987272 "-colorize 100% \)-compose "soft-light" -composite out.jpg');" - but the result is simply pure fill, the layers are not mixed up - how to do it.

Re: Colorize - how to turn on

Posted: 2013-05-22T09:45:59-07:00
by fmw42
convert 1.jpg \ (-clone 0-fill" # 987272 "-colorize 100% \)-compose "soft-light" -composite out.jpg
You must place spaces between commands and no space between # and the hex color and enclose in quotes and spaces between (...) and the commands

convert 1.jpg \ ( -clone 0 -fill "#987272" -colorize 100% \) -compose soft-light -composite out.jpg

Re: Colorize - how to turn on

Posted: 2013-05-22T10:15:59-07:00
by brubru
No, syntactics it's alright, i mean commands look like this "convert 1.jpg \( -clone 0 -fill "# 987272" -colorize 100% \) -compose "soft-light" -composite out.jpg".

There google editor removed the spaces, sorry for that.

Re: Colorize - how to turn on

Posted: 2013-05-22T10:35:29-07:00
by fmw42
convert 1.jpg \( -clone 0 -fill "# 987272" -colorize 100% \) -compose "soft-light" -composite out.jpg
This is still wrong. There must be no space between # and 987272. I am not sure if the quotes around soft-light will be an issue or not.

convert 1.jpg \( -clone 0 -fill "#987272" -colorize 100% \) -compose soft-light -composite out.jpg

If this does not do what you want, then please clarify or provide an example input and output with what you want to achieve

The other issue is that you cannot use double quotes inside a PHP exec or system call. You must escape any double quotes in the IM commands ( and you cannot substitute single quotes)

try

system("convert 1.jpg \( -clone 0 -fill \"#987272\" -colorize 100% \) -compose soft-light -composite out.jpg")

Also you may need to provide the full path to convert if your PATH does not include it

Re: Colorize - how to turn on

Posted: 2013-05-22T11:01:35-07:00
by brubru
-compose "soft-light"
I'm trying without quotes, but result not changes, still just pure fill, the layers are not mixed up.

Re: Colorize - how to turn on

Posted: 2013-05-22T11:19:18-07:00
by brubru
This is a effect what i need - Image.

Re: Colorize - how to turn on

Posted: 2013-05-22T11:36:13-07:00
by fmw42
Post a link to your input image and the result from photoshop. You can post your images on any free image hosting site and put a link here.

P.S. You must have double quotes (escaped as shown above) around your hex color and the system call must start and end with double quotes

Re: Colorize - how to turn on

Posted: 2013-05-22T12:20:26-07:00
by brubru
P.S. You must have double quotes (escaped as shown above) around your hex color and the system call must start and end with double quotes
I do this.

Input - "http://i.tinyuploads.com/ANL1wl.jpg", output - "http://i.tinyuploads.com/QK9mLW.jpg".

Re: Colorize - how to turn on

Posted: 2013-05-22T12:31:03-07:00
by fmw42
Please post links to your images.

You must escape all double quotes within the IM command and use double quotes in the system call

system("convert \"input\" \( -clone 0 -fill \"#987272\" -colorize 100% \) -compose soft-light -composite \"output\"")

Re: Colorize - how to turn on

Posted: 2013-05-22T13:04:48-07:00
by snibgo
@brubru: I suggest you experiment first with command lines. When that works, then use PHP.

For example:

Code: Select all

convert ANL1wl.jpg ( -clone 0 -fill #987272 -colorize 100% ) -compose soft-light -composite out.png
This works for me -- it very slightly warms the image. But I don't know if that is what you want.

Re: Colorize - how to turn on

Posted: 2013-05-22T13:08:13-07:00
by brubru
system("convert \"1.jpg\" \( -clone 0 -fill \"#987272\" -colorize 100% \) -compose soft-light -composite \"111.jpg\"");
This work - thank you very much, you really help me.