merge all convert to one

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
hmakani
Posts: 4
Joined: 2015-07-28T04:17:34-07:00
Authentication code: 1151

merge all convert to one

Post by hmakani »

Hello,
I need help to merge convert command due to optimization. We have command for resize, white remove, black remove , flip ,flop etc and merge.
below are sample code. Does it will improve speed ?

Code: Select all

 
convert logo.png -resize 176x172\! temp-img-1-1458046351068348700.mpc
convert temp-img-1-1458046351068348700.mpc -fuzz 20% -transparent white virtual_temp_images/temp-img-1-1458046351068348700.mpc
convert logo2.png -resize 216x46\! temp-img-2-1458046351068348700.mpc
convert temp-img-2-1458046351068348700.mpc -fuzz 20% -transparent white temp-img-2-1458046351068348700.mpc
convert -size 216x172 xc:none temp-img-1-1458046351068348700.mpc -geometry +20.6666+0 -composite temp-img-2-1458046351068348700.mpc -geometry +0.666666+64 -composite temp-image1458046351068348700.mpc
I am using: ImageMagick 6.9.3-0 Q8 i686
Do I use clone or mpr ?
Please advice.

Thanks,
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: merge all convert to one

Post by snibgo »

It looks simple. I assume the only required output is from the final convert? Or do you also want the intermediate results?

If I merged them, I'd probably make a minor mistake that would take forever to resolve. But if you provide logo.png, logo2.png and the required output, we could do this.
snibgo's IM pages: im.snibgo.com
hmakani
Posts: 4
Joined: 2015-07-28T04:17:34-07:00
Authentication code: 1151

Re: merge all convert to one

Post by hmakani »

Hello Snibgo,
Thanks for quick reply. I will provide logo1,logo2 and final temp-image1458046351068348700.mpc is needed. There is no need for intermediate results.
I have given try for following code but fail to get desire result.

Code: Select all

convert logo1.png -respect-parentheses  \( +clone -resize 176x172! \) \( +clone -fuzz 20% -transparent white \) -delete 0-1  -size 216x172 xc:none -geometry +20.6666+0 -composite  final.png
In above code , I am fail to get image of 216x172 size and How will I add process for logo2 and so on. I need to optimize command for speed .

Thanks,
Post Reply