.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Image: Image ===== **Category:** Built-In Types Brief Description ----------------- Image datatype. Member Functions ---------------- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`Image` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` mipmaps, :ref:`int` format **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`blend_rect` **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`blend_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`blit_rect` **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`blit_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`brush_transfer` **(** :ref:`Image` src, :ref:`Image` brush, :ref:`Vector2` pos=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`brushed` **(** :ref:`Image` src, :ref:`Image` brush, :ref:`Vector2` pos=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`compressed` **(** :ref:`int` format=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`converted` **(** :ref:`int` format=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`decompressed` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`empty` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fill` **(** :ref:`Color` color=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`fix_alpha_edges` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RawArray` | :ref:`get_data` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_format` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_height` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_pixel` **(** :ref:`int` x, :ref:`int` y, :ref:`int` mipmap_level=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`get_rect` **(** :ref:`Rect2` area=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_used_rect` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_width` **(** **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`load` **(** :ref:`String` path=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`put_pixel` **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color, :ref:`int` mipmap_level=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`resized` **(** :ref:`int` x, :ref:`int` y, :ref:`int` interpolation=1 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`save_png` **(** :ref:`String` path=0 **)** | +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **COMPRESS_BC** = **0** - **COMPRESS_PVRTC2** = **1** - **COMPRESS_PVRTC4** = **2** - **COMPRESS_ETC** = **3** - **FORMAT_GRAYSCALE** = **0** - **FORMAT_INTENSITY** = **1** - **FORMAT_GRAYSCALE_ALPHA** = **2** - **FORMAT_RGB** = **3** - **FORMAT_RGBA** = **4** - **FORMAT_INDEXED** = **5** - **FORMAT_INDEXED_ALPHA** = **6** - **FORMAT_YUV_422** = **7** - **FORMAT_YUV_444** = **8** - **FORMAT_BC1** = **9** - **FORMAT_BC2** = **10** - **FORMAT_BC3** = **11** - **FORMAT_BC4** = **12** - **FORMAT_BC5** = **13** - **FORMAT_PVRTC2** = **14** - **FORMAT_PVRTC2_ALPHA** = **15** - **FORMAT_PVRTC4** = **16** - **FORMAT_PVRTC4_ALPHA** = **17** - **FORMAT_ETC** = **18** - **FORMAT_ATC** = **19** - **FORMAT_ATC_ALPHA_EXPLICIT** = **20** - **FORMAT_ATC_ALPHA_INTERPOLATED** = **21** - **FORMAT_CUSTOM** = **22** - **INTERPOLATE_NEAREST** = **0** - **INTERPOLATE_BILINEAR** = **1** - **INTERPOLATE_CUBIC** = **2** Description ----------- Built in native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it. Member Function Description --------------------------- .. _class_Image_Image: - :ref:`Image` **Image** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` mipmaps, :ref:`int` format **)** Create an empty image of a specific size and format. .. _class_Image_blend_rect: - void **blend_rect** **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** Alpha-blends a "src_rect" :ref:`Rect2` from "src" :ref:`Image` to this :ref:`Image` on coordinates "dest". .. _class_Image_blend_rect_mask: - void **blend_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** Alpha-blends a "src_rect" :ref:`Rect2` from "src" :ref:`Image` to this :ref:`Image` using a "mask" :ref:`Image` on coordinates "dest". Alpha channels are required for both "src" and "mask", dest pixels and src pixels will blend if the corresponding mask pixel's alpha value is not 0. "src" :ref:`Image` and "mask" :ref:`Image` \*must\* have the same size (width and height) but they can have different formats .. _class_Image_blit_rect: - void **blit_rect** **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** Copy a "src_rect" :ref:`Rect2` from "src" :ref:`Image` to this :ref:`Image` on coordinates "dest". .. _class_Image_blit_rect_mask: - void **blit_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dest=0 **)** Blits a "src_rect" :ref:`Rect2` from "src" :ref:`Image` to this :ref:`Image` using a "mask" :ref:`Image` on coordinates "dest". Alpha channel is required for "mask", will copy src pixel onto dest if the corresponding mask pixel's alpha value is not 0. "src" :ref:`Image` and "mask" :ref:`Image` \*must\* have the same size (width and height) but they can have different formats .. _class_Image_brush_transfer: - void **brush_transfer** **(** :ref:`Image` src, :ref:`Image` brush, :ref:`Vector2` pos=0 **)** Transfer data from "src" to this :ref:`Image` using a "brush" as a mask/brush on coordinates "pos". .. _class_Image_brushed: - :ref:`Image` **brushed** **(** :ref:`Image` src, :ref:`Image` brush, :ref:`Vector2` pos=0 **)** Return a new :ref:`Image` from this :ref:`Image` that is created by brushhing see :ref:`brush_transfer`. .. _class_Image_compressed: - :ref:`Image` **compressed** **(** :ref:`int` format=0 **)** Return a new compressed :ref:`Image` from this :ref:`Image` using one of :ref:`Image`.COMPRESS\_\*. .. _class_Image_converted: - :ref:`Image` **converted** **(** :ref:`int` format=0 **)** Return a new :ref:`Image` from this :ref:`Image` with a different format. .. _class_Image_decompressed: - :ref:`Image` **decompressed** **(** **)** Return a new decompressed :ref:`Image`. .. _class_Image_empty: - :ref:`bool` **empty** **(** **)** Return whether this :ref:`Image` is empty(no data). .. _class_Image_fill: - void **fill** **(** :ref:`Color` color=0 **)** Fills an :ref:`Image` with a specified :ref:`Color` .. _class_Image_fix_alpha_edges: - void **fix_alpha_edges** **(** **)** .. _class_Image_get_data: - :ref:`RawArray` **get_data** **(** **)** Return the raw data of the :ref:`Image`. .. _class_Image_get_format: - :ref:`int` **get_format** **(** **)** Return the format of the :ref:`Image`, one of :ref:`Image`.FORMAT\_\*. .. _class_Image_get_height: - :ref:`int` **get_height** **(** **)** Return the height of the :ref:`Image`. .. _class_Image_get_pixel: - :ref:`Color` **get_pixel** **(** :ref:`int` x, :ref:`int` y, :ref:`int` mipmap_level=0 **)** Return the color of the pixel in the :ref:`Image` on coordinates "x,y" on mipmap level "mipmap_level". .. _class_Image_get_rect: - :ref:`Image` **get_rect** **(** :ref:`Rect2` area=0 **)** Return a new :ref:`Image` that is a copy of "area" in this :ref:`Image`. .. _class_Image_get_used_rect: - :ref:`Rect2` **get_used_rect** **(** **)** Return the area of this :ref:`Image` that is used/visibly colored/opaque. .. _class_Image_get_width: - :ref:`int` **get_width** **(** **)** Return the width of the :ref:`Image`. .. _class_Image_load: - :ref:`int` **load** **(** :ref:`String` path=0 **)** Load an :ref:`Image`. .. _class_Image_put_pixel: - void **put_pixel** **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color, :ref:`int` mipmap_level=0 **)** Put a pixel of "color" on coordinates "x,y" on mipmap level "mipmap_level". .. _class_Image_resized: - :ref:`Image` **resized** **(** :ref:`int` x, :ref:`int` y, :ref:`int` interpolation=1 **)** Return a new :ref:`Image` from this :ref:`Image` that is resized to size "x,y" using :ref:`Image`.INTERPOLATE\_\*. .. _class_Image_save_png: - :ref:`int` **save_png** **(** :ref:`String` path=0 **)** Save this :ref:`Image` as a png.