 }
 
 public extension UIImage {
+    
+    internal class func image(color: UIColor, size: CGSize) -> UIImage? {
+        
+        let rect = CGRect(origin: .zero, size: size)
+        UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0)
+        
+        color.set()
+        UIRectFill(rect)
+        
+        let image = UIGraphicsGetImageFromCurrentImageContext()
+        UIGraphicsEndImageContext()
+        
+        return image
+    }
     
     public func writeToTemporaryURL() -> URL? {
         

        
        let frameDelay: TimeInterval = 0.1
        
        let innerFileProperties = [kCGImagePropertyAPNGLoopCount as String: 0 as NSNumber] as CFDictionary
        let fileProperties = [kCGImagePropertyPNGDictionary as String: innerFileProperties] as CFDictionary
        
        let innerFrameProperties = [kCGImagePropertyAPNGDelayTime as String: frameDelay as NSNumber] as CFDictionary
        let frameProperties = [kCGImagePropertyPNGDictionary as String: innerFrameProperties] as CFDictionary
        
        let count: Int = Int(self.count.toIntMax())
        guard let destination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypePNG, count, nil) else {
            throw SavageCanvasError.imageCreation(url: url)
        }
        
        CGImageDestinationSetProperties(destination, fileProperties)
        
        self.flatMap { $0.cgImage }.forEach {
            CGImageDestinationAddImage(destination, $0, frameProperties)
        }
        
        if !CGImageDestinationFinalize(destination) {

    
    public func renderToImageSequence() -> [UIImage] {
        
        let size = self.frame.size
        var images: [UIImage] = []
        
        for i in 0 ..< self.drawableObjects.count {
        
            if let image = self.drawableObjects[0...i].renderToImage(size: size) {
                images.append(image)
            }
        }
        
        if !images.isEmpty, let blankImage = UIImage.image(color: .clear, size: size) {
            images.insert(blankImage, at: 0)
        }
        
        return images
