<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/provideImageData(_:bytesPerRow:origin:_:size:_:userInfo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)provideImageData:bytesPerRow:origin::size::userInfo:"
  },
  "title" : "provideImageData(_:bytesPerRow:origin:_:size:_:userInfo:)"
}
-->

# provideImageData(_:bytesPerRow:origin:_:size:_:userInfo:)

Supplies data to a `CIImage` object.

```
func provideImageData(_ data: UnsafeMutableRawPointer, bytesPerRow rowbytes: Int, origin originx: Int, _ originy: Int, size width: Int, _ height: Int, userInfo info: Any?)
```

## Parameters

`data`

A pointer to image data. Note that `data[0]` refers to the first byte of the requested subimage, not the larger image buffer.

`rowbytes`

The number of bytes per row.

`width`

The width of the image data.

`height`

The height of the image data.

`info`

User supplied data, which is optional.

## Discussion

You can supply the image provider to these methods of the `CIImage` class:

- <doc://com.apple.documentation/documentation/CoreImage/CIImage/imageWithImageProvider:size::format:colorSpace:options:> to create a CIImage object from image data
- <doc://com.apple.documentation/documentation/CoreImage/CIImage/init(imageProvider:size:_:format:colorSpace:options:)> to initialize an existing CIImage with data

You initialize the given bitmap with the subregion specified by the arguments `x`, `y`, `width`, and `height`. The subregion uses the local coordinate space of the image, with the origin at the upper-left corner of the image. If you change the virtual memory mapping of the buffer specified by the `data` argument (such as by using `vm_copy` to modify it), the behavior is undefined.

That this callback always requests the full image data regardless of what is actually visible. All of the image is loaded or none of it is. The exception is when you create a tiled image by specifying the `kCIImageProviderTileSize` option. In this case, only the needed tiles are requested.

## See Also

  [Core Image Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185)



---

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)