         )
         
         // Retrieve the new image
-        guard let output = UIGraphicsGetImageFromCurrentImageContext() else {
-            return nil
-        }
-        UIGraphicsEndImageContext()
-        return output
+        if let output = UIGraphicsGetImageFromCurrentImageContext() {
+            return output
+        }
+        return self
     }
 }
 

    public func remake(
        roundingCorners corners: UIRectCorner = .allCorners,
        radius: CGFloat = 0,
        strokeColor: UIColor = UIColor.clear,
        strokeLineWidth: CGFloat = 1.0 / UIScreen.main.scale) -> UIImage?
    {
        let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: size)
        
        UIGraphicsBeginImageContextWithOptions(rect.size, false, 0)
        guard let context = UIGraphicsGetCurrentContext() else { fatalError() }
        
        let path = UIBezierPath(
            roundedRect: rect,
            byRoundingCorners: corners,
            cornerRadii: CGSize(width: radius, height: radius)
        )
        context.addPath(path.cgPath)
        
        context.clip()
        draw(in: rect)
        
        context.setLineWidth(strokeLineWidth)
        context.setStrokeColor(strokeColor.cgColor)
        let roundedRect = CGRect(
            x: strokeLineWidth,
            y: strokeLineWidth,
            width: rect.width - strokeLineWidth * 2,
            height: rect.height - strokeLineWidth * 2)
        let roundedPath = UIBezierPath(
            roundedRect: roundedRect,
            byRoundingCorners: corners,
            cornerRadii: CGSize(width: radius, height: radius)
        )
        roundedPath.stroke()
        
        guard let output = UIGraphicsGetImageFromCurrentImageContext() else {
            return nil
        }
        UIGraphicsEndImageContext()
        return output
    }
    
    public func remake(alpha: CGFloat) -> UIImage {
        UIGraphicsBeginImageContext(size)
        
        let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
        draw(in: rect, blendMode: .normal, alpha: alpha)
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        
        return image!
    }
    
    public func rendering(color: UIColor, alpha: CGFloat = 1.0) -> UIImage? {
        UIGraphicsBeginImageContext(size)
        
        color.setFill()
        let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
        UIRectFill(rect)
        draw(in: rect, blendMode: .overlay, alpha: alpha)
        guard let output = UIGraphicsGetImageFromCurrentImageContext() else {
            return nil
        }
        UIGraphicsEndImageContext()
        return output
    }
    
    public func builtThumbnail(targetSize: CGSize, useFitting: Bool = true) -> UIImage? {
        UIGraphicsBeginImageContextWithOptions(targetSize, false, 0.0)
        // Establish the output thumbnail rectangle
        let targetRect = CGRectMake(origin: CGPoint.zero, size: targetSize)
        // Create the source image’s bounding rectangle

        // Draw the new thumbnail
        draw(in: destinationRect)
        // Retrieve and return the new image
        if let output = UIGraphicsGetImageFromCurrentImageContext() {
            return output
        }
        return self
    }
    
    /// Extract image
