         context.draw(cgImage, in: CGRect(origin: CGPoint.zero, size: size))
 
         #if os(macOS)
-            return context.makeImage().flatMap { Image(cgImage: $0, size: kf.size) }
+            return context.makeImage().flatMap { KFCrossPlatformImage(cgImage: $0, size: kf.size) }
         #else
-            return context.makeImage().flatMap { Image(cgImage: $0) }
+            return context.makeImage().flatMap { KFCrossPlatformImage(cgImage: $0) }
         #endif
     }
 }

        let s = WebPSerializer.default

        fileNames.forEach { fileName in
            let image = Image(data: Data(fileName: fileName))!
            
            let webpData = s.data(with: image, original: nil)
            XCTAssertNotNil(webpData, fileName)

}

// Copied from Kingfisher project
extension KFCrossPlatformImage {
    func renderEqual(to image: KFCrossPlatformImage, withinTolerance tolerance: UInt8 = 3, tolerancePercent: Double = 0) -> Bool {

        guard size == image.size else { return false }
        guard let imageData1 = pngData(), let imageData2 = image.pngData() else { return false }
        guard let unifiedImage1 = KFCrossPlatformImage(data: imageData1), let unifiedImage2 = KFCrossPlatformImage(data: imageData2) else { return false }

        guard let rendered1 = unifiedImage1.rendered(), let rendered2 = unifiedImage2.rendered() else { return false }
        guard let data1 = rendered1.cgImage?.dataProvider?.data, let data2 = rendered2.cgImage?.dataProvider?.data else { return false }
