<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKDrawing-swift.struct/image(from:scale:)-220d0",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit9PKDrawingV5image4from5scaleSo7UIImageCSo6CGRectV_14CoreFoundation7CGFloatVtF"
  },
  "title" : "image(from:scale:)"
}
-->

# image(from:scale:)

Returns an image object that contains the specified portion of the drawing.

```
func image(from rect: CGRect, scale: CGFloat) -> UIImage
```

## Parameters

`rect`

The portion of the drawing that you want to capture. Specify a rectangle in the canvas’ coordinate system.

`scale`

The scale factor at which to create the image. Specifying scale factors greater than `1.0` creates an image with more detail. For example, you might specify a scale factor of `2.0` or `3.0` when displaying the image on a Retina display.

## Return Value

A new image object that contains the rendered content.

## Discussion

This method creates a new image and renders content from the canvas into that image at the specified scale factor.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)