Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blob Image Convert

Convert image Blob or File object to different formats (png, webp and jpeg)

toPNG (convert blob to PNG)

Convert image blob to PNG blob

toJPEG (convert blob to JPEG)

Convert image blob to JPEG blob

toWebP (convert blob to WebP) - Works only on chrome, falls back to png

Convert image blob to WebP blob

Usage

Either use the callback or as a Promise

blob.ToPNG(function(pngBlob){
    
})

blob.ToPNG(pngBlob = >{
    
})

blob.ToPNG().then(function(pngBlob) {

})

blob.ToPNG().then(pngBlob => {

})

How it works

The source blog image is drawn on a canvas object and then toDataURL method of canvas to convert to different file type.

About

Convert image Blob and File to different formats (png, webp and jpeg)

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages