Stop ball less abruptly

if you press space the ellipse jumps, but it stops very abruptly how can i slow it down instead?

//visual
PImage shrek;
boolean invert= false;
//timer

//moving
float charx=0;
float chary=563-25;
boolean jumping= false;
float gravity= 10;
float jumpingheight=200;

void setup() {
  size(1000, 563);
  shrek= loadImage("shrek.jpg");
}

void draw() {
  frameRate(60);
  //visual
  background(shrek);
  color(255);
  ellipse(charx, chary, 50, 50);

  //timer
  println(millis()/1000);
  if (millis()/1000%300==0&&millis()/1000>10&& invert==false) {
    invert=true;
  }
  if (millis()/1000%600==0&&millis()/1000>10&& invert==true) {
    invert=false;
  }
  if (invert==true) {
    filter(INVERT);
  }


  //moving

  if (keyPressed) {
    //move left with a
    if (key == 'a'&&invert==false) {
      charx=charx-10;
    } 

    //move right with d
    if (key == 'd'&&invert==false) {
      charx=charx+10;
    }

    //move right with a
    if (key == 'a'&&invert==true) {
      charx=charx+10;
    } 

    //move left with d
    if (key == 'd'&&invert==true) {
      charx=charx-10;
    }

    if (key == ' '&&chary>height-jumpingheight) {
      jumping=true;
    }
  }
  if (charx>=width-25) {
    charx=width-25;
  }

  if (charx<=0+25) {
    charx= 0+25;
  }
  if (jumping==true) {
    chary=chary-10;
    charx=charx+0.1;
    if (chary<=height-jumpingheight) {
      jumping=false;
    }
  }
  if (chary!=height-25&&jumping==false) {
    chary+=gravity;
  }

}

Hello,

Easing.

:)

this is what i ended up with maybe not exactly easing but im good with this, one more question. how do i make it so the ball can’t jump again until you hit the ground, or at least a way that you cant jump in mid air

//visual
PImage shrek;
boolean invert= false;
//timer

//moving
float charx=0;
float chary=563-25;
boolean jumping= false;
float gravity= 10;
float jumpingheight=100;
float jumpspeed;

void setup() {
  size(1000, 563);
  shrek= loadImage("shrek.jpg");
}

void draw() {
  frameRate(60);
  //visual
  background(shrek);
  color(255);
  ellipse(charx, chary, 50, 50);

  //timer
  println(millis()/1000);
  if (millis()/1000%300==0&&millis()/1000>10&& invert==false) {
    invert=true;
  }
  if (millis()/1000%600==0&&millis()/1000>10&& invert==true) {
    invert=false;
  }
  if (invert==true) {
    filter(INVERT);
  }


  //moving
    if (charx>=width-25) {
    charx=width-25;
  }
  jumpspeed= int(dist(0, jumpingheight, 0, chary)/20);
  
  if (chary>height-25) {
    chary=height-25;
  }
  if (keyPressed) {

    //move left with a
    if (key == 'a'&&invert==false) {
      charx=charx-10;
    } 

    //move right with d
    if (key == 'd'&&invert==false) {
      charx=charx+10;
    }

    //move right with a
    if (key == 'a'&&invert==true) {
      charx=charx+10;
    } 

    //move left with d
    if (key == 'd'&&invert==true) {
      charx=charx-10;
    }
    //jump with space
    if (key == ' '&&chary>height-jumpingheight) {
      jumping=true;
    }
  }

  if (charx<=0+25) {
    charx= 0+25;
  }
  if (jumping==true) {
    chary=int(chary-jumpspeed);
    charx=charx+0.1;
    if (jumpspeed<10&&chary<height-30) {
      jumping=false;
    }
  }
  if (chary!=height-25&&jumping==false) {
    chary+=gravity;
  }
}