@Override
    public CloseableImage decode(
        EncodedImage encodedImage,
        int length,
        QualityInfo qualityInfo,
        ImageDecodeOptions options) {
      CloseableReference<Bitmap> decodedBitmapReference =
          mPlatformDecoder.decodeJPEGFromEncodedImageWithColorSpace(
              encodedImage, options.bitmapConfig, mRegion, length, options.colorSpace);
      try {
        return CloseableStaticBitmap.of(decodedBitmapReference, qualityInfo, 0);
      } finally {
        CloseableReference.closeSafely(decodedBitmapReference);
      }
    }
Simple region decoding example that renders the original image and a selected region.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imagepipeline/ImagePipelineRegionDecodingFragment.java