{"id":185,"date":"2016-05-09T08:23:06","date_gmt":"2016-05-09T08:23:06","guid":{"rendered":"https:\/\/rln.d13dns.com\/?p=185"},"modified":"2016-05-09T08:23:06","modified_gmt":"2016-05-09T08:23:06","slug":"animated-gif-from-imagemagick","status":"publish","type":"post","link":"https:\/\/randomlinuxnotes.d13.com\/?p=185","title":{"rendered":"animated gif from imagemagick"},"content":{"rendered":"<p>put the list of files into a file<\/p>\n<pre>ls -1 foo*.jpg &gt; \/var\/tmp\/jpglist\n\n<\/pre>\n<p>rename randomly named files in numerical order<\/p>\n<pre>cat \/var\/tmp\/jpglist|perl -e'$i=1;while ($name=) { chomp $name;$new=\"week\" . $i . \".jpg\";system (\"cp $name $new\");;$i++};'\n\n<\/pre>\n<p>resize all 13 files named week[number].jpg, add the Week[number].jpg to the lower right hand corner of the file<\/p>\n<pre>for file in {1..13} ;do convert -adaptive-resize 256x -gravity SouthEast  -pointsize 30 -annotate 0 \"Week $file\" week$file.jpg week${file}_sm.jpg; done\n\n<\/pre>\n<p>stack the jpgs into a animated gif, center the extra vertical space (not all the images are the same height, the tallest image is about 350 pixels).<\/p>\n<pre>convert -delay 200 -loop 0 -gravity center -extent 256x350 -coalesce -trim -layers TrimBounds -dispose 2 week[1-9]_sm.jpg week1[0-9]_sm.jpg animated.gif\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>put the list of files into a file ls -1 foo*.jpg &gt; \/var\/tmp\/jpglist rename randomly named files in numerical order cat \/var\/tmp\/jpglist|perl -e&#8217;$i=1;while ($name=) { chomp $name;$new=&#8221;week&#8221; . $i . &#8220;.jpg&#8221;;system (&#8220;cp $name $new&#8221;);;$i++};&#8217; resize all 13 files named week[number].jpg, add the Week[number].jpg to the lower right hand corner of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[19,50,55,102],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-rln","tag-bash","tag-gif","tag-imagemagick","tag-perl"],"_links":{"self":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=185"}],"version-history":[{"count":0,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}