Solution 1 :

Here is an exceedingly basic example of a way to accept a dragged-and-dropped image, draw it on a canvas with a filter, and allow one to right-click to save the image with the filter applied:

<!DOCTYPE html>
  <input type='file' />
  document.querySelector('input').addEventListener('drop', e => {
    const reader = new FileReader();
    reader.onload = () => {
      const image = new Image();
      image.src = reader.result;
      image.onload = () => {
        const canvas = document.querySelector('canvas');
        canvas.width = image.width;
        canvas.height = image.height;
        const context = canvas.getContext('2d');
        context.filter = 'blur(10px)';
        context.drawImage(image, 0, 0);

Problem :

I want to make an online filter web app. So I made some filter effects and drag and drop upload (with preview) on a <div> but I can’t download it(using the download button) when the filter is applied as I don’t know about Screen capture API or <svg>.So I want to draw the image on <canvas> as I know how to download the filtered image from the<canvas> but it appears that the functionality of drag and drop doesn’t work anymore if I use it or I don’t know how to use the drag effects (like on drag over it gives an effect as well as on drag leave removes the effect) and also don’t know how to drop the image on <canvas>. I am just giving some parts of my code down below.
[note: I also added a button to upload an image as you can see down below in HTML that function works same as drag and drop an image function]

     dropzone.ondragover = function (){
        this.className = "drop__zone can__over"; = "none";
        return false;

dropzone.ondragleave = function(){
    this.className = "drop__zone"; = "block";
    return false;

dropzone.ondrop = function (e){
    this.className = "drop__zone"; = "none"; = "none";

var update = function(file){
    var reader = new FileReader();
    reader.onload = ()=>{
        img.src = reader.result; = "480px"; = "640px"; = "transparent";
   return false;     
  <div class="drop__zone" id="drop__zone"></div>

    <div class="dropzone" id="drop__zone">
       <a  id="download_link" download="edited.jpg"  href=""></a>
        <span class="dropzone__span">
            Drag a Image Here <br>or<br>
        <input type="file" id="mainup" multiple="false" accept="image/*" class="fileinput">
        <label for="mainup" class="btn__label" id="lab1">Upload a Picture</label>



Comment posted by Sheikh Araf

Thanks, man it helped me a lot for actual things though I need to figure out a lot more but thank you. I am grateful to you.

Comment posted by MarsAndBack

Thanks for the non-Jquery answer!