{"id":4703,"date":"2015-01-15T07:45:44","date_gmt":"2015-01-15T07:45:44","guid":{"rendered":"https:\/\/bodhost.com\/kb\/?p=4703"},"modified":"2026-02-26T14:04:30","modified_gmt":"2026-02-26T14:04:30","slug":"image-optimization-linux","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/","title":{"rendered":"How to Optimize Images Online in Linux?"},"content":{"rendered":"<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"355\" height=\"200\" class=\"wp-image-4704\" src=\"https:\/\/bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png\" alt=\"linux\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png 355w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux-300x169.png 300w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n<p><strong>Online image optimization in Linux:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>Image compression may have an interest in many situations. For example, while writing a web article in which we need compressed images to reduce the total weight of a web page. Image compression may also need while sending an email. For this, it is worthwhile to know how to do it quickly from the command line. So here we will see how to lighten images in PNG, JPEG\/JPG format with various tools.<\/p>\r\n\r\n\r\n\r\n<p><strong>PNG images optimization with pngcrush<\/strong><\/p>\r\n\r\n\r\n\r\n<p>First, we need to install pngcrush, in Debian we will use the below command:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">apt-get install pngcrush<\/pre>\r\n\r\n\r\n\r\n<p>For CentOS and RHEL, use this syntax:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">yum install pngcrush<\/pre>\r\n\r\n\r\n\r\n<p>Once installed, pngcrush is very easy to use, for example:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">pngcrush -brute -e \"compressedimage.png\" image_original.png<\/pre>\r\n\r\n\r\n\r\n<p>Here, \u201c-brute\u201d allows us better optimization of the image, \u201c-e\u201d compresses the original image (Note: after specifying \u201c-e\u201d mention the name for the compressed image which will be the output of the tool).<\/p>\r\n\r\n\r\n\r\n<p><strong>JPEG image optimization with jpegoptim<\/strong><\/p>\r\n\r\n\r\n\r\n<p>As similar to pngcrush first we need to install jpegoptim tool. The execution command for Debian:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">apt-get install jpegoptim<\/pre>\r\n\r\n\r\n\r\n<p>For CentOS and RHEL machines:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">yum install jpegoptim<\/pre>\r\n\r\n\r\n\r\n<p>To use jpegoptim and optimize an image, we simply need to run the following command line:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">jpegoptim myimage.jpeg<\/pre>\r\n\r\n\r\n\r\n<p>We can also change the power of the compression with the option \u201c-m\u201d followed by a number from 1 to 100 range. 1 will give a very light image, but with very poor quality. 100 will give a smaller compression but maintains certain quality. So we are the judge to decide what value to put in! Generally, 80 is a good ratio between lightness and image quality.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">jpegoptim myimage.jpeg -m 80<\/pre>\r\n","protected":false},"excerpt":{"rendered":"<p>Online image optimization in Linux: Image compression may have an interest in many situations. For example, while writing a web article in which we need compressed images to reduce the&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[297],"tags":[639,640],"class_list":["post-4703","post","type-post","status-publish","format-standard","hentry","category-faq","tag-image-optimization-linux","tag-linux-servers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Optimize Images Online in Linux?<\/title>\n<meta name=\"description\" content=\"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Optimize Images Online in Linux?\" \/>\n<meta property=\"og:description\" content=\"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-15T07:45:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:04:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png\" \/>\n\t<meta property=\"og:image:width\" content=\"355\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\"},\"headline\":\"How to Optimize Images Online in Linux?\",\"datePublished\":\"2015-01-15T07:45:44+00:00\",\"dateModified\":\"2026-02-26T14:04:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/\"},\"wordCount\":258,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/linux.png\",\"keywords\":[\"image optimization linux\",\"linux servers\"],\"articleSection\":[\"FAQs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/\",\"name\":\"How to Optimize Images Online in Linux?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/linux.png\",\"datePublished\":\"2015-01-15T07:45:44+00:00\",\"dateModified\":\"2026-02-26T14:04:30+00:00\",\"description\":\"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/linux.png\",\"contentUrl\":\"https:\\\/\\\/bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2015\\\/01\\\/linux.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/image-optimization-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"FAQs\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/faq\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Optimize Images Online in Linux?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Optimize Images Online in Linux?","description":"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Optimize Images Online in Linux?","og_description":"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.","og_url":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2015-01-15T07:45:44+00:00","article_modified_time":"2026-02-26T14:04:30+00:00","og_image":[{"width":355,"height":200,"url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/"},"author":{"name":"admin","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9"},"headline":"How to Optimize Images Online in Linux?","datePublished":"2015-01-15T07:45:44+00:00","dateModified":"2026-02-26T14:04:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/"},"wordCount":258,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png","keywords":["image optimization linux","linux servers"],"articleSection":["FAQs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/","url":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/","name":"How to Optimize Images Online in Linux?","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png","datePublished":"2015-01-15T07:45:44+00:00","dateModified":"2026-02-26T14:04:30+00:00","description":"Discover efficient methods and online tools that allow you to compress and optimize images, reducing file size without compromising quality.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#primaryimage","url":"https:\/\/bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png","contentUrl":"https:\/\/bodhost.com\/kb\/wp-content\/uploads\/2015\/01\/linux.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/image-optimization-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"FAQs","item":"https:\/\/www.bodhost.com\/kb\/category\/faq\/"},{"@type":"ListItem","position":2,"name":"How to Optimize Images Online in Linux?"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.bodhost.com\/kb\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=4703"}],"version-history":[{"count":5,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4703\/revisions"}],"predecessor-version":[{"id":12174,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4703\/revisions\/12174"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=4703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=4703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=4703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}