how I could use clone in this code ?

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?".
Post Reply
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

how I could use clone in this code ?

Post by diegomage »

Im trying use clone , but i dont know how I could use clone instead z1.png

please help me

this is my working code

Code: Select all

convert z1.gif \(  \( z1.gif    -morphology Hit-and-Miss '3x3:1,0,1 -,1,- -,-,-'   \) -negate -transparent white  \)     \(  \( z1.gif    -morphology Hit-and-Miss  '4x3:1,0,0,1 -,1,1,- -,-,-,-'    \) -negate -transparent white  \)  -composite   z3.gif;
this is like code that i want

Code: Select all

convert z1.gif \(  \( -clone 0--1    -morphology Hit-and-Miss '3x3:1,0,1 -,1,- -,-,-'   \) -negate -transparent white  \)     \(  \(-clone 0--1    -morphology Hit-and-Miss  '4x3:1,0,0,1 -,1,1,- -,-,-,-'    \) -negate -transparent white  \)  -composite   z3.gif;
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could use clone in this code ?

Post by fmw42 »

Why are you doing -clone 0--1? Is your z1.gif a multi-frame animation? If so, then you cannot just composite animations. You need to use -layers composite and null: between the two animations.

If z1.gif is a single frame, then you do not need -clone 0--1. -clone 0 would suffice or +clone. But you cannot put clones in a double nested set of parentheses. You should convert the z1.gif to MPR:img, the add +delete after it, then use MPR:img where you have the clone.

See https://www.imagemagick.org/Usage/files/#mpr and https://www.imagemagick.org/Usage/anim_mods/


Please always provide your Imagemgick version and platform as well as your images when asking questions.


See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could use clone in this code ?

Post by diegomage »

very thankyou for your help
Version: ImageMagick 7.0.8-6 Q16 x86_64 2018-07-14 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php

ubuntu 14.04 linux
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could use clone in this code ?

Post by fmw42 »

If z1.gif is a single frame, then you should be able to combine these two commands:

Code: Select all

convert z1.gif -morphology Hit-and-Miss '3x3:1,0,1 -,1,- -,-,-' -negate -transparent white  hmt_right2.gif
convert z1.gif hmt_right2x.gif -composite z2.gif

into this one command:

Code: Select all

convert z1.gif \( +clone -morphology Hit-and-Miss '3x3:1,0,1 -,1,- -,-,-' -negate -transparent white \) -composite z2.gif
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could use clone in this code ?

Post by diegomage »

very thankyou for your help fmw42
Post Reply