mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1999 lines
121 KiB
ReStructuredText
1999 lines
121 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Image:
|
||
|
||
Image
|
||
=====
|
||
|
||
**Hereda:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
Tipo de datos de imagen.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Descripción
|
||
----------------------
|
||
|
||
Native image datatype. Contains image data which can be converted to an :ref:`ImageTexture<class_ImageTexture>` and provides commonly used *image processing* methods. The maximum width and height for an **Image** are :ref:`MAX_WIDTH<class_Image_constant_MAX_WIDTH>` and :ref:`MAX_HEIGHT<class_Image_constant_MAX_HEIGHT>`.
|
||
|
||
An **Image** cannot be assigned to a texture property of an object directly (such as :ref:`Sprite2D.texture<class_Sprite2D_property_texture>`), and has to be converted manually to an :ref:`ImageTexture<class_ImageTexture>` first.
|
||
|
||
\ **Note:** Methods that modify the image data cannot be used on VRAM-compressed images. Use :ref:`decompress()<class_Image_method_decompress>` to convert the image to an uncompressed format first.
|
||
|
||
\ **Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Tutoriales
|
||
--------------------
|
||
|
||
- :doc:`Importando imágenes <../tutorials/assets_pipeline/importing_images>`
|
||
|
||
- :doc:`Carga y guardado de archivos en tiempo de ejecución <../tutorials/io/runtime_file_loading_and_saving>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Propiedades
|
||
----------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`data<class_Image_property_data>` | ``{ "data": PackedByteArray(), "format": "Lum8", "height": 0, "mipmaps": false, "width": 0 }`` |
|
||
+-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Métodos
|
||
--------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`adjust_bcs<class_Image_method_adjust_bcs>`\ (\ brightness\: :ref:`float<class_float>`, contrast\: :ref:`float<class_float>`, saturation\: :ref:`float<class_float>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blend_rect<class_Image_method_blend_rect>`\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blend_rect_mask<class_Image_method_blend_rect_mask>`\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blit_rect<class_Image_method_blit_rect>`\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blit_rect_mask<class_Image_method_blit_rect_mask>`\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`bump_map_to_normal_map<class_Image_method_bump_map_to_normal_map>`\ (\ bump_scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_mipmaps<class_Image_method_clear_mipmaps>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`compress<class_Image_method_compress>`\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`compress_from_channels<class_Image_method_compress_from_channels>`\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, channels\: :ref:`UsedChannels<enum_Image_UsedChannels>`, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`compute_image_metrics<class_Image_method_compute_image_metrics>`\ (\ compared_image\: :ref:`Image<class_Image>`, use_luma\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`convert<class_Image_method_convert>`\ (\ format\: :ref:`Format<enum_Image_Format>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`copy_from<class_Image_method_copy_from>`\ (\ src\: :ref:`Image<class_Image>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create<class_Image_method_create>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create_empty<class_Image_method_create_empty>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create_from_data<class_Image_method_create_from_data>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`crop<class_Image_method_crop>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`decompress<class_Image_method_decompress>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`AlphaMode<enum_Image_AlphaMode>` | :ref:`detect_alpha<class_Image_method_detect_alpha>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`UsedChannels<enum_Image_UsedChannels>` | :ref:`detect_used_channels<class_Image_method_detect_used_channels>`\ (\ source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fill<class_Image_method_fill>`\ (\ color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fill_rect<class_Image_method_fill_rect>`\ (\ rect\: :ref:`Rect2i<class_Rect2i>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fix_alpha_edges<class_Image_method_fix_alpha_edges>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`flip_x<class_Image_method_flip_x>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`flip_y<class_Image_method_flip_y>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`generate_mipmaps<class_Image_method_generate_mipmaps>`\ (\ renormalize\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_data<class_Image_method_get_data>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_data_size<class_Image_method_get_data_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_Image_method_get_format>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_height<class_Image_method_get_height>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_mipmap_count<class_Image_method_get_mipmap_count>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_mipmap_offset<class_Image_method_get_mipmap_offset>`\ (\ mipmap\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_pixel<class_Image_method_get_pixel>`\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_pixelv<class_Image_method_get_pixelv>`\ (\ point\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`get_region<class_Image_method_get_region>`\ (\ region\: :ref:`Rect2i<class_Rect2i>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_size<class_Image_method_get_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Rect2i<class_Rect2i>` | :ref:`get_used_rect<class_Image_method_get_used_rect>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_width<class_Image_method_get_width>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_mipmaps<class_Image_method_has_mipmaps>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_compressed<class_Image_method_is_compressed>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_empty<class_Image_method_is_empty>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_invisible<class_Image_method_is_invisible>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`linear_to_srgb<class_Image_method_linear_to_srgb>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_Image_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bmp_from_buffer<class_Image_method_load_bmp_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dds_from_buffer<class_Image_method_load_dds_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_exr_from_buffer<class_Image_method_load_exr_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`load_from_file<class_Image_method_load_from_file>`\ (\ path\: :ref:`String<class_String>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_jpg_from_buffer<class_Image_method_load_jpg_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_ktx_from_buffer<class_Image_method_load_ktx_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_png_from_buffer<class_Image_method_load_png_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_svg_from_buffer<class_Image_method_load_svg_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`, scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_svg_from_string<class_Image_method_load_svg_from_string>`\ (\ svg_str\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_tga_from_buffer<class_Image_method_load_tga_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_webp_from_buffer<class_Image_method_load_webp_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`normal_map_to_xy<class_Image_method_normal_map_to_xy>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`premultiply_alpha<class_Image_method_premultiply_alpha>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`resize<class_Image_method_resize>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`resize_to_po2<class_Image_method_resize_to_po2>`\ (\ square\: :ref:`bool<class_bool>` = false, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`rgbe_to_srgb<class_Image_method_rgbe_to_srgb>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rotate_90<class_Image_method_rotate_90>`\ (\ direction\: :ref:`ClockDirection<enum_@GlobalScope_ClockDirection>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rotate_180<class_Image_method_rotate_180>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_dds<class_Image_method_save_dds>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_dds_to_buffer<class_Image_method_save_dds_to_buffer>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_exr<class_Image_method_save_exr>`\ (\ path\: :ref:`String<class_String>`, grayscale\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_exr_to_buffer<class_Image_method_save_exr_to_buffer>`\ (\ grayscale\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_jpg<class_Image_method_save_jpg>`\ (\ path\: :ref:`String<class_String>`, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_jpg_to_buffer<class_Image_method_save_jpg_to_buffer>`\ (\ quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_png<class_Image_method_save_png>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_png_to_buffer<class_Image_method_save_png_to_buffer>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_webp<class_Image_method_save_webp>`\ (\ path\: :ref:`String<class_String>`, lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_webp_to_buffer<class_Image_method_save_webp_to_buffer>`\ (\ lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_data<class_Image_method_set_data>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_pixel<class_Image_method_set_pixel>`\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_pixelv<class_Image_method_set_pixelv>`\ (\ point\: :ref:`Vector2i<class_Vector2i>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`shrink_x2<class_Image_method_shrink_x2>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`srgb_to_linear<class_Image_method_srgb_to_linear>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Enumeraciones
|
||
--------------------------
|
||
|
||
.. _enum_Image_Format:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Format**: :ref:`🔗<enum_Image_Format>`
|
||
|
||
.. _class_Image_constant_FORMAT_L8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_L8** = ``0``
|
||
|
||
Formato de textura con una única profundidad de 8 bits que representa la luminancia.
|
||
|
||
.. _class_Image_constant_FORMAT_LA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_LA8** = ``1``
|
||
|
||
Formato de textura OpenGL con dos valores, luminancia y alfa, cada uno almacenado con 8 bits.
|
||
|
||
.. _class_Image_constant_FORMAT_R8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R8** = ``2``
|
||
|
||
Formato de textura OpenGL ``RED`` con un solo componente y una profundidad de bits de 8.
|
||
|
||
.. _class_Image_constant_FORMAT_RG8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG8** = ``3``
|
||
|
||
Formato de textura OpenGL ``RG`` con dos componentes y una profundidad de bits de 8 para cada uno.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB8** = ``4``
|
||
|
||
OpenGL texture format ``RGB`` with three components, each with a bitdepth of 8.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA8** = ``5``
|
||
|
||
OpenGL texture format ``RGBA`` with four components, each with a bitdepth of 8.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA4444:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA4444** = ``6``
|
||
|
||
Formato de textura OpenGL ``RGBA`` con cuatro componentes, cada uno con una profundidad de bits de 4.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB565:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB565** = ``7``
|
||
|
||
Formato de textura OpenGL ``RGB`` con tres componentes. El rojo y azul tienen una profundidad de bits de 5, y el verde tiene una profundidad de bits de 6.
|
||
|
||
.. _class_Image_constant_FORMAT_RF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RF** = ``8``
|
||
|
||
Formato de textura OpenGL ``GL_R32F`` donde hay un componente, un valor de 32 bits de punto flotante.
|
||
|
||
.. _class_Image_constant_FORMAT_RGF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGF** = ``9``
|
||
|
||
Formato de textura OpenGL ``GL_RG32F`` donde hay dos componentes, cada uno con valores de 32 bits de real.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBF** = ``10``
|
||
|
||
Formato de textura OpenGL ``GL_RGB32F`` donde hay tres componentes, cada uno con valores de 32 bits real.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBAF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBAF** = ``11``
|
||
|
||
Formato de textura OpenGL ``GL_RGBA32F`` donde hay cuatro componentes, cada uno con valores de 32 bits real.
|
||
|
||
.. _class_Image_constant_FORMAT_RH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RH** = ``12``
|
||
|
||
Formato de textura OpenGL ``GL_R16F`` donde hay un componente, un valor de punto flotante de 16 bits de "media precisión".
|
||
|
||
.. _class_Image_constant_FORMAT_RGH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGH** = ``13``
|
||
|
||
Formato de textura OpenGL ``GL_RG16F`` donde hay dos componentes, cada uno un valor de punto flotante de 16 bits de "media precisión".
|
||
|
||
.. _class_Image_constant_FORMAT_RGBH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBH** = ``14``
|
||
|
||
Formato de textura OpenGL ``GL_RGB16F`` donde hay tres componentes, cada uno de ellos un valor de punto flotante de "media precisión" de 16 bits.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBAH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBAH** = ``15``
|
||
|
||
Formato de textura OpenGL ``GL_RGBA16F`` donde hay cuatro componentes, cada uno de ellos un valor de punto flotante de "media precisión" de 16 bits.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBE9995:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBE9995** = ``16``
|
||
|
||
Un formato especial de textura OpenGL donde los tres componentes de color tienen 9 bits de precisión y los tres comparten un único exponente de 5 bits.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT1** = ``17``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT3** = ``18``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT5** = ``19``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparent gradients compared to DXT3.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGTC_R:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGTC_R** = ``20``
|
||
|
||
Formato de textura que utiliza `Compresión de textura rojo-verde <https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression>`__, normalizando los datos del canal rojo utilizando el mismo algoritmo de compresión que DXT5 utiliza para el canal alfa.
|
||
|
||
.. _class_Image_constant_FORMAT_RGTC_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGTC_RG** = ``21``
|
||
|
||
Formato de textura que utiliza `Compresión de textura rojo-verde <https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression>`__, normalizando los datos de los canales rojo y verde utilizando el mismo algoritmo de compresión que DXT5 utiliza para el canal alfa.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBA** = ``22``
|
||
|
||
Texture format that uses `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ compression with unsigned normalized RGBA components.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBF** = ``23``
|
||
|
||
Formato de textura que utiliza la compresión `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ con componentes RGB reales firmados.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBFU:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBFU** = ``24``
|
||
|
||
Formato de textura que utiliza la compresión `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ con componentes RGB reales sin firmar.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC** = ``25``
|
||
|
||
`Formato de Compresión de Textura Ericsson 1 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC1>`__, también conocido como "ETC1", y es parte del estándar de gráficos OpenGL ES. Este formato no puede almacenar un canal alfa.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_R11:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_R11** = ``26``
|
||
|
||
`Formato de compresión de textura Ericsson 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``R11_EAC`` variant), que proporciona un canal de datos sin firmar.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_R11S:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_R11S** = ``27``
|
||
|
||
`Formato de compresión de textura de Ericsson 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (variante de ``SIGNED_R11_EAC``), que proporciona un canal de datos firmado.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RG11:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RG11** = ``28``
|
||
|
||
`Formato de compresión de textura de Ericsson 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RG11_EAC`` variant), que proporciona dos canales de datos sin firmar.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RG11S:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RG11S** = ``29``
|
||
|
||
`Formato de compresión de textura de Ericsson 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (variante de ``SIGNED_RG11_EAC``), que proporciona dos canales de datos firmados.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGB8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGB8** = ``30``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGB8`` variant), which is a follow-up of ETC1 and compresses RGB888 data.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGBA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGBA8** = ``31``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGBA8``\ variant), which compresses RGBA8888 data with full alpha support.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGB8A1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGB8A1** = ``32``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGB8_PUNCHTHROUGH_ALPHA1`` variant), which compresses RGBA data to make alpha either fully transparent or fully opaque.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RA_AS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RA_AS_RG** = ``33``
|
||
|
||
`Formato de compresión de textura de Ericsson 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (variante ``RGBA8``), que comprime los datos RA y los interpreta como dos canales (rojo y verde). Véase también :ref:`FORMAT_ETC2_RGBA8<class_Image_constant_FORMAT_ETC2_RGBA8>`.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT5_RA_AS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT5_RA_AS_RG** = ``34``
|
||
|
||
El formato de textura `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__, también conocido como Block Compression 3 o BC3, que comprime los datos RA y los interpreta como dos canales (rojo y verde). Véase también :ref:`FORMAT_DXT5<class_Image_constant_FORMAT_DXT5>`.
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_4x4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_4x4** = ``35``
|
||
|
||
`Compresión de textura adaptable y escalable <https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression>`__. Esto implementa el modo 4×4 (alta calidad).
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_4x4_HDR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_4x4_HDR** = ``36``
|
||
|
||
Mismo formato que :ref:`FORMAT_ASTC_4x4<class_Image_constant_FORMAT_ASTC_4x4>`, pero con la pista para que la GPU sepa que se utiliza para HDR.
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_8x8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_8x8** = ``37``
|
||
|
||
`Compresión de textura adaptable y escalable <https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression>`__. Esto implementa el modo 8×8 (baja calidad).
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_8x8_HDR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_8x8_HDR** = ``38``
|
||
|
||
Mismo formato que :ref:`FORMAT_ASTC_8x8<class_Image_constant_FORMAT_ASTC_8x8>`, pero con la pista para que la GPU sepa que se utiliza para HDR.
|
||
|
||
.. _class_Image_constant_FORMAT_R16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R16** = ``39``
|
||
|
||
OpenGL texture format ``GL_R16`` where there's one component, a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RF<class_Image_constant_FORMAT_RF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RG16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG16** = ``40``
|
||
|
||
OpenGL texture format ``GL_RG16`` where there are two components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGF<class_Image_constant_FORMAT_RGF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB16** = ``41``
|
||
|
||
OpenGL texture format ``GL_RGB16`` where there are three components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGBF<class_Image_constant_FORMAT_RGBF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA16** = ``42``
|
||
|
||
OpenGL texture format ``GL_RGBA16`` where there are four components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGBAF<class_Image_constant_FORMAT_RGBAF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_R16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R16I** = ``43``
|
||
|
||
OpenGL texture format ``GL_R16UI`` where there's one component, a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RG16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG16I** = ``44``
|
||
|
||
OpenGL texture format ``GL_RG16UI`` where there are two components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB16I** = ``45``
|
||
|
||
OpenGL texture format ``GL_RGB16UI`` where there are three components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA16I** = ``46``
|
||
|
||
OpenGL texture format ``GL_RGBA16UI`` where there are four components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_MAX** = ``47``
|
||
|
||
Representa el tamaño del enum :ref:`Format<enum_Image_Format>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_Interpolation:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Interpolation**: :ref:`🔗<enum_Image_Interpolation>`
|
||
|
||
.. _class_Image_constant_INTERPOLATE_NEAREST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_NEAREST** = ``0``
|
||
|
||
Realiza la interpolación del vecino más cercano. Si se cambia el tamaño de la imagen, será pixelada.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_BILINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_BILINEAR** = ``1``
|
||
|
||
Realiza una interpolación bilineal. Si se cambia el tamaño de la imagen, será borrosa. Este modo es más rápido que :ref:`INTERPOLATE_CUBIC<class_Image_constant_INTERPOLATE_CUBIC>`, pero da como resultado una menor calidad.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_CUBIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_CUBIC** = ``2``
|
||
|
||
Realiza una interpolación cúbica. Si se cambia el tamaño de la imagen, será borrosa. Este modo a menudo da mejores resultados en comparación con :ref:`INTERPOLATE_BILINEAR<class_Image_constant_INTERPOLATE_BILINEAR>`, a costa de ser más lento.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_TRILINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_TRILINEAR** = ``3``
|
||
|
||
Performs bilinear separately on the two most-suited mipmap levels, then linearly interpolates between them.
|
||
|
||
It's slower than :ref:`INTERPOLATE_BILINEAR<class_Image_constant_INTERPOLATE_BILINEAR>`, but produces higher-quality results with far fewer aliasing artifacts.
|
||
|
||
If the image does not have mipmaps, they will be generated and used internally, but no mipmaps will be generated on the resulting image.
|
||
|
||
\ **Note:** If you intend to scale multiple copies of the original image, it's better to call :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`] on it in advance, to avoid wasting processing power in generating them again and again.
|
||
|
||
On the other hand, if the image already has mipmaps, they will be used, and a new set will be generated for the resulting image.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_LANCZOS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_LANCZOS** = ``4``
|
||
|
||
Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscaling images.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_AlphaMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **AlphaMode**: :ref:`🔗<enum_Image_AlphaMode>`
|
||
|
||
.. _class_Image_constant_ALPHA_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_NONE** = ``0``
|
||
|
||
Image is fully opaque. It does not store alpha data.
|
||
|
||
.. _class_Image_constant_ALPHA_BIT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_BIT** = ``1``
|
||
|
||
Image stores either fully opaque or fully transparent pixels. Also known as punchthrough alpha.
|
||
|
||
.. _class_Image_constant_ALPHA_BLEND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_BLEND** = ``2``
|
||
|
||
Image stores alpha data with values varying between ``0.0`` and ``1.0``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_CompressMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **CompressMode**: :ref:`🔗<enum_Image_CompressMode>`
|
||
|
||
.. _class_Image_constant_COMPRESS_S3TC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_S3TC** = ``0``
|
||
|
||
Use la compresión S3TC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ETC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ETC** = ``1``
|
||
|
||
Use la compresión ETC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ETC2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ETC2** = ``2``
|
||
|
||
Use la compresión ETC2.
|
||
|
||
.. _class_Image_constant_COMPRESS_BPTC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_BPTC** = ``3``
|
||
|
||
Usa la compresión BPTC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ASTC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ASTC** = ``4``
|
||
|
||
Usa la compresión ASTC.
|
||
|
||
.. _class_Image_constant_COMPRESS_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_MAX** = ``5``
|
||
|
||
Representa el tamaño del enum :ref:`CompressMode<enum_Image_CompressMode>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_UsedChannels:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **UsedChannels**: :ref:`🔗<enum_Image_UsedChannels>`
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_L:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_L** = ``0``
|
||
|
||
La imagen solo usa un canal para la luminancia (escala de grises).
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_LA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_LA** = ``1``
|
||
|
||
La imagen usa dos canales para la luminancia y el alfa, respectivamente.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_R:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_R** = ``2``
|
||
|
||
La imagen solo usa el canal rojo.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RG** = ``3``
|
||
|
||
La imagen usa dos canales para rojo y verde.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RGB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RGB** = ``4``
|
||
|
||
La imagen usa tres canales para rojo, verde y azul.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RGBA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RGBA** = ``5``
|
||
|
||
La imagen usa cuatro canales para rojo, verde, azul y alfa.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_CompressSource:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **CompressSource**: :ref:`🔗<enum_Image_CompressSource>`
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_GENERIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_GENERIC** = ``0``
|
||
|
||
La textura de la fuente (antes de la compresión) es una textura regular. Por defecto para todas las texturas.
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_SRGB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_SRGB** = ``1``
|
||
|
||
Source texture (before compression) uses nonlinear sRGB encoding.
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_NORMAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_NORMAL** = ``2``
|
||
|
||
La textura de la fuente (antes de la compresión) es una textura normal (por ejemplo, puede ser comprimida en dos canales).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_ASTCFormat:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ASTCFormat**: :ref:`🔗<enum_Image_ASTCFormat>`
|
||
|
||
.. _class_Image_constant_ASTC_FORMAT_4x4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ASTCFormat<enum_Image_ASTCFormat>` **ASTC_FORMAT_4x4** = ``0``
|
||
|
||
Pista para indicar que se debe utilizar el formato de compresión ASTC 4×4 de alta calidad.
|
||
|
||
.. _class_Image_constant_ASTC_FORMAT_8x8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ASTCFormat<enum_Image_ASTCFormat>` **ASTC_FORMAT_8x8** = ``1``
|
||
|
||
Pista para indicar que se debe utilizar el formato de compresión ASTC 8×8 de baja calidad.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Constantes
|
||
--------------------
|
||
|
||
.. _class_Image_constant_MAX_WIDTH:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**MAX_WIDTH** = ``16777216`` :ref:`🔗<class_Image_constant_MAX_WIDTH>`
|
||
|
||
El ancho máximo permitido para los recursos **Image**.
|
||
|
||
.. _class_Image_constant_MAX_HEIGHT:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**MAX_HEIGHT** = ``16777216`` :ref:`🔗<class_Image_constant_MAX_HEIGHT>`
|
||
|
||
La altura máxima permitida para los recursos **Image**.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Descripciones de Propiedades
|
||
--------------------------------------------------------
|
||
|
||
.. _class_Image_property_data:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **data** = ``{ "data": PackedByteArray(), "format": "Lum8", "height": 0, "mipmaps": false, "width": 0 }`` :ref:`🔗<class_Image_property_data>`
|
||
|
||
Contiene todos los datos de color de la imagen en un formato dado. Véase las constantes de :ref:`Format<enum_Image_Format>`.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Descripciones de Métodos
|
||
------------------------------------------------
|
||
|
||
.. _class_Image_method_adjust_bcs:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **adjust_bcs**\ (\ brightness\: :ref:`float<class_float>`, contrast\: :ref:`float<class_float>`, saturation\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Image_method_adjust_bcs>`
|
||
|
||
Ajusta el ``brightness`` (brillo), ``contrast`` (contraste) y la ``saturation`` (saturación) de esta imagen por los valores dados. No funciona si la imagen está comprimida (véase :ref:`is_compressed()<class_Image_method_is_compressed>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blend_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blend_rect**\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blend_rect>`
|
||
|
||
Mezcla el alfa ``src_rect`` de la imagen ``src`` a esta imagen en las coordenadas ``dst``, recortada de acuerdo con los límites de ambas imágenes. Esta imagen y la imagen ``src`` **deben** tener el mismo formato. ``src_rect`` con tamaño no positivo se trata como vacío.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blend_rect_mask:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blend_rect_mask**\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blend_rect_mask>`
|
||
|
||
Alpha-blends ``src_rect`` from ``src`` image to this image using ``mask`` image at coordinates ``dst``, clipped accordingly to both image bounds. Alpha channels are required for both ``src`` and ``mask``. ``dst`` pixels and ``src`` pixels will blend if the corresponding mask pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with non-positive size is treated as empty.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blit_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blit_rect**\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blit_rect>`
|
||
|
||
Copies ``src_rect`` from ``src`` image to this image at coordinates ``dst``, clipped accordingly to both image bounds. This image and ``src`` image **must** have the same format. ``src_rect`` with non-positive size is treated as empty.
|
||
|
||
\ **Note:** The alpha channel data in ``src`` will overwrite the corresponding data in this image at the target position. To blend alpha channels, use :ref:`blend_rect()<class_Image_method_blend_rect>` instead.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blit_rect_mask:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blit_rect_mask**\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blit_rect_mask>`
|
||
|
||
Blits ``src_rect`` area from ``src`` image to this image at the coordinates given by ``dst``, clipped accordingly to both image bounds. ``src`` pixel is copied onto ``dst`` if the corresponding ``mask`` pixel's alpha value is not 0. This image and ``src`` image **must** have the same format. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. ``src_rect`` with non-positive size is treated as empty.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_bump_map_to_normal_map:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **bump_map_to_normal_map**\ (\ bump_scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_bump_map_to_normal_map>`
|
||
|
||
Converts a bump map to a normal map. A bump map provides a height offset per-pixel, while a normal map provides a normal direction per pixel.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_clear_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_mipmaps**\ (\ ) :ref:`🔗<class_Image_method_clear_mipmaps>`
|
||
|
||
Elimina los mipmaps de la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compress:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **compress**\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) :ref:`🔗<class_Image_method_compress>`
|
||
|
||
Compresses the image with a VRAM-compressed format to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available.
|
||
|
||
The ``source`` parameter helps to pick the best compression method for DXT and ETC2 formats. It is ignored for ASTC compression.
|
||
|
||
The ``astc_format`` parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
|
||
|
||
\ **Note:** :ref:`compress()<class_Image_method_compress>` is only supported in editor builds. When run in an exported project, this method always returns :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compress_from_channels:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **compress_from_channels**\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, channels\: :ref:`UsedChannels<enum_Image_UsedChannels>`, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) :ref:`🔗<class_Image_method_compress_from_channels>`
|
||
|
||
Compresses the image with a VRAM-compressed format to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available.
|
||
|
||
This is an alternative to :ref:`compress()<class_Image_method_compress>` that lets the user supply the channels used in order for the compressor to pick the best DXT and ETC2 formats. For other formats (non DXT or ETC2), this argument is ignored.
|
||
|
||
The ``astc_format`` parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
|
||
|
||
\ **Note:** :ref:`compress_from_channels()<class_Image_method_compress_from_channels>` is only supported in editor builds. When run in an exported project, this method always returns :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compute_image_metrics:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **compute_image_metrics**\ (\ compared_image\: :ref:`Image<class_Image>`, use_luma\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Image_method_compute_image_metrics>`
|
||
|
||
Compute image metrics on the current image and the compared image. This can be used to calculate the similarity between two images.
|
||
|
||
The dictionary contains ``max``, ``mean``, ``mean_squared``, ``root_mean_squared`` and ``peak_snr``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_convert:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **convert**\ (\ format\: :ref:`Format<enum_Image_Format>`\ ) :ref:`🔗<class_Image_method_convert>`
|
||
|
||
Convierte el formato de esta imagen al ``format`` dado.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_copy_from:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **copy_from**\ (\ src\: :ref:`Image<class_Image>`\ ) :ref:`🔗<class_Image_method_copy_from>`
|
||
|
||
Copia la imagen ``src`` a esta imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| :ref:`🔗<class_Image_method_create>`
|
||
|
||
**Obsoleto:** Use :ref:`create_empty()<class_Image_method_create_empty>`.
|
||
|
||
Creates an empty image of the given size and format. If ``use_mipmaps`` is ``true``, generates mipmaps for this image (see :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create_empty:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create_empty**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| :ref:`🔗<class_Image_method_create_empty>`
|
||
|
||
Creates an empty image of the given size and format. If ``use_mipmaps`` is ``true``, generates mipmaps for this image (see :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create_from_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create_from_data**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| :ref:`🔗<class_Image_method_create_from_data>`
|
||
|
||
Creates a new image of the given size and format. Fills the image with the given raw data. If ``use_mipmaps`` is ``true``, loads the mipmaps for this image from ``data``. See :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_crop:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **crop**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Image_method_crop>`
|
||
|
||
Recorta la imagen al ``width`` y ``height`` dados. Si el tamaño especificado es mayor que el actual, el área extra se rellena con píxeles negros.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_decompress:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **decompress**\ (\ ) :ref:`🔗<class_Image_method_decompress>`
|
||
|
||
Decompresses the image if it is VRAM-compressed in a supported format. This increases memory utilization, but allows modifying the image. Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` if the format is supported, otherwise :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`. All VRAM-compressed formats supported by Godot can be decompressed with this method, except :ref:`FORMAT_ETC2_R11S<class_Image_constant_FORMAT_ETC2_R11S>`, :ref:`FORMAT_ETC2_RG11S<class_Image_constant_FORMAT_ETC2_RG11S>`, and :ref:`FORMAT_ETC2_RGB8A1<class_Image_constant_FORMAT_ETC2_RGB8A1>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_detect_alpha:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **detect_alpha**\ (\ ) |const| :ref:`🔗<class_Image_method_detect_alpha>`
|
||
|
||
Devuelve :ref:`ALPHA_BLEND<class_Image_constant_ALPHA_BLEND>` si la imagen tiene datos para valores alfa. Devuelve :ref:`ALPHA_BIT<class_Image_constant_ALPHA_BIT>` si todos los valores alfa están almacenados en un solo bit. Devuelve :ref:`ALPHA_NONE<class_Image_constant_ALPHA_NONE>` si no se encuentran datos para valores alfa.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_detect_used_channels:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **detect_used_channels**\ (\ source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0\ ) |const| :ref:`🔗<class_Image_method_detect_used_channels>`
|
||
|
||
Returns the color channels used by this image. If the image is compressed, the original ``source`` must be specified.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fill:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fill**\ (\ color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_fill>`
|
||
|
||
Rellena la imagen con ``color``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fill_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fill_rect**\ (\ rect\: :ref:`Rect2i<class_Rect2i>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_fill_rect>`
|
||
|
||
Rellena ``rect`` con ``color``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fix_alpha_edges:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fix_alpha_edges**\ (\ ) :ref:`🔗<class_Image_method_fix_alpha_edges>`
|
||
|
||
Mezcla píxeles con el nivel alfa bajo con píxeles cercanos.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_flip_x:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **flip_x**\ (\ ) :ref:`🔗<class_Image_method_flip_x>`
|
||
|
||
Voltea la imagen horizontalmente.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_flip_y:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **flip_y**\ (\ ) :ref:`🔗<class_Image_method_flip_y>`
|
||
|
||
Voltea la imagen verticalmente.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_generate_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **generate_mipmaps**\ (\ renormalize\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Image_method_generate_mipmaps>`
|
||
|
||
Genera mipmaps para la imagen. Los mipmaps son copias precalculadas de menor resolución de la imagen que se utilizan automáticamente si la imagen necesita ser reducida cuando se renderiza. Esto ayuda a mejorar la calidad de la imagen y el rendimiento al renderizar. Este método devuelve un error si la imagen está comprimida, en un formato personalizado o si el ancho/alto de la imagen es ``0``. Habilitar ``renormalize`` al generar mipmaps para texturas de mapas normales asegurará que todos los valores vectoriales resultantes estén normalizados.
|
||
|
||
Es posible verificar si la imagen tiene mipmaps llamando a :ref:`has_mipmaps()<class_Image_method_has_mipmaps>` o :ref:`get_mipmap_count()<class_Image_method_get_mipmap_count>`. Llamar a :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>` en una imagen que ya tiene mipmaps reemplazará los mipmaps existentes en la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **get_data**\ (\ ) |const| :ref:`🔗<class_Image_method_get_data>`
|
||
|
||
Devuelve una copia de los datos sin procesar de la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_data_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_data_size**\ (\ ) |const| :ref:`🔗<class_Image_method_get_data_size>`
|
||
|
||
Devuelve el tamaño (en bytes) de los datos sin procesar de la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_format:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Format<enum_Image_Format>` **get_format**\ (\ ) |const| :ref:`🔗<class_Image_method_get_format>`
|
||
|
||
Devuelve el formato de esta imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_height:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_height**\ (\ ) |const| :ref:`🔗<class_Image_method_get_height>`
|
||
|
||
Devuelve la altura de la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_mipmap_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_mipmap_count**\ (\ ) |const| :ref:`🔗<class_Image_method_get_mipmap_count>`
|
||
|
||
Devuelve el número de niveles de mipmap o 0 si la imagen no tiene mipmaps. La imagen principal más grande no se cuenta como un nivel de mipmap en este método, por lo que, si quieres incluirla, puedes añadir 1 a este conteo.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_mipmap_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_mipmap_offset**\ (\ mipmap\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Image_method_get_mipmap_offset>`
|
||
|
||
Devuelve el desplazamiento donde el mipmap de la imagen con el índice ``mipmap`` se almacena en el diccionario :ref:`data<class_Image_property_data>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_pixel:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_pixel**\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Image_method_get_pixel>`
|
||
|
||
Devuelve el color del píxel en ``(x, y)``.
|
||
|
||
Esto es lo mismo que :ref:`get_pixelv()<class_Image_method_get_pixelv>`, pero con dos argumentos enteros en lugar de un argumento :ref:`Vector2i<class_Vector2i>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_pixelv:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_pixelv**\ (\ point\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_Image_method_get_pixelv>`
|
||
|
||
Devuelve el color del píxel en ``point``.
|
||
|
||
Es lo mismo que :ref:`get_pixel()<class_Image_method_get_pixel>`, pero con un argumento :ref:`Vector2i<class_Vector2i>` en lugar de dos argumentos enteros.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_region:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **get_region**\ (\ region\: :ref:`Rect2i<class_Rect2i>`\ ) |const| :ref:`🔗<class_Image_method_get_region>`
|
||
|
||
Devuelve una nueva **Image** que es una copia del área de esta **Image** especificada con ``region``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **get_size**\ (\ ) |const| :ref:`🔗<class_Image_method_get_size>`
|
||
|
||
Devuelve el tamaño de la imagen (anchura y altura).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_used_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Rect2i<class_Rect2i>` **get_used_rect**\ (\ ) |const| :ref:`🔗<class_Image_method_get_used_rect>`
|
||
|
||
Devuelve un :ref:`Rect2i<class_Rect2i>` que encierra la porción visible de la imagen, considerando cada píxel con un canal alfa no nulo como visible.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_width**\ (\ ) |const| :ref:`🔗<class_Image_method_get_width>`
|
||
|
||
Devuelve el ancho de la imagen.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_has_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_mipmaps**\ (\ ) |const| :ref:`🔗<class_Image_method_has_mipmaps>`
|
||
|
||
Devuelve ``true`` si la imagen ha generado mipmaps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_compressed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_compressed**\ (\ ) |const| :ref:`🔗<class_Image_method_is_compressed>`
|
||
|
||
Devuelve ``true`` si la imagen está comprimida.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_empty:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_empty**\ (\ ) |const| :ref:`🔗<class_Image_method_is_empty>`
|
||
|
||
Devuelve ``true`` si la imagen no tiene datos.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_invisible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_invisible**\ (\ ) |const| :ref:`🔗<class_Image_method_is_invisible>`
|
||
|
||
Devuelve ``true`` si todos los píxeles de la imagen tienen un valor alfa de 0. Devuelve ``false`` si algún píxel tiene un valor alfa superior a 0.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_linear_to_srgb:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **linear_to_srgb**\ (\ ) :ref:`🔗<class_Image_method_linear_to_srgb>`
|
||
|
||
Converts the entire image from linear encoding to nonlinear sRGB encoding by using a lookup table. Only works on images with :ref:`FORMAT_RGB8<class_Image_constant_FORMAT_RGB8>` or :ref:`FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` formats.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Image_method_load>`
|
||
|
||
Loads an image from file ``path``. See `Supported image formats <../tutorials/assets_pipeline/importing_images.html#supported-image-formats>`__ for a list of supported image formats and limitations.
|
||
|
||
\ **Warning:** This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the ``user://`` directory, and may not work in exported projects.
|
||
|
||
See also :ref:`ImageTexture<class_ImageTexture>` description for usage examples.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_bmp_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_bmp_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_bmp_from_buffer>`
|
||
|
||
Loads an image from the binary contents of a BMP file.
|
||
|
||
\ **Note:** Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported.
|
||
|
||
\ **Note:** This method is only available in engine builds with the BMP module enabled. By default, the BMP module is enabled, but it can be disabled at build-time using the ``module_bmp_enabled=no`` SCons option.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_dds_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_dds_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_dds_from_buffer>`
|
||
|
||
Carga una imagen desde el contenido binario de un archivo DDS.
|
||
|
||
\ **Nota:** Este método solo está disponible en las compilaciones del motor con el módulo DDS habilitado. Por defecto, el módulo DDS está habilitado, pero se puede deshabilitar en tiempo de compilación utilizando la opción SCons ``module_dds_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_exr_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_exr_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_exr_from_buffer>`
|
||
|
||
Loads an image from the binary contents of an OpenEXR file.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_from_file:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **load_from_file**\ (\ path\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_Image_method_load_from_file>`
|
||
|
||
Creates a new **Image** and loads data from the specified file.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_jpg_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_jpg_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_jpg_from_buffer>`
|
||
|
||
Carga una imagen del contenido binario de un archivo JPEG.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_ktx_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_ktx_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_ktx_from_buffer>`
|
||
|
||
Carga una imagen desde el contenido binario de un archivo `KTX <https://github.com/KhronosGroup/KTX-Software>`__. A diferencia de la mayoría de los formatos de imagen, KTX puede almacenar datos comprimidos en la VRAM e incrustar mipmaps.
|
||
|
||
\ **Nota:** La implementación de libktx de Godot solo admite imágenes 2D. No se admiten mapas de entorno (cubemaps), arrays de texturas ni des-padding.
|
||
|
||
\ **Nota:** Este método solo está disponible en compilaciones del motor con el módulo KTX habilitado. De forma predeterminada, el módulo KTX está habilitado, pero se puede deshabilitar en tiempo de compilación utilizando la opción SCons ``module_ktx_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_png_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_png_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_png_from_buffer>`
|
||
|
||
Carga una imagen del contenido binario de un archivo PNG.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_svg_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_svg_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`, scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_load_svg_from_buffer>`
|
||
|
||
Carga una imagen desde el contenido binario UTF-8 de un archivo SVG **sin comprimir** (**.svg**).
|
||
|
||
\ **Nota:** Ten cuidado al usar archivos SVG comprimidos (como **.svgz**), deben ser ``descomprimidos`` antes de cargarlos.
|
||
|
||
\ **Nota:** Este método solo está disponible en compilaciones del motor con el módulo SVG habilitado. De forma predeterminada, el módulo SVG está habilitado, pero se puede deshabilitar en tiempo de compilación utilizando la opción SCons ``module_svg_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_svg_from_string:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_svg_from_string**\ (\ svg_str\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_load_svg_from_string>`
|
||
|
||
Carga una imagen desde el contenido de texto de un archivo SVG (**.svg**).
|
||
|
||
\ **Nota:** Este método solo está disponible en compilaciones del motor con el módulo SVG habilitado. De forma predeterminada, el módulo SVG está habilitado, pero se puede deshabilitar en tiempo de compilación utilizando la opción SCons ``module_svg_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_tga_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_tga_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_tga_from_buffer>`
|
||
|
||
Carga una imagen desde el contenido binario de un archivo TGA.
|
||
|
||
\ **Nota:** Este método solo está disponible en compilaciones del motor con el módulo TGA habilitado. De forma predeterminada, el módulo TGA está habilitado, pero se puede deshabilitar en tiempo de compilación utilizando la opción SCons ``module_tga_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_webp_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_webp_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_webp_from_buffer>`
|
||
|
||
Carga una imagen del contenido binario de un archivo WebP.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_normal_map_to_xy:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **normal_map_to_xy**\ (\ ) :ref:`🔗<class_Image_method_normal_map_to_xy>`
|
||
|
||
Convierte los datos de la imagen para representar coordenadas en un plano 3D. Esto se utiliza cuando la imagen representa un mapa de normales. Un mapa de normales puede agregar muchos detalles a una superficie 3D sin aumentar el conteo de polígonos.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_premultiply_alpha:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **premultiply_alpha**\ (\ ) :ref:`🔗<class_Image_method_premultiply_alpha>`
|
||
|
||
Multiplica los valores de color por los valores alfa. Los valores de color resultantes para un píxel son ``(color * alpha)/256``. Véase también :ref:`CanvasItemMaterial.blend_mode<class_CanvasItemMaterial_property_blend_mode>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_resize:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **resize**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) :ref:`🔗<class_Image_method_resize>`
|
||
|
||
Redimensiona la imagen al ``width`` y ``height`` dados. Los nuevos píxeles se calculan utilizando el modo de ``interpolation`` definido a través de las constantes de :ref:`Interpolation<enum_Image_Interpolation>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_resize_to_po2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **resize_to_po2**\ (\ square\: :ref:`bool<class_bool>` = false, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) :ref:`🔗<class_Image_method_resize_to_po2>`
|
||
|
||
Redimensiona la imagen a la potencia de 2 más cercana para el ancho y la altura. Si ``square`` es ``true``, establece el ancho y la altura al mismo valor. Los nuevos píxeles se calculan utilizando el modo de ``interpolation`` definido a través de las constantes de :ref:`Interpolation<enum_Image_Interpolation>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rgbe_to_srgb:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **rgbe_to_srgb**\ (\ ) :ref:`🔗<class_Image_method_rgbe_to_srgb>`
|
||
|
||
Converts a standard linear RGBE (Red Green Blue Exponent) image to an image that uses nonlinear sRGB encoding.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rotate_90:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rotate_90**\ (\ direction\: :ref:`ClockDirection<enum_@GlobalScope_ClockDirection>`\ ) :ref:`🔗<class_Image_method_rotate_90>`
|
||
|
||
Rota la imagen en la ``direction`` especificada en ``90`` grados. El ancho y el alto de la imagen deben ser mayores que ``1``. Si el ancho y el alto no son iguales, la imagen se redimensionará.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rotate_180:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rotate_180**\ (\ ) :ref:`🔗<class_Image_method_rotate_180>`
|
||
|
||
Rota la imagen en ``180`` grados. El ancho y el alto de la imagen deben ser mayores que ``1``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_dds:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_dds**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Image_method_save_dds>`
|
||
|
||
Guarda la imagen como un archivo DDS (DirectDraw Surface) en ``path``. DDS es un formato contenedor que puede almacenar texturas en varios formatos de compresión, como DXT1, DXT5 o BC7. Esta función devolverá :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>` si Godot se compiló sin el módulo DDS.
|
||
|
||
\ **Nota:** El módulo DDS puede estar deshabilitado en ciertas compilaciones, lo que significa que :ref:`save_dds()<class_Image_method_save_dds>` devolverá :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>` cuando se le llame desde un proyecto exportado.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_dds_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_dds_to_buffer**\ (\ ) |const| :ref:`🔗<class_Image_method_save_dds_to_buffer>`
|
||
|
||
Guarda la imagen como un archivo DDS (DirectDraw Surface) en un array de bytes. DDS es un formato contenedor que puede almacenar texturas en varios formatos de compresión, como DXT1, DXT5 o BC7. Esta función devolverá un array de bytes vacío si Godot se compiló sin el módulo DDS.
|
||
|
||
\ **Nota:** El módulo DDS puede estar deshabilitado en ciertas compilaciones, lo que significa que :ref:`save_dds_to_buffer()<class_Image_method_save_dds_to_buffer>` devolverá un array de bytes vacío cuando se le llame desde un proyecto exportado.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_exr:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_exr**\ (\ path\: :ref:`String<class_String>`, grayscale\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Image_method_save_exr>`
|
||
|
||
Saves the image as an EXR file to ``path``. If ``grayscale`` is ``true`` and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>` if Godot was compiled without the TinyEXR module.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_exr_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_exr_to_buffer**\ (\ grayscale\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Image_method_save_exr_to_buffer>`
|
||
|
||
Saves the image as an EXR file to a byte array. If ``grayscale`` is ``true`` and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return an empty byte array if Godot was compiled without the TinyEXR module.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_jpg:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_jpg**\ (\ path\: :ref:`String<class_String>`, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_jpg>`
|
||
|
||
Guarda la imagen como un archivo JPEG en ``path`` con el ``quality`` especificado entre ``0.01`` y ``1.0`` (inclusive). Los valores más altos de ``quality`` dan como resultado una salida de mejor aspecto a costa de tamaños de archivo más grandes. Los valores recomendados de ``quality`` están entre ``0.75`` y ``0.90``. Incluso con calidad ``1.00``, la compresión JPEG sigue teniendo pérdida.
|
||
|
||
\ **Nota:** JPEG no guarda un canal alfa. Si la **Image** contiene un canal alfa, la imagen se guardará de todos modos, pero el archivo JPEG resultante no contendrá el canal alfa.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_jpg_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_jpg_to_buffer**\ (\ quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_jpg_to_buffer>`
|
||
|
||
Guarda la imagen como un archivo JPEG en un array de bytes con la ``quality`` especificada entre ``0.01`` y ``1.0`` (inclusive). Los valores más altos de ``quality`` dan como resultado una salida de mejor aspecto a costa de tamaños de array de bytes más grandes (y, por lo tanto, un mayor uso de memoria). Los valores recomendados de ``quality`` están entre ``0.75`` y ``0.90``. Incluso con calidad ``1.00``, la compresión JPEG sigue teniendo pérdida.
|
||
|
||
\ **Nota:** JPEG no guarda un canal alfa. Si la **Image** contiene un canal alfa, la imagen se guardará de todos modos, pero el array de bytes resultante no contendrá el canal alfa.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_png:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_png**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Image_method_save_png>`
|
||
|
||
Guarda la imagen como un archivo PNG en el archivo en ``path``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_png_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_png_to_buffer**\ (\ ) |const| :ref:`🔗<class_Image_method_save_png_to_buffer>`
|
||
|
||
Guarda la imagen como un archivo PNG en un array de bytes.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_webp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_webp**\ (\ path\: :ref:`String<class_String>`, lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_webp>`
|
||
|
||
Guarda la imagen como un archivo WebP (Web Picture) en el archivo en ``path``. Por defecto, se guardará sin pérdida. Si ``lossy`` es ``true``, la imagen se guardará con pérdida, utilizando el ajuste ``quality`` entre ``0.0`` y ``1.0`` (inclusive). WebP sin pérdida ofrece una compresión más eficiente que PNG.
|
||
|
||
\ **Nota:** El formato WebP está limitado a un tamaño de 16383×16383 píxeles, mientras que PNG puede guardar imágenes más grandes.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_webp_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_webp_to_buffer**\ (\ lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_webp_to_buffer>`
|
||
|
||
Guarda la imagen como un archivo WebP (Web Picture) en un array de bytes. De forma predeterminada, se guardará sin pérdida. Si ``lossy`` es ``true``, la imagen se guardará con pérdida, utilizando el ajuste ``quality`` entre ``0.0`` y ``1.0`` (inclusive). WebP sin pérdida ofrece una compresión más eficiente que PNG.
|
||
|
||
\ **Nota:** El formato WebP está limitado a un tamaño de 16383×16383 píxeles, mientras que PNG puede guardar imágenes más grandes.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_data**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_set_data>`
|
||
|
||
Sobrescribe los datos de una **Image** existente. Equivalente no estático de :ref:`create_from_data()<class_Image_method_create_from_data>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_pixel:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_pixel**\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_set_pixel>`
|
||
|
||
Sets the :ref:`Color<class_Color>` of the pixel at ``(x, y)`` to ``color``.
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var img_width = 10
|
||
var img_height = 5
|
||
var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8)
|
||
|
||
img.set_pixel(1, 2, Color.RED) # Sets the color at (1, 2) to red.
|
||
|
||
.. code-tab:: csharp
|
||
|
||
int imgWidth = 10;
|
||
int imgHeight = 5;
|
||
var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
|
||
|
||
img.SetPixel(1, 2, Colors.Red); // Sets the color at (1, 2) to red.
|
||
|
||
|
||
|
||
This is the same as :ref:`set_pixelv()<class_Image_method_set_pixelv>`, but with a two integer arguments instead of a :ref:`Vector2i<class_Vector2i>` argument.
|
||
|
||
\ **Note:** Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by :ref:`get_pixel()<class_Image_method_get_pixel>` to be identical to the one set here; any comparisons will likely need to use an approximation like :ref:`Color.is_equal_approx()<class_Color_method_is_equal_approx>`.
|
||
|
||
\ **Note:** On grayscale image formats, only the red channel of ``color`` is used (and alpha if relevant). The green and blue channels are ignored.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_pixelv:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_pixelv**\ (\ point\: :ref:`Vector2i<class_Vector2i>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_set_pixelv>`
|
||
|
||
Sets the :ref:`Color<class_Color>` of the pixel at ``point`` to ``color``.
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var img_width = 10
|
||
var img_height = 5
|
||
var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8)
|
||
|
||
img.set_pixelv(Vector2i(1, 2), Color.RED) # Sets the color at (1, 2) to red.
|
||
|
||
.. code-tab:: csharp
|
||
|
||
int imgWidth = 10;
|
||
int imgHeight = 5;
|
||
var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
|
||
|
||
img.SetPixelv(new Vector2I(1, 2), Colors.Red); // Sets the color at (1, 2) to red.
|
||
|
||
|
||
|
||
This is the same as :ref:`set_pixel()<class_Image_method_set_pixel>`, but with a :ref:`Vector2i<class_Vector2i>` argument instead of two integer arguments.
|
||
|
||
\ **Note:** Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by :ref:`get_pixelv()<class_Image_method_get_pixelv>` to be identical to the one set here; any comparisons will likely need to use an approximation like :ref:`Color.is_equal_approx()<class_Color_method_is_equal_approx>`.
|
||
|
||
\ **Note:** On grayscale image formats, only the red channel of ``color`` is used (and alpha if relevant). The green and blue channels are ignored.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_shrink_x2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **shrink_x2**\ (\ ) :ref:`🔗<class_Image_method_shrink_x2>`
|
||
|
||
Reduce la imagen por un factor de 2 en cada eje (esto divide el número de píxeles por 4).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_srgb_to_linear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **srgb_to_linear**\ (\ ) :ref:`🔗<class_Image_method_srgb_to_linear>`
|
||
|
||
Converts the raw data from nonlinear sRGB encoding to linear encoding using a lookup table. Only works on images with :ref:`FORMAT_RGB8<class_Image_constant_FORMAT_RGB8>` or :ref:`FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` formats.
|
||
|
||
\ **Note:** The 8-bit formats required by this method are not suitable for storing linearly encoded values; a significant amount of color information will be lost in darker values. To maintain image quality, this method should not be used.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
||
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
||
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
||
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|