---
title: "init(pasteboard:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsimage/init(pasteboard:)"
---

# init(pasteboard:)

Initializes and returns an image object with data from the specified pasteboard.

## Declaration

```swift
convenience init?(pasteboard: NSPasteboard)
```

## Parameters

- `pasteboard`: The pasteboard containing the image data. The data on the pasteboard can be in any format that macOS supports, including PDF, PICT, EPS, or any number of bitmap data formats.

## Return Value

Return Value An initialized NSImage object or nil if the method cannot create an image from the contents of the pasteboard.

## Discussion

Discussion The specified pasteboard should contain a type supported by one of the registered NSImageRep subclasses. The table below lists the default pasteboard types and file extensions for several NSImageRep subclasses.  |  |   |  |   |  |   |  |   |  |  If the specified pasteboard contains the value NSFilenamesPboardType, each filename on the pasteboard should have an extension supported by one of the registered NSImageRep subclasses. You can use the imageUnfilteredFileTypes() method of a given subclass to obtain the list of supported types for that class.

## See Also

### Creating Images from Existing Data

- [init(data:)](appkit/nsimage/init(data:).md)
- [init(dataIgnoringOrientation:)](appkit/nsimage/init(dataignoringorientation:).md)
- [init(cgImage:size:)](appkit/nsimage/init(cgimage:size:)-8oznv.md)
- [init(coder:)](appkit/nsimage/init(coder:).md)
