---
title: "imageWithData:"
framework: coreimage
role: symbol
role_heading: Type Method
path: "coreimage/ciimage/imagewithdata:"
---

# imageWithData:

Creates and returns an image object initialized with the supplied image data.

## Declaration

```occ
+ (CIImage *) imageWithData:(NSData *) data;
```

## Parameters

- `data`: The data object that holds the contents of an image file (such as TIFF, GIF, JPG, or whatever else the system supports). The image data must be premultiplied.

## Return Value

Return Value An image object initialized with the supplied data, or nil if the method cannot create an image representation from the contents of the supplied data object.

## See Also

### Creating an Image

- [empty()](coreimage/ciimage/empty().md)
- [init(image:)](coreimage/ciimage/init(image:).md)
- [init(image:options:)](coreimage/ciimage/init(image:options:).md)
- [init(contentsOf:)](coreimage/ciimage/init(contentsof:).md)
- [imageWithContentsOfURL:](coreimage/ciimage/imagewithcontentsofurl:.md)
- [init(contentsOf:options:)](coreimage/ciimage/init(contentsof:options:).md)
- [imageWithContentsOfURL:options:](coreimage/ciimage/imagewithcontentsofurl:options:.md)
- [imageWithCGImage:](coreimage/ciimage/imagewithcgimage:.md)
- [init(cgImage:)](coreimage/ciimage/init(cgimage:)-2kvvb.md)
- [imageWithCGImage:options:](coreimage/ciimage/imagewithcgimage:options:.md)
- [init(cgImage:options:)](coreimage/ciimage/init(cgimage:options:)-8663h.md)
- [imageWithCGImageSource:index:options:](coreimage/ciimage/imagewithcgimagesource:index:options:.md)
- [init(cgImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-e2bz.md)
- [init(data:)](coreimage/ciimage/init(data:).md)
- [imageWithData:options:](coreimage/ciimage/imagewithdata:options:.md)
