{{newin|[[0.10.0]]|100|type=function|text=It has been renamed from [[Canvas:getImageData]]}}
Generates [[ImageData]] from the contents of the Canvas.

{{newobjectnotice}}
== Function ==
=== Synopsis ===
<source lang="lua">
data = Canvas:newImageData( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|ImageData|data|The new ImageData made from the Canvas' contents.}}

== Function ==
{{newin|[[11.0]]|110|type=variant}}
=== Synopsis ===
<source lang="lua">
data = Canvas:newImageData( slice, mipmap, x, y, width, height )
</source>
=== Arguments ===
{{param|number|slice|The cubemap face index, array index, or depth layer for [[TextureType|cubemap, array, or volume]] type Canvases, respectively. This argument is ignored for regular 2D canvases.}}
{{param|number|mipmap (1)|The mipmap index to use, for Canvases with [[CanvasMipmapMode|mipmaps]].}}
{{param|number|x|The x-axis of the top-left corner (in pixels) of the area within the Canvas to capture.}}
{{param|number|y|The y-axis of the top-left corner (in pixels) of the area within the Canvas to capture.}}
{{param|number|width|The width in pixels of the area within the Canvas to capture.}}
{{param|number|height|The height in pixels of the area within the Canvas to capture.}}
=== Returns ===
{{param|ImageData|data|The new ImageData made from the Canvas' contents.}}

== Function ==
{{oldin|[[11.0]]|110|type=variant}}
=== Synopsis ===
<source lang="lua">
data = Canvas:newImageData( x, y, width, height )
</source>
=== Arguments ===
{{param|number|x|The x-axis of the top-left corner (in pixels) of the area within the Canvas to capture.}}
{{param|number|y|The y-axis of the top-left corner (in pixels) of the area within the Canvas to capture.}}
{{param|number|width|The width in pixels of the area within the Canvas to capture.}}
{{param|number|height|The height in pixels of the area within the Canvas to capture.}}
=== Returns ===
{{param|ImageData|data|The new ImageData made from the Canvas' contents.}}

== See Also ==
* [[parent::Canvas]]
* [[love.graphics.captureScreenshot]]
* [[Constructs::ImageData]]
[[Category:Functions]]
{{#set:Description=Generates [[ImageData]] from the contents of the Canvas.}}
== Other Languages ==
{{i18n|Canvas:newImageData}}