{"id":28215,"date":"2017-11-13T21:04:17","date_gmt":"2017-11-13T19:04:17","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=28215"},"modified":"2017-11-13T21:04:17","modified_gmt":"2017-11-13T19:04:17","slug":"easily-optimize-images-using-php","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/13\/easily-optimize-images-using-php\/","title":{"rendered":"Easily optimize images using PHP"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>Via <a href=\"https:\/\/murze.be\/2017\/10\/essential-image-optimization\/\">this blog post<\/a> I came across this <a href=\"https:\/\/github.com\/spatie\/image-optimizer\">PHP image optimization library<\/a>, which somewhat reminds me of <a href=\"https:\/\/mamchenkov.net\/wordpress\/2015\/08\/27\/efficient-image-resizing-with-imagemagick\/\">this blog post<\/a> from a couple of years ago.\u00a0 As good as <a href=\"https:\/\/www.imagemagick.org\/\">ImageMagick<\/a> is, it takes time and effort to find all the right options.\u00a0 With Spatie Image Optimizer you have an almost out of the box solution for optimizing images in a variety of formats.<\/p>\n<blockquote><p>This package can optimize PNGs, JPGs, SVGs and GIFs by running them through a chain of various image optimization tools.<\/p><\/blockquote>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>Via this blog post I came across this PHP image optimization library, which somewhat reminds me of this blog post from a couple of years ago.\u00a0 As good as ImageMagick is, it takes time and effort to find all the right options.\u00a0 With Spatie Image Optimizer you have an almost out of the box solution &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/13\/easily-optimize-images-using-php\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Easily optimize images using PHP<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Easily optimize images using PHP #WebDev #PHP #images #performance #optimization","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[3372,246,1057,38,1157,1330],"keyring_services":[],"class_list":["post-28215","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-imagemagick","tag-optimization","tag-performance","tag-php","tag-web-design","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":24662,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/08\/27\/efficient-image-resizing-with-imagemagick\/","url_meta":{"origin":28215,"position":0},"title":"Efficient Image Resizing With ImageMagick","author":"Leonid Mamchenkov","date":"August 27, 2015","format":false,"excerpt":"ImageMagick is one of my favorite tools ever. \u00a0I've used for years for a whole lot of different things - from simple image resizing, through animation generation, to palette manipulation. \u00a0And still, I don't really know it that well, so when I see articles like this - \"Efficient Image Resizing\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28387,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/02\/15\/idg-document-image-generator\/","url_meta":{"origin":28215,"position":1},"title":"idg &#8211; document image generator","author":"Leonid Mamchenkov","date":"February 15, 2018","format":false,"excerpt":"idg is a very handy tool for programmatically generating images which look like documents and web page templates.\u00a0 It's built on top of the ImageMagick\u00a0and will come native to anyone familiar with the\u00a0 modern grid-based web design.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/02\/idg-390x500.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22061,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/06\/25\/reducing-the-size-of-png-images\/","url_meta":{"origin":28215,"position":2},"title":"Reducing the size of PNG images","author":"Leonid Mamchenkov","date":"June 25, 2014","format":false,"excerpt":"I had an interesting problem today. \u00a0I was uploading a third-party theme to a WordPress hosted on the server that I don't control and really don't have much access to. \u00a0The server had a limitation of the upload size set to 10 MB. \u00a0Yeah, I know. \u00a0But not much I\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28631,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/06\/15\/the-complete-guide-to-wordpress-performance-optimization\/","url_meta":{"origin":28215,"position":3},"title":"The Complete Guide to WordPress Performance Optimization","author":"Leonid Mamchenkov","date":"June 15, 2018","format":false,"excerpt":"SitePoint runs an extensive guide to the WordPress performance optimization.\u00a0 Not only it goes over the usual points like hosting selection and avoiding unnecessary plugins, but it also provides some insight into the WordPress database management and optimization, web server tweaks, and links to a few handy tools to help\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/06\/ecommerce-stats-500x310.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":14913,"url":"https:\/\/mamchenkov.net\/wordpress\/2011\/05\/19\/color-image-generator\/","url_meta":{"origin":28215,"position":4},"title":"Color Image Generator","author":"Leonid Mamchenkov","date":"May 19, 2011","format":false,"excerpt":"Today, I had to create a simplistic tool for one of my side projects. \u00a0What I needed was a quick way to create an image of a specific size, filled with specific color. \u00a0If it was just for me, I could have survived with the Linux command line, of course.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2011\/05\/color_image_generator.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":17302,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/12\/11\/spl-standard-php-library\/","url_meta":{"origin":28215,"position":5},"title":"SPL &#8211; Standard PHP Library","author":"Leonid Mamchenkov","date":"December 11, 2012","format":false,"excerpt":"I've been looking at SPL for some time now. \u00a0On one hand, it's a new addition to PHP core (since version 5.3), so I know how to work without it. \u00a0On the other hand, it provides standardized solutions for common problems, and that should be enough reason to start using\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=28215"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28215\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=28215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=28215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=28215"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=28215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}