.control
.slider
  .before-wrapper
    img(src="https://i.imgur.com/noBApUB.png")
  .after-wrapper
    img(src="https://i.imgur.com/JRl68gC.png")
View Compiled
body {
}
.control {
  position: absolute;
  right: calc(50% - 220px);
  top: 20px;
  height: 150px;
  z-index: 10;
}

.slider {
  position: relative;
  img {
    max-height:300px;
  }
}
.before-wrapper {
  height: 100%;
  width: 100%;
  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    
  }
}

.after-wrapper {
 position: absolute;
    top: 0;
    left: 0;
    height: 50%;
    width: 100%;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    z-index: 2;
  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}
View Compiled
$('.control').slider({
        orientation: "vertical",
        range: false,
        min: 0,
        max: 100,
        value: 50,
        animate: 'fast',
        slide: function( event, ui ) {
            resizeSliderImage(ui.value);
        }
    }); 

function resizeSliderImage(value) {
    value = 100 - value;
    $('.before-wrapper').height(value + '%');
    $('.after-wrapper').height(100 - value + '%');
}

External CSS

  1. https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js