files/en-us/web/api/workerglobalscope/createimagebitmap/index.md
{{APIRef("Canvas API")}}{{AvailableInWorkers("worker")}}
The createImageBitmap() method of the {{domxref("WorkerGlobalScope")}} interface creates a bitmap from a given source, optionally cropped to contain only a portion of that source.
It accepts a variety of different image sources, and returns a {{jsxref("Promise")}} which resolves to an {{domxref("ImageBitmap")}}.
createImageBitmap(image)
createImageBitmap(image, options)
createImageBitmap(image, sx, sy, sw, sh)
createImageBitmap(image, sx, sy, sw, sh, options)
image
sx
ImageBitmap will be extracted.sy
ImageBitmap will be extracted.sw
ImageBitmap will be extracted.
This value can be negative.sh
ImageBitmap will be extracted. This value can be negative.options {{optional_inline}}
imageOrientation
from-image
flipY
none
premultiplyAlpha
none, premultiply, or default (default).colorSpaceConversion
none or default (default).
The value default indicates that implementation-specific behavior is used.resizeWidth
resizeHeight
resizeQuality
pixelated, low (default), medium, or high.A {{jsxref("Promise")}} which resolves to an {{domxref("ImageBitmap")}} object containing bitmap data from the given rectangle.
See {{domxref("Window.createImageBitmap()")}} for examples.
{{Specifications}}
{{Compat}}