{"id":1342,"date":"2020-04-11T10:12:45","date_gmt":"2020-04-11T04:42:45","guid":{"rendered":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/"},"modified":"2020-06-18T12:52:25","modified_gmt":"2020-06-18T07:22:25","slug":"improving-image-quality","status":"publish","type":"docs","link":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/","title":{"rendered":"Improving Image Quality"},"content":{"rendered":"\n<p><blockquote>\n<ol>\n<li>Requires skills to edit files in the server.<\/li>\n<li>Improving image quality increases the size of the image as well.<\/li>\n<\/ol>\n<\/blockquote>\n<p>This extension works on the images that are already compressed by the default OpenCart image library for JPEG images and are saved in image\/cache\/ folder. For improving the image quality of these JPEG images, do the following changes<\/p><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open file system\/library\/image.php<\/li><li>Look for the line\n<pre><strong>public function save($file, $quality = 90) {<\/strong><\/pre>\n<\/li><li>Change the value of <em><strong>$quality to &gt; 90<\/strong><\/em>, for example\n<pre><strong>public function save($file, $quality = 100) { <br><\/strong><\/pre>\n<\/li><\/ol>\n\n\n<p>The above steps will improve the overall image quality of the images generated by the OpenCart. Please note this is applicable only for JPEG images and not for PNG or GIF images. Now generate the fresh webp images. The webp compression algorithm of this extension chooses the best compression quality by automatically. Check the quality and if you want to further improve the image quality, do the following.<\/p>\n<ol>\n<li>Open file <strong><em>admin\/controller\/extension\/hbseo\/hb_webp.php<\/em><\/strong><\/li>\n<li>Look for the code <strong>$options = [];<\/strong><\/li>\n<li>Replace it with the following and adjust the quality value<\/li>\n<\/ol>\n<pre><span class=\"pl-s1\"><span class=\"pl-c1\">$<\/span>options<\/span> = [\n    <span class=\"pl-s\">'png'<\/span> =&gt; [\n        <span class=\"pl-s\">'encoding'<\/span> =&gt; <span class=\"pl-s\">'lossy'<\/span>,   <span class=\"pl-c\">\/* Try both lossy and lossless and pick smallest *\/<\/span>\n        <span class=\"pl-s\">'near-lossless'<\/span> =&gt; <span class=\"pl-c1\">60<\/span>,   <span class=\"pl-c\">\/* The level of near-lossless image preprocessing (when trying lossless) *\/<\/span>\n        <span class=\"pl-s\">'quality'<\/span> =&gt; <strong><span class=\"pl-c1\" style=\"color: #ff0000;\">85<\/span><\/strong>,         <span class=\"pl-c\">\/* Quality when trying lossy. It is set high because pngs is often selected to ensure high quality *\/<\/span>\n    ],\n    <span class=\"pl-s\">'jpeg'<\/span> =&gt; [\n        <span class=\"pl-s\">'encoding'<\/span> =&gt; <span class=\"pl-s\">'auto'<\/span>,     <span class=\"pl-c\">\/* If you are worried about the longer conversion time, you could set it to \"lossy\" instead (lossy will often be smaller than lossless for jpegs) *\/<\/span>\n        <span class=\"pl-s\">'quality'<\/span> =&gt; <span class=\"pl-s\"><strong><span style=\"color: #ff0000;\">90<\/span><\/strong><\/span>,      <span class=\"pl-c\">\/* Set to same as jpeg (requires imagick or gmagick extension, not necessarily compiled with webp) *\/<\/span>\n        <span class=\"pl-s\">'max-quality'<\/span> =&gt; <span class=\"pl-c1\">80<\/span>,      <span class=\"pl-c\">\/* Only relevant if quality is set to \"auto\" *\/<\/span>\n        <span class=\"pl-s\">'default-quality'<\/span> =&gt; <span class=\"pl-c1\">75<\/span>,  <span class=\"pl-c\">\/* Fallback quality if quality detection isnt working *\/<\/span>\n    ]\n];<br \/><br \/><br \/><\/pre>\n<p>Test it by clearing the image cache folder and regenerate webp images.<\/p>\n<p>If you are satisfied with the code do the same in the ocmod XML file of this extension.<\/p>","protected":false},"featured_media":0,"parent":1341,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1342","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Improving Image Quality - HuntBee Resources<\/title>\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.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improving Image Quality - HuntBee Resources\" \/>\n<meta property=\"og:description\" content=\"Requires skills to edit files in the server. Improving image quality increases the size of the image as well. This extension works on the images that are already compressed by the default OpenCart image library for JPEG images and are saved in image\/cache\/ folder. For improving the image quality of these JPEG images, do the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/\" \/>\n<meta property=\"og:site_name\" content=\"HuntBee Resources\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/huntbee.opencart\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-18T07:22:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/improving-image-quality\\\/\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/improving-image-quality\\\/\",\"name\":\"Improving Image Quality - HuntBee Resources\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#website\"},\"datePublished\":\"2020-04-11T04:42:45+00:00\",\"dateModified\":\"2020-06-18T07:22:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/improving-image-quality\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/improving-image-quality\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/improving-image-quality\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WebP Compression for OpenCart\",\"item\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Image Quality\",\"item\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/opencart-webp-compression\\\/image-quality\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Improving Image Quality\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#website\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\",\"name\":\"HuntBee Resources\",\"description\":\"OpenCart Extension Documentations - Guides - Blogs - Projects\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#organization\",\"name\":\"HuntBee OpenCart\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-mobile-logo-new.png\",\"contentUrl\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-mobile-logo-new.png\",\"width\":945,\"height\":200,\"caption\":\"HuntBee OpenCart\"},\"image\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/huntbee.opencart\",\"https:\\\/\\\/www.instagram.com\\\/opencart.huntbee\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Improving Image Quality - HuntBee Resources","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.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/","og_locale":"en_US","og_type":"article","og_title":"Improving Image Quality - HuntBee Resources","og_description":"Requires skills to edit files in the server. Improving image quality increases the size of the image as well. This extension works on the images that are already compressed by the default OpenCart image library for JPEG images and are saved in image\/cache\/ folder. For improving the image quality of these JPEG images, do the [&hellip;]","og_url":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/","og_site_name":"HuntBee Resources","article_publisher":"https:\/\/www.facebook.com\/huntbee.opencart","article_modified_time":"2020-06-18T07:22:25+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/","url":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/","name":"Improving Image Quality - HuntBee Resources","isPartOf":{"@id":"https:\/\/www.huntbee.com\/resources\/#website"},"datePublished":"2020-04-11T04:42:45+00:00","dateModified":"2020-06-18T07:22:25+00:00","breadcrumb":{"@id":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/improving-image-quality\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.huntbee.com\/resources\/"},{"@type":"ListItem","position":2,"name":"WebP Compression for OpenCart","item":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/"},{"@type":"ListItem","position":3,"name":"Image Quality","item":"https:\/\/www.huntbee.com\/resources\/docs\/opencart-webp-compression\/image-quality\/"},{"@type":"ListItem","position":4,"name":"Improving Image Quality"}]},{"@type":"WebSite","@id":"https:\/\/www.huntbee.com\/resources\/#website","url":"https:\/\/www.huntbee.com\/resources\/","name":"HuntBee Resources","description":"OpenCart Extension Documentations - Guides - Blogs - Projects","publisher":{"@id":"https:\/\/www.huntbee.com\/resources\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.huntbee.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.huntbee.com\/resources\/#organization","name":"HuntBee OpenCart","url":"https:\/\/www.huntbee.com\/resources\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.huntbee.com\/resources\/#\/schema\/logo\/image\/","url":"https:\/\/www.huntbee.com\/resources\/wp-content\/uploads\/2020\/04\/cropped-mobile-logo-new.png","contentUrl":"https:\/\/www.huntbee.com\/resources\/wp-content\/uploads\/2020\/04\/cropped-mobile-logo-new.png","width":945,"height":200,"caption":"HuntBee OpenCart"},"image":{"@id":"https:\/\/www.huntbee.com\/resources\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/huntbee.opencart","https:\/\/www.instagram.com\/opencart.huntbee\/"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/1342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/comments?post=1342"}],"version-history":[{"count":4,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/1342\/revisions"}],"predecessor-version":[{"id":1554,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/1342\/revisions\/1554"}],"up":[{"embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/1341"}],"wp:attachment":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/media?parent=1342"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/doc_tag?post=1342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}