title: Crop and Square image from center using SixLabors
body: <p>I am able to crop an image from the origin using the SixLabors Graphics Processing Library - but cannot figure out how to use it to crop from the center.  </p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code> public string ResizeToHeight(string filePath, float height, string targetDirectoryName)
      {
          string rootDirectoryPath = new DirectoryInfo(filePath).Parent.Parent.FullName;
          var processingPathDirectory = Path.Combine(rootDirectoryPath, Constants.PROCESSING_FOLDER);
          var processingPathFile = Path.Combine(processingPathDirectory, Path.GetFileName(filePath));
          var side = Convert.ToInt32(height);
  
          using (Image&lt;Rgba32&gt; image = Image.Load(filePath))
          {
              var fractionalChange = height/image.Height;
              var newWidth = Convert.ToInt32(image.Width * fractionalChange);
              var newHeight = Convert.ToInt32(image.Height * fractionalChange);
  
  
              image.Mutate(x =&gt; x
                   .Resize(newWidth, newHeight));
  
              image.Save(processingPathFile); // Automatic encoder selected based on extension.
          }
          using (Image&lt;Rgba32&gt; image = Image.Load(processingPathFile))
          {
              var difference = Math.Abs(image.Height-image.Width);
              if(image.Height&gt;image.Width)
              {
                  var y = difference/2;
  
  
                  image.Mutate(x =&gt; x
                  .Crop(side, side));
  
                  //I'd like to do something like
                  //image.Mutate(x=&gt;x
                  //.Crop(0,difference, side,side)
                  //so that the rectangular image is cropped from the center
  
                  image.Save(processingPathFile);
              }
          }
          //etc
      }
  </code></pre>
  
  <p>Any help greatly appreciated.  </p>