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 »

There is no such release as stable or without bugs. It is more a matter of degree. IM keeps changing by fixing bugs and making enhancements. see the changelog at http://www.imagemagick.org/script/changelog.php

I do not recommend versions between 6.7.6.6 and 6.7.8.2, because for those releases IM was undergoing significant changes to colorspace sRGB vs RGB and grayscale. Also note that many of the grayscale changes from those release have been recently backed out starting with IM 6.8.5.5. IM 6.8.5.9 is pretty good, but I just recently found issues that have been reported in the bugs forum for versions after 6.8.5.4 that persist into the the current 6.8.5.10 beta.
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 am trying to convert an image to the below dimensions with below command and the cropped image i get is blank image which doesnt have anything in it.

Command

convert 123.jpg 0.5007153075822603x0.7510729613733905+0.48235642754956054+0.24678111587982832 123crop.jpg

W: 0.5007153075822603
H: 0.7510729613733905
X: 0.48235642754956054
Y: 0.24678111587982832

Error:

It just gives me a blank image. which doesn't have anything just a full gray image.
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 »

As this problem isn't related to the OP, you should start a new topic.
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 123.jpg 0.5007153075822603x0.7510729613733905+0.48235642754956054+0.24678111587982832 123crop.jpg
This should be a new topic. However, I suspect that IM does not allow fractional pixel dimensions or offsets and will truncate.

You have specified basically 1x1+0+0 of IM were to round the data you supplied. Thus only one pixel or perhaps even no data will result. IM image coordinates are not between 0 and 1, but the full size of the image in number of pixels.


Your syntax is also wrong.

try

convert 123.jpg[WxH+X+Y] 123crop.jpg

or

convert 123.jpg -crop [WxH+X+Y] 123crop.jpg

see
http://www.imagemagick.org/script/comma ... essing.php
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 am doing four operations to an image,
  • Cropping
  • Resizing the cropped image
  • Adding Border to the re-sized image
  • Adding toning to the Bordered image
In order to do the four operations i am using four different commands,
  • Cropping: convert INPUT.jpg –crop WxH+X+Y +repage OUTPUT.jpg
  • Resizing Cropped Image: convert INPUT.jpg -resize 300x300 OUTPUT.jpg
  • Adding Border to the Re-sized Image: convert art.png -resize 300x300 art1.png (Resizing the border to the respected pixel)
    convert 3451.jpg art1.png -gravity center -composite abc.png (Inserting converted image to converted border)
  • Adding Toning To the Bordered Image: convert kar.jpg -define modulate:colorspace=HSL -modulate 100,0,100 duotone.ppm -clut duotone.jpg
My question is, Is there any way that i can use only one command, mixing all these 4 commands to one single command?
So all the process should be done in one command.
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 »

Cropping: convert INPUT.jpg –crop WxH+X+Y +repage OUTPUT.jpg
Resizing Cropped Image: convert INPUT.jpg -resize 300x300 OUTPUT.jpg
Adding Border to the Re-sized Image: convert art.png -resize 300x300 art1.png (Resizing the border to the respected pixel)
convert 3451.jpg art1.png -gravity center -composite abc.png (Inserting converted image to converted border)
Adding Toning To the Bordered Image: convert kar.jpg -define modulate:colorspace=HSL -modulate 100,0,100 duotone.ppm -clut duotone.jpg
This is not clear. You seem to be using the same input and the same output for the first two commands so over-writing the output. The next two commands use neither of the other two command's output.

So please show a direct sequence of operations with the image names that show how they are connected. Then we can probably put them together for you into one command line.
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 am doing four operations to an image,

Cropping

Resizing the cropped image

Adding Border to the re-sized image

Adding toning to the Bordered image


In order to do the four operations i am using four different commands,

Cropping: convert abc1.jpg –crop WxH+X+Y +repage abc2.jpg

Resizing Cropped Image: convert abc2.jpg -resize 300x300 abc3.jpg

Adding Border to the Re-sized Image: convert art.jpg -resize 300x300 art1.jpg (Resizing the border to the respected pixel)
convert abc3.jpg art1.jpg -gravity center -composite abc4.jpg (Inserting converted image to converted border)

Adding Toning To the Bordered Image: convert abc4.jpg -define modulate:colorspace=HSL -modulate 100,0,100 duotone.ppm -clut abc5.jpg

abc5.jpg is the final image which i want.
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 »

This should do what you want


convert \( abc1.jpg –crop WxH+X+Y +repage -resize 300x300 \) \
\( art.jpg -resize 300x300 \) -gravity center -composite \
-define modulate:colorspace=HSL -modulate 100,0,100 duotone.ppm -clut abc5.jpg

or in windows syntax

convert ( abc1.jpg –crop WxH+X+Y +repage -resize 300x300 ) ^
( art.jpg -resize 300x300 ) -gravity center -composite ^
-define modulate:colorspace=HSL -modulate 100,0,100 duotone.ppm -clut abc5.jpg


see
http://www.imagemagick.org/Usage/basics/#parenthesis
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 »

Thanks a lot that worked for me.
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 »

Worked for me thanks a lot
Post Reply