{"id":17,"date":"2026-09-16T20:49:16","date_gmt":"2026-09-16T20:49:16","guid":{"rendered":"https:\/\/filejp.in\/?page_id=17"},"modified":"2026-09-16T22:04:50","modified_gmt":"2026-09-16T22:04:50","slug":"image-compressor","status":"publish","type":"page","link":"https:\/\/filejp.in\/index.php\/image-compressor\/","title":{"rendered":"Image Compressor"},"content":{"rendered":"<!--themify_builder_content-->\n<div id=\"themify_builder_content-17\" data-postid=\"17\" class=\"themify_builder_content themify_builder_content-17 themify_builder tf_clear\">\n                    <div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_zlys150 tb_first tf_w\">\n                        <div class=\"row_inner col_align_top tb_col_count_1 tf_box tf_rel\">\n                        <div  data-lazy=\"1\" class=\"module_column tb-column col-full tb_587j150 first\">\n                    <!-- module text -->\n<div  class=\"module module-text tb_6x7k765   \" data-lazy=\"1\">\n        <div  class=\"tb_text_wrap\">\n        <p>Compress Image Online &#8211; Free Image Compressor | File JP<\/p>    <\/div>\n<\/div>\n<!-- \/module text -->        <\/div>\n                        <\/div>\n        <\/div>\n                        <div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_gxtt426 tf_w\">\n                        <div class=\"row_inner col_align_top tb_col_count_1 tf_box tf_rel\">\n                        <div  data-lazy=\"1\" class=\"module_column tb-column col-full tb_dwrg426 first\">\n                    <!-- module plain text -->\n<div  class=\"module module-plain-text tb_m059996 \" data-lazy=\"1\">\n        <div class=\"tb_text_wrap\">\n    <div style=\"max-width: 480px; margin: 30px auto; padding: 25px; border: 1px solid #e0e0e0; border-radius: 12px; text-align: center; font-family: Arial, sans-serif; box-shadow: 0 4px 10px rgba(0,0,0,0.05); background-color: #ffffff;\">\n\n    <h2 style=\"margin-top: 0; color: #333333; font-size: 22px;\">Image Compressor<\/h2>\n    <p style=\"color: #666666; font-size: 14px; margin-bottom: 20px;\">Quality meter ko kam karke file size (KB) reduce karein.<\/p>\n    \n    <!-- File Input -->\n    <input type=\"file\" id=\"compressorInput\" accept=\"image\/*\" style=\"display: none;\" onchange=\"loadCompressorImage(this)\">\n    <label for=\"compressorInput\" style=\"background-color: #2271b1; color: #ffffff; padding: 12px 20px; border-radius: 6px; cursor: pointer; display: inline-block; font-weight: bold; font-size: 14px;\">Select Image<\/label>\n    \n    <!-- Settings & Result Area -->\n    <div id=\"compressorControls\" style=\"margin-top: 20px; display: none; border-top: 1px solid #eee; padding-top: 20px;\">\n        \n        <!-- Quality Slider (1% to 90%) -->\n        <div style=\"margin-bottom: 20px;\">\n            <label style=\"font-weight: bold; font-size: 14px; color: #444;\">Compression Quality: <span id=\"qualityVal\" style=\"color: #d63638;\">10%<\/span><\/label><br>\n            <input type=\"range\" id=\"qualityRange\" min=\"1\" max=\"90\" value=\"10\" style=\"width: 85%; margin-top: 10px;\" oninput=\"updateCompressorQuality(this.value)\">\n        <\/div>\n\n        <p style=\"font-weight: bold; color: #444; font-size: 14px; margin-bottom: 5px;\">Compressed Preview:<\/p>\n        <img id=\"compressedPreviewImg\" style=\"max-width: 100%; max-height: 220px; border-radius: 6px; border: 1px solid #ddd; margin-bottom: 10px;\">\n        \n        <p style=\"font-size: 14px; color: #333; font-weight: bold; margin-bottom: 20px;\">\n            File Size: <span id=\"compressedSizeText\" style=\"color: #46b450;\">0 KB<\/span>\n        <\/p>\n        \n        <!-- Download Button -->\n        <a id=\"compressedDownloadAnchor\" download=\"compressed-image.jpg\" style=\"background-color: #46b450; color: #ffffff; padding: 12px 25px; text-decoration: none; border-radius: 6px; display: inline-block; font-weight: bold; font-size: 15px; box-shadow: 0 3px 6px rgba(0,0,0,0.1);\">\ud83d\udce5 Download Compressed Image<\/a>\n    <\/div>\n\n    <canvas id=\"compressorCanvas\" style=\"display:none;\"><\/canvas>\n\n<\/div>\n\n<script>\nvar originalImgElement = new Image();\nvar currentFileName = \"compressed-image\";\n\nfunction loadCompressorImage(input) {\n    if (!input.files || !input.files[0]) return;\n\n    var file = input.files[0];\n    currentFileName = file.name.substring(0, file.name.lastIndexOf('.')) || 'compressed';\n\n    var reader = new FileReader();\n    reader.onload = function(e) {\n        originalImgElement.onload = function() {\n            document.getElementById('compressorControls').style.display = 'block';\n            processCompression();\n        };\n        originalImgElement.src = e.target.result;\n    };\n    reader.readAsDataURL(file);\n}\n\nfunction updateCompressorQuality(val) {\n    document.getElementById('qualityVal').innerText = val + '%';\n    processCompression();\n}\n\nfunction processCompression() {\n    var canvas = document.getElementById('compressorCanvas');\n    var ctx = canvas.getContext('2d');\n\n    var qualityPercent = parseFloat(document.getElementById('qualityRange').value);\n    var quality = qualityPercent \/ 100;\n\n    \/\/ Direct scaling for very low percentage (1% to 15%) to force size below 15KB\n    var scale = 1.0;\n    if (qualityPercent <= 15) {\n        scale = qualityPercent \/ 20; \n        if (scale < 0.2) scale = 0.2; \/\/ minimum dimension limit\n    }\n\n    canvas.width = originalImgElement.width * scale;\n    canvas.height = originalImgElement.height * scale;\n\n    \/\/ Background Fill (White for transparent PNGs)\n    ctx.fillStyle = '#FFFFFF';\n    ctx.fillRect(0, 0, canvas.width, canvas.height);\n    ctx.drawImage(originalImgElement, 0, 0, canvas.width, canvas.height);\n\n    \/\/ Quality compression\n    var compressedDataUrl = canvas.toDataURL('image\/jpeg', quality);\n\n    \/\/ Preview and Download link update\n    document.getElementById('compressedPreviewImg').src = compressedDataUrl;\n    \n    var downloadBtn = document.getElementById('compressedDownloadAnchor');\n    downloadBtn.href = compressedDataUrl;\n\n    \/\/ Calculate File Size\n    var head = 'data:image\/jpeg;base64,';\n    var sizeInBytes = Math.round((compressedDataUrl.length - head.length) * 3 \/ 4);\n    var sizeInKb = (sizeInBytes \/ 1024).toFixed(2);\n    \n    document.getElementById('compressedSizeText').innerText = sizeInKb + ' KB';\n    downloadBtn.setAttribute('download', currentFileName + '-' + Math.round(sizeInKb) + 'kb.jpg');\n}\n<\/script>    <\/div>\n<\/div>\n<!-- \/module plain text -->        <\/div>\n                        <\/div>\n        <\/div>\n                        <div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_424t129 tf_w\">\n                        <div class=\"row_inner col_align_top tb_col_count_1 tf_box tf_rel\">\n                        <div  data-lazy=\"1\" class=\"module_column tb-column col-full tb_g2rv129 first\">\n                    <!-- module text -->\n<div  class=\"module module-text tb_eg3z206   \" data-lazy=\"1\">\n        <div  class=\"tb_text_wrap\">\n        <p>Compress JPG and PNG images online while reducing file size. Free and easy image compression tool.<\/p>    <\/div>\n<\/div>\n<!-- \/module text -->        <\/div>\n                        <\/div>\n        <\/div>\n        <\/div>\n<!--\/themify_builder_content-->","protected":false},"excerpt":{"rendered":"<p>Compress Image Online &#8211; Free Image Compressor | File JP Image Compressor Quality meter ko kam karke file size (KB) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-17","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/pages\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":7,"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/pages\/17\/revisions"}],"predecessor-version":[{"id":91,"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/pages\/17\/revisions\/91"}],"wp:attachment":[{"href":"https:\/\/filejp.in\/index.php\/wp-json\/wp\/v2\/media?parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}