     
     public var inputImage: MTIImage?
     
+    public var outputImageSize: CGSize?
+    
     public var outputImage: MTIImage? {
         guard let inputImage = self.inputImage, let filter = filter?.copy() as? CIFilter else {
             return nil
         }
-        let placeholder = CIImage(color: CIColor()).cropped(to: inputImage.extent)
-        filter.setValue(placeholder, forKey: kCIInputImageKey)
         let dimensions: MTITextureDimensions
-        if let output = filter.outputImage {
-            dimensions = MTITextureDimensions(cgSize: output.extent.size)
+        if let outputImageSize = self.outputImageSize {
+            dimensions = MTITextureDimensions(cgSize: outputImageSize)
         } else {
-            assertionFailure()
-            dimensions = inputImage.dimensions
+            let placeholder = CIImage(color: CIColor()).cropped(to: inputImage.extent)
+            filter.setValue(placeholder, forKey: kCIInputImageKey)
+            if let output = filter.outputImage {
+                dimensions = MTITextureDimensions(cgSize: output.extent.size)
+            } else {
+                assertionFailure()
+                dimensions = inputImage.dimensions
+            }
         }
         return MTICoreImageKernel.image(byProcessing: inputImage, using: filter, colorSpace: colorSpace, outputDimensions: dimensions, outputPixelFormat: outputPixelFormat, outputAlphaType: .nonPremultiplied)
     }

            return self
        }
        
        func resolve(with renderingContext: MTIImageRenderingContext) throws -> MTIImagePromiseRenderTarget {
            let inputCIImages: [CIImage] = try dependencies.map({
                let texture = renderingContext.resolvedTexture(for: $0)
                let options: [CIImageOption: Any] = [.colorSpace: colorSpace ?? NSNull()]
                
                // CoreImage does not support yCbCr8_420_2p, yCbCr8_420_2p_srgb pixel format. We have to convert.
                if texture.pixelFormat == .yCbCr8_420_2p || texture.pixelFormat == .yCbCr8_420_2p_srgb {
                    let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .bgra8Unorm, width: texture.width, height: texture.height, mipmapped: false)

                    commandEncoder.setFragmentSamplerState(try renderingContext.context.samplerState(with: MTISamplerDescriptor.default), index: 0)
                    MTIVertices.fullViewportSquare.encodeDrawCall(with: commandEncoder, context: pipeline)
                    commandEncoder.endEncoding()
                    return try ciImage(for: $0, from: tempTexture)
                } else {
                    return try ciImage(for: $0, from: texture)
                }
            })
            let renderTarget = try renderingContext.context.makeRenderTarget(resuableTextureDescriptor: MTITextureDescriptor(pixelFormat: pixelFormat == .invalid ? renderingContext.context.workingPixelFormat : pixelFormat, width: dimensions.width, height: dimensions.height, mipmapped: false, usage: [.shaderRead,.shaderWrite], resourceOptions: .storageModePrivate))
            let outputCIImage = try filter(inputCIImages)
            let renderDestination = CIRenderDestination(mtlTexture: renderTarget.texture!, commandBuffer: renderingContext.commandBuffer)
            renderDestination.isFlipped = true
            switch alphaType {
            case .alphaIsOne:
                renderDestination.alphaMode = .none
