Colorize - how to turn on

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Colorize - how to turn on

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post by fmw42 »

brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post 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.
Помогите пожалуйста решить эту задачу.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post 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.
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post 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
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post 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
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post by brubru »

-compose "soft-light"
I'm trying without quotes, but result not changes, still just pure fill, the layers are not mixed up.
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post by brubru »

This is a effect what i need - Image.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post 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
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post 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".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize - how to turn on

Post 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\"")
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Colorize - how to turn on

Post 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.
snibgo's IM pages: im.snibgo.com
brubru
Posts: 18
Joined: 2013-05-10T04:22:01-07:00
Authentication code: 6789

Re: Colorize - how to turn on

Post 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.
Post Reply