Reduce the image generation time and optimize the imagemagick commands
Posted: 2019-01-30T03:23:38-07:00
Hello Team,
We are using the Version: ImageMagick 6.9.3-8 Q16 x86_64 2018-06-20 and Platform is LINUX and API is PHP using exec function.
We have created a frame image using the ImageMagick commands shown in the screenshot below
Please see screenshot for this:
http://prntscr.com/me3n6h
Currently, this image is taking 1.5 seconds to generate through all commands.
Below are the all commands used to generate an image as shown in the screenshot above
Below the fourth command is using the child image so please find it at this URL:
http://socialenginespecialist.com/imagi ... _child.jpg
So our questions are,
1. How can we reduce the processing time?
2. How can we group these multiple commands into one command so that our output will be faster?
3. If you have more suggestions for generating images fast please let us know.
Your help is appreciated.
Thanks.
We are using the Version: ImageMagick 6.9.3-8 Q16 x86_64 2018-06-20 and Platform is LINUX and API is PHP using exec function.
We have created a frame image using the ImageMagick commands shown in the screenshot below
Please see screenshot for this:
http://prntscr.com/me3n6h
Currently, this image is taking 1.5 seconds to generate through all commands.
Below are the all commands used to generate an image as shown in the screenshot above
Below the fourth command is using the child image so please find it at this URL:
http://socialenginespecialist.com/imagi ... _child.jpg
Code: Select all
convert -size 420x580 xc:#4c6689 matframe_temp1.miff
convert -size 320x480 xc:#7d845c matframe_temp2.miff
composite -gravity center matframe_temp2.miff matframe_temp1.miff matframe_temp2.miff
convert info_back_image_vertical.jpg matframe_temp_child.miff
convert matframe_temp_child.miff -resize x480 matframe_temp3.miff
convert matframe_temp3.miff +repage -gravity center -crop 300x460+0+0 +repage matframe_temp3.miff
convert -background "rgba(0,0,0,0)" -size 228.57142857143x240 -fill "black" -gravity west label:"1.25 INCH SATIN BLACK FRAME\n\n1 - 16x24 opening\n\nAll products are\n Eco Friendly" matframe_temp4.miff
composite -gravity southwest -geometry +10+0 matframe_temp4.miff matframe_temp3.miff matframe_temp3.miff
convert -gravity center matframe_temp2.miff -fill none -strokewidth 2 -stroke '#FEFEFA' -draw 'rectangle 50,50 370,530' matframe_temp2.miff
composite -gravity center matframe_temp3.miff matframe_temp2.miff matframe_temp2.miff
convert matframe_temp2.miff matframe_final_image.jpg
1. How can we reduce the processing time?
2. How can we group these multiple commands into one command so that our output will be faster?
3. If you have more suggestions for generating images fast please let us know.
Your help is appreciated.
Thanks.