         default: break
         }
         
-        return _resize(fills: size, applying: _transform(forOrientation: size), transposed: transposed, quality: quality)
-    }
-    /// Returns a copy of the image that has been transformed using the given affine transform and scaled to the new size in pixels.
+        return _resize(fills: size, applying: _transform(forOrientation: size.scale(by: scale)), transposed: transposed, quality: quality)
+    }
+    /// Returns a copy of the image that has been transformed using the given affine transform and scaled to the new size in points.
     /// Animated image supported.
     ///
     /// The new image's orientation will be UIImageOrientationUp, regardless of the current image's orientation

            return resize(fills: size, quality: quality)
        }
        
        let newSize = CGSize(width: (scaledWidth * ratio).rounded(), height: (scaledHeight * ratio).rounded())
        return resize(fills: newSize, quality: quality)
    }
    /// Creates a rescaled copy of the image, taking into account its orientation in pixels. Animated image supported.
    ///
    /// The image will be scaled disproportionately if necessary to fit the bounds specified by the parameter.
    ///

    ///
    /// - Returns: A new image with the given color filled.
    public func tint(with color: UIColor) -> UIImage! {
        UIGraphicsBeginImageContextWithOptions(size, false, scale)
        defer { UIGraphicsEndImageContext() }
        guard let cgImage = self.cgImage, let context = UIGraphicsGetCurrentContext() else { return nil }
        context.translateBy(x: 0.0, y: scaledHeight)
        context.scaleBy(x: 1.0, y: -1.0)
        context.setBlendMode(.normal)
        let rect = CGRect(origin: .zero, size: size)
        context.clip(to: rect, mask: cgImage)
        color.setFill()
        context.fill(rect)
