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
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?