Page 1 of 1

Convert ... (+clone 0 ...

Posted: 2015-01-12T20:54:43-07:00
by BrianP007
Snibgo,
I was researching your original Convert command to restore blacks:

Code: Select all

convert ^
  original.tiff ^
  bad_black.tiff ^
  ( +clone 0 -colorspace Gray -level 0,5%% ^
    -write mask.tiff ^
  ) ^
  -composite ^
  out.tiff
The CLONE op, you specify the first image, index 0.
But, with +CLONE: "The +clone will simply make a copy of the last image in the image sequence, and is thus equivalent to using a argument of '-1'. "

It looks like you are specifying both the first and the last which would be both the original and the black. That would introduce an extra image onto the stack. Who is cloned, composted and converted (not to mention OUTed!).

I suspect your Kung-Fu has ventured beyond the documentation. Could you play-by-play the clone section?

Re: Convert ... (+clone 0 ...

Posted: 2015-01-12T21:18:42-07:00
by fmw42
convert ^
original.tiff ^
bad_black.tiff ^
( +clone 0 -colorspace Gray -level 0,5%% ^
-write mask.tiff ^
) ^
-composite ^
out.tiff
This is erroneous syntax (probably a typo).

Try

convert ^
original.tiff ^
bad_black.tiff ^
( -clone 0 -colorspace Gray -level 0,5%% ^
-write mask.tiff ^
) ^
-composite ^
out.tiff

or if that fails, then perhaps he meant

convert ^
original.tiff ^
bad_black.tiff ^
( +clone -colorspace Gray -level 0,5%% ^
-write mask.tiff ^
) ^
-composite ^
out.tiff

Re: Convert ... (+clone 0 ...

Posted: 2015-01-13T02:40:49-07:00
by snibgo
In that thread viewtopic.php?f=1&t=26821#p118493, I said "you might try something like this".

"Something like this" means I haven't tried it so you need to correct any typos or syntax errors or anything else.

As Fred says, my syntax was wrong. It should be "-clone 0" or "+clone". Without testing on your files, I don't know which is better.