How to change the tone of an image.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

You can also experiment with either of these commands by changing the color and the compose method (suggested softlight, overlay, colorize)


convert khr.jpg -define modulate:colorspace=HSB -modulate 100,0,100 \( -clone 0 -fill mediumblue -colorize 100% \) \
-compose softlight -composite show:

convert khr.jpg -define modulate:colorspace=HSB -modulate 100,0,100 \( -clone 0 +level-colors black,blue \) \
-compose colorize -composite show:
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

How can i upgrade to the latest one? Do i need uninstall the old one and need to install the new one with all the delegates?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

helloworld wrote:How can i upgrade to the latest one? Do i need uninstall the old one and need to install the new one with all the delegates?
Did you install your current version from binary or source? Did you install the delegates separately or did they come with the binary install? If the delegates are installed separately or not tightly bound to the IM, then you should be able to install IM from source and it should find the delegates.

On my Mac, I have the delegates installed and just re-install a new version of IM over the old one. I do not uninstall.

But for Linux, I cannot say. This is not something I know, since I do not use Linux. Perhaps one of the Linux users can provide further instructions.
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

Right now i am using the old Verison 6.3.7.

So i want to upgrade it to latest version 6.8.5-7. In the old version all the delegates are installed.

I do not know how they installed (From binary source or normal) but i have to update it to latest version.Which installation you prefer?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

I cannot really help. I do not use Linux.

If you are going to install from source see http://www.imagemagick.org/download/ They are all the same, just difference compressions. So pick one that you can decompress.

Alternately, you can install from one of the binaries at http://www.imagemagick.org/script/binary-releases.php.

Where did you get that old version?
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

The old version is installed by previous guy who used to work here but he left the office 1yr back.

Version: ImageMagick 6.3.7 08/09/09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC.

He installed in 2009.

Let me try my luck installing new version through binary source where we get default libraries.
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

I have a question regarding borders.

Right now i am working on adding borders (vertical horizontal and Square) to an image. I got the command as convert 123.jpg -bordercolor black -border 25x50 122.jpg . Its working fine.

In our system we upload three types of "border images" Horizontal, Vertical and Square. And we only those borders for the images. My question is do we have any command to use border image for a image?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

In our system we upload three types of "border images" Horizontal, Vertical and Square. And we only those borders for the images. My question is do we have any command to use border image for a image?
I am not sure what you mean by "do we have any command to use border image for a image". Can you clarify further or provide some examples?

The only commands to add borders are: -border, -splice, and -extent

see
http://www.imagemagick.org/Usage/crop/#border
http://www.imagemagick.org/Usage/crop/#extent
http://www.imagemagick.org/Usage/crop/#splice

You can create a border also by compositing your image over a slightly larger background color. See
http://www.imagemagick.org/Usage/layers/#convert
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

Sorry for not being Clear.

In our system we allow customers to upload border images like below.

Please find the images of three border which we allow customers in our system.

http://f.cl.ly/items/0G1l3Z1c2A0w1r290C3I/keyline.png
http://f.cl.ly/items/0X3u3e3F0D1s1v3g2u0K/black.png
http://f.cl.ly/items/3C0C1G3S253J3p3y3X2M/art.png

So what i am trying to do is, trying to insert the below image in this three borders.

http://f.cl.ly/items/2x0n211n3L0G2V1u3i1z/khr.jpg

So, do we have any command for the above image to insert in above borders?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

You have to size the image appropriately and then composite it over the border image. There is no automatic command to resize so that it fits. You have to determine how to resize (crop or pad) and then overlay it on the border background image.

see
http://www.imagemagick.org/Usage/layers/#convert

Placement can be done to set the resized image to the center of the background border image by using -gravity ... (and if offsets are needed then add -geometry ...)


convert borderimage \( overlayimage -resize ... \) -gravity center -compose over -composite result

if on window, remove the \ before ( and )

In most cases of clean borders, I would think it would be easier to resize the image to some desired size and add similar borders using -border and -extent, than to try to figure out how to resize the image to fit inside your existing border images. This is certainly the case for your first two border types. The last is harder because it is not a smooth clean border, but is blurred differently in different places.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to change the tone of an image.

Post by snibgo »

The border images have transparent centres, so I would composite the border over the resized image.

Windows script; adjust for Unix:

Code: Select all

convert ( khr.jpg -resize "530x350^!" ) art.png -gravity center -composite a.png
This image (khr.jpg) is more or less the same aspect ratio as the window within the border. In general, an image may also need to be cropped.
snibgo's IM pages: im.snibgo.com
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

When i am running the below command, It gives me the error -bash: syntax error near unexpected token `678.jpg'

convert ( 678.jpg -resize "530x350" 6781.jpg ) ( art.png -resize "530x350" art1.jpg) -gravity center -composite a.png


So here,

678 is the original image
6781 is the image resized to 530x350 pixel size.
art.png is the original image
art1.png is the image resized to 530x350 pixel size.
a.png is the final image placing 6781.jpg images in art1.jpg.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to change the tone of an image.

Post by snibgo »

I don't know bash, but you probably need to escape the brackets with backslashes: \( and \).

Next problem, your convert command isn't valid. If you really want to create 6781.jpg and art1.jpg, you need to preface then with "-write".
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change the tone of an image.

Post by fmw42 »

convert ( 678.jpg -resize "530x350" 6781.jpg ) ( art.png -resize "530x350" art1.jpg) -gravity center -composite a.png
All parenthesis need to have spaces before and after them. (Note the red in your command has no space). If on Unix, then parenthesis need to be escaped with a backslash \. Also you cannot save a result from IM command in a parenthesis with only the file name. You must add -write

In Unix, this would be:

convert \( 678.jpg -resize "530x350" -write 6781.jpg \) \( art.png -resize "530x350" -write art1.jpg \) -gravity center -composite a.png
helloworld
Posts: 69
Joined: 2013-05-22T09:42:33-07:00
Authentication code: 6789

Re: How to change the tone of an image.

Post by helloworld »

What are improvements from V6.7 to V6.8?

what is the latest IM release which is stable and without any bugs.
Post Reply