PNG to WebP Convert Demo:
PNG To WebP Converter
How to Convert PNG to WebP Online :
PNG To WebP Converter Online – Fast & High Quality for Blogger
What is PNG to WebP Conversion?
- Smaller file size
- High visual quality
- Faster loading speed
- Better website performance
Why You Should Convert PNG to WebP for Blogger
1. Faster Page Loading
2. Improved SEO Performance
3. Lower Data Usage
4. Maintains Image Quality
Benefits of Using an Online PNG to WebP Converter
Main benefits:
- Free and easy to use
- No technical skills required
- Instant conversion
- High-quality output
- Compatible with Blogger
How to Use WebP Images in Blogger
- Use keyword-rich file names (example: png-to-webp-converter.webp)
- Add proper alt text for SEO
- Compress large images before uploading
- Enable lazy loading if available
- Use responsive image settings.
Add HTML/JavaScript as a Sidebar Widget
- Go to Blogger Dashboard
- Click Layout
- Click Add a Gadget
- Select HTML/JavaScript
- Paste your code
- Click Save
Add Code in Blogger Theme (Advanced Method)
- Go to Theme
- Click Edit HTML
- Press Ctrl + F
- Paste your code above it
- Click Save.
PNG To WebP Converter Online HTML Javascript Code:
<!-- ===== PNG TO WEBP CONVERTER SAFE VERSION ===== -->
<style>
#webpTool{
max-width:700px;
margin:40px auto;
padding:30px;
background:#ffffff;
border-radius:20px;
box-shadow:0 15px 40px rgba(0,0,0,0.08);
font-family:Arial,sans-serif;
text-align:center;
}
#webpTool h2{
margin-bottom:20px;
}
#webpTool input[type=file]{
margin:15px 0;
}
#webpTool img{
max-width:100%;
margin-top:15px;
border-radius:10px;
}
#webpTool button{
margin-top:20px;
padding:12px;
width:100%;
border:none;
border-radius:10px;
background:#4CAF50;
color:#fff;
font-size:16px;
cursor:pointer;
}
#webpTool button:hover{
background:#388e3c;
}
#downloadLink{
display:inline-block;
margin-top:15px;
padding:8px 15px;
background:#2196F3;
color:#fff;
border-radius:8px;
text-decoration:none;
}
</style>
<div id="webpTool">
<h2>PNG To WebP Converter</h2>
<input type="file" id="pngInput" accept="image/png" />
<div id="previewArea"></div>
<button id="convertBtn">Convert to WebP</button>
<div id="resultArea"></div>
</div>
<script>
document.addEventListener("DOMContentLoaded",function(){
let file;
const input=document.getElementById("pngInput");
const preview=document.getElementById("previewArea");
const result=document.getElementById("resultArea");
const button=document.getElementById("convertBtn");
input.addEventListener("change",function(e){
file=e.target.files[0];
if(!file || file.type!=="image/png"){
alert("Please upload PNG file.");
return;
}
const reader=new FileReader();
reader.onload=function(ev){
preview.innerHTML="<img src='"+ev.target.result+"'>";
};
reader.readAsDataURL(file);
});
button.addEventListener("click",function(){
if(!file){
alert("Upload PNG first.");
return;
}
const reader=new FileReader();
reader.onload=function(ev){
const img=new Image();
img.src=ev.target.result;
img.onload=function(){
const canvas=document.createElement("canvas");
canvas.width=img.width;
canvas.height=img.height;
const ctx=canvas.getContext("2d");
ctx.drawImage(img,0,0);
const webp=canvas.toDataURL("image/webp",0.8);
result.innerHTML="<a id='downloadLink' href='"+webp+"' download='converted.webp'>Download WebP</a>";
};
};
reader.readAsDataURL(file);
});
});
</script>
Comments
Post a Comment