1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Image" inherits="Resource" version="4.0">
<brief_description>
Image datatype.
</brief_description>
<description>
Native image datatype. Contains image data, which can be converted to a [Texture2D], and several functions to interact with it. The maximum width and height for an [Image] are [constant MAX_WIDTH] and [constant MAX_HEIGHT].
</description>
<tutorials>
</tutorials>
<methods>
<method name="blend_rect">
<return type="void">
</return>
<argument index="0" name="src" type="Image">
</argument>
<argument index="1" name="src_rect" type="Rect2">
</argument>
<argument index="2" name="dst" type="Vector2">
</argument>
<description>
Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dest[/code].
</description>
</method>
<method name="blend_rect_mask">
<return type="void">
</return>
<argument index="0" name="src" type="Image">
</argument>
<argument index="1" name="mask" type="Image">
</argument>
<argument index="2" name="src_rect" type="Rect2">
</argument>
<argument index="3" name="dst" type="Vector2">
</argument>
<description>
Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image using [code]mask[/code] image at coordinates [code]dst[/code]. Alpha channels are required for both [code]src[/code] and [code]mask[/code]. [code]dst[/code] pixels and [code]src[/code] pixels will blend if the corresponding mask pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats.
</description>
</method>
<method name="blit_rect">
<return type="void">
</return>
<argument index="0" name="src" type="Image">
</argument>
<argument index="1" name="src_rect" type="Rect2">
</argument>
<argument index="2" name="dst" type="Vector2">
</argument>
<description>
Copies [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dst[/code].
</description>
</method>
<method name="blit_rect_mask">
<return type="void">
</return>
<argument index="0" name="src" type="Image">
</argument>
<argument index="1" name="mask" type="Image">
</argument>
<argument index="2" name="src_rect" type="Rect2">
</argument>
<argument index="3" name="dst" type="Vector2">
</argument>
<description>
Blits [code]src_rect[/code] area from [code]src[/code] image to this image at the coordinates given by [code]dst[/code]. [code]src[/code] pixel is copied onto [code]dst[/code] if the corresponding [code]mask[/code] pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats.
</description>
</method>
<method name="bumpmap_to_normalmap">
<return type="void">
</return>
<argument index="0" name="bump_scale" type="float" default="1.0">
</argument>
<description>
Converts a bumpmap to a normalmap. A bumpmap provides a height offset per-pixel, while a normalmap provides a normal direction per pixel.
</description>
</method>
<method name="clear_mipmaps">
<return type="void">
</return>
<description>
Removes the image's mipmaps.
</description>
</method>
<method name="compress">
<return type="int" enum="Error">
</return>
<argument index="0" name="mode" type="int" enum="Image.CompressMode">
</argument>
<argument index="1" name="source" type="int" enum="Image.CompressSource" default="0">
</argument>
<argument index="2" name="lossy_quality" type="float" default="0.7">
</argument>
<description>
Compresses the image 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. See [enum CompressMode] and [enum CompressSource] constants.
</description>
</method>
<method name="compress_from_channels">
<return type="int" enum="Error">
</return>
<argument index="0" name="mode" type="int" enum="Image.CompressMode">
</argument>
<argument index="1" name="channels" type="int" enum="Image.UsedChannels">
</argument>
<argument index="2" name="lossy_quality" type="float" default="0.7">
</argument>
<description>
</description>
</method>
<method name="convert">
<return type="void">
</return>
<argument index="0" name="format" type="int" enum="Image.Format">
</argument>
<description>
Converts the image's format. See [enum Format] constants.
</description>
</method>
<method name="copy_from">
<return type="void">
</return>
<argument index="0" name="src" type="Image">
</argument>
<description>
Copies [code]src[/code] image to this image.
</description>
</method>
<method name="create">
<return type="void">
</return>
<argument index="0" name="width" type="int">
</argument>
<argument index="1" name="height" type="int">
</argument>
<argument index="2" name="use_mipmaps" type="bool">
</argument>
<argument index="3" name="format" type="int" enum="Image.Format">
</argument>
<description>
Creates an empty image of given size and format. See [enum Format] constants. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
</description>
</method>
<method name="create_from_data">
<return type="void">
</return>
<argument index="0" name="width" type="int">
</argument>
<argument index="1" name="height" type="int">
</argument>
<argument index="2" name="use_mipmaps" type="bool">
</argument>
<argument index="3" name="format" type="int" enum="Image.Format">
</argument>
<argument index="4" name="data" type="PackedByteArray">
</argument>
<description>
Creates a new image of given size and format. See [enum Format] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is [code]true[/code] then generate mipmaps for this image. See the [method generate_mipmaps].
</description>
</method>
<method name="crop">
<return type="void">
</return>
<argument index="0" name="width" type="int">
</argument>
<argument index="1" name="height" type="int">
</argument>
<description>
Crops the image to the given [code]width[/code] and [code]height[/code]. If the specified size is larger than the current size, the extra area is filled with black pixels.
</description>
</method>
<method name="decompress">
<return type="int" enum="Error">
</return>
<description>
Decompresses the image if it is compressed. Returns an error if decompress function is not available.
</description>
</method>
<method name="detect_alpha" qualifiers="const">
<return type="int" enum="Image.AlphaMode">
</return>
<description>
Returns [constant ALPHA_BLEND] if the image has data for alpha values. Returns [constant ALPHA_BIT] if all the alpha values are stored in a single bit. Returns [constant ALPHA_NONE] if no data for alpha values is found.
</description>
</method>
<method name="detect_used_channels">
<return type="int" enum="Image.UsedChannels">
</return>
<argument index="0" name="source" type="int" enum="Image.CompressSource" default="0">
</argument>
<description>
</description>
</method>
<method name="expand_x2_hq2x">
<return type="void">
</return>
<description>
Stretches the image and enlarges it by a factor of 2. No interpolation is done.
</description>
</method>
<method name="fill">
<return type="void">
</return>
<argument index="0" name="color" type="Color">
</argument>
<description>
Fills the image with a given [Color].
</description>
</method>
<method name="fix_alpha_edges">
<return type="void">
</return>
<description>
Blends low-alpha pixels with nearby pixels.
</description>
</method>
<method name="flip_x">
<return type="void">
</return>
<description>
Flips the image horizontally.
</description>
</method>
<method name="flip_y">
<return type="void">
</return>
<description>
Flips the image vertically.
</description>
</method>
<method name="generate_mipmaps">
<return type="int" enum="Error">
</return>
<argument index="0" name="renormalize" type="bool" default="false">
</argument>
<description>
Generates mipmaps for the image. Mipmaps are pre-calculated and lower resolution copies of the image. Mipmaps are automatically used if the image needs to be scaled down when rendered. This improves image quality and the performance of the rendering. Returns an error if the image is compressed, in a custom format or if the image's width/height is 0.
</description>
</method>
<method name="get_data" qualifiers="const">
<return type="PackedByteArray">
</return>
<description>
Returns the image's raw data.
</description>
</method>
<method name="get_format" qualifiers="const">
<return type="int" enum="Image.Format">
</return>
<description>
Returns the image's format. See [enum Format] constants.
</description>
</method>
<method name="get_height" qualifiers="const">
<return type="int">
</return>
<description>
Returns the image's height.
</description>
</method>
<method name="get_mipmap_offset" qualifiers="const">
<return type="int">
</return>
<argument index="0" name="mipmap" type="int">
</argument>
<description>
Returns the offset where the image's mipmap with index [code]mipmap[/code] is stored in the [code]data[/code] dictionary.
</description>
</method>
<method name="get_pixel" qualifiers="const">
<return type="Color">
</return>
<argument index="0" name="x" type="int">
</argument>
<argument index="1" name="y" type="int">
</argument>
<description>
Returns the color of the pixel at [code](x, y)[/code]. This is the same as [method get_pixelv], but with two integer arguments instead of a [Vector2] argument.
</description>
</method>
<method name="get_pixelv" qualifiers="const">
<return type="Color">
</return>
<argument index="0" name="src" type="Vector2">
</argument>
<description>
Returns the color of the pixel at [code]src[/code]. This is the same as [method get_pixel], but with a [Vector2] argument instead of two integer arguments.
</description>
</method>
<method name="get_rect" qualifiers="const">
<return type="Image">
</return>
<argument index="0" name="rect" type="Rect2">
</argument>
<description>
Returns a new image that is a copy of the image's area specified with [code]rect[/code].
</description>
</method>
<method name="get_size" qualifiers="const">
<return type="Vector2">
</return>
<description>
Returns the image's size (width and height).
</description>
</method>
<method name="get_used_rect" qualifiers="const">
<return type="Rect2">
</return>
<description>
Returns a [Rect2] enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible.
</description>
</method>
<method name="get_width" qualifiers="const">
<return type="int">
</return>
<description>
Returns the image's width.
</description>
</method>
<method name="has_mipmaps" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the image has generated mipmaps.
</description>
</method>
<method name="is_compressed" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the image is compressed.
</description>
</method>
<method name="is_empty" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the image has no data.
</description>
</method>
<method name="is_invisible" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if all the image's pixels have an alpha value of 0. Returns [code]false[/code] if any pixel has an alpha value higher than 0.
</description>
</method>
<method name="load">
<return type="int" enum="Error">
</return>
<argument index="0" name="path" type="String">
</argument>
<description>
Loads an image from file [code]path[/code].
</description>
</method>
<method name="load_jpg_from_buffer">
<return type="int" enum="Error">
</return>
<argument index="0" name="buffer" type="PackedByteArray">
</argument>
<description>
Loads an image from the binary contents of a JPEG file.
</description>
</method>
<method name="load_png_from_buffer">
<return type="int" enum="Error">
</return>
<argument index="0" name="buffer" type="PackedByteArray">
</argument>
<description>
Loads an image from the binary contents of a PNG file.
</description>
</method>
<method name="load_webp_from_buffer">
<return type="int" enum="Error">
</return>
<argument index="0" name="buffer" type="PackedByteArray">
</argument>
<description>
Loads an image from the binary contents of a WebP file.
</description>
</method>
<method name="normalmap_to_xy">
<return type="void">
</return>
<description>
Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normalmap. A normalmap can add lots of detail to a 3D surface without increasing the polygon count.
</description>
</method>
<method name="premultiply_alpha">
<return type="void">
</return>
<description>
Multiplies color values with alpha values. Resulting color values for a pixel are [code](color * alpha)/256[/code].
</description>
</method>
<method name="resize">
<return type="void">
</return>
<argument index="0" name="width" type="int">
</argument>
<argument index="1" name="height" type="int">
</argument>
<argument index="2" name="interpolation" type="int" enum="Image.Interpolation" default="1">
</argument>
<description>
Resizes the image to the given [code]width[/code] and [code]height[/code]. New pixels are calculated using [code]interpolation[/code]. See [code]interpolation[/code] constants.
</description>
</method>
<method name="resize_to_po2">
<return type="void">
</return>
<argument index="0" name="square" type="bool" default="false">
</argument>
<description>
Resizes the image to the nearest power of 2 for the width and height. If [code]square[/code] is [code]true[/code] then set width and height to be the same.
</description>
</method>
<method name="rgbe_to_srgb">
<return type="Image">
</return>
<description>
Converts a standard RGBE (Red Green Blue Exponent) image to an sRGB image.
</description>
</method>
<method name="save_exr" qualifiers="const">
<return type="int" enum="Error">
</return>
<argument index="0" name="path" type="String">
</argument>
<argument index="1" name="grayscale" type="bool" default="false">
</argument>
<description>
Saves the image as an EXR file to [code]path[/code]. If [code]grayscale[/code] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module.
</description>
</method>
<method name="save_png" qualifiers="const">
<return type="int" enum="Error">
</return>
<argument index="0" name="path" type="String">
</argument>
<description>
Saves the image as a PNG file to [code]path[/code].
</description>
</method>
<method name="set_pixel">
<return type="void">
</return>
<argument index="0" name="x" type="int">
</argument>
<argument index="1" name="y" type="int">
</argument>
<argument index="2" name="color" type="Color">
</argument>
<description>
Sets the [Color] of the pixel at [code](x, y)[/code]. Example:
[codeblock]
var img = Image.new()
img.create(img_width, img_height, false, Image.FORMAT_RGBA8)
img.set_pixel(x, y, color)
[/codeblock]
</description>
</method>
<method name="set_pixelv">
<return type="void">
</return>
<argument index="0" name="dst" type="Vector2">
</argument>
<argument index="1" name="color" type="Color">
</argument>
<description>
Sets the [Color] of the pixel at [code](dst.x, dst.y)[/code]. Note that the [code]dst[/code] values must be integers. Example:
[codeblock]
var img = Image.new()
img.create(img_width, img_height, false, Image.FORMAT_RGBA8)
img.set_pixelv(Vector2(x, y), color)
[/codeblock]
</description>
</method>
<method name="shrink_x2">
<return type="void">
</return>
<description>
Shrinks the image by a factor of 2.
</description>
</method>
<method name="srgb_to_linear">
<return type="void">
</return>
<description>
Converts the raw data from the sRGB colorspace to a linear scale.
</description>
</method>
</methods>
<members>
<member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"data": PackedByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}">
Holds all of the image's color data in a given format. See [enum Format] constants.
</member>
</members>
<constants>
<constant name="MAX_WIDTH" value="16777216">
The maximal width allowed for [Image] resources.
</constant>
<constant name="MAX_HEIGHT" value="16777216">
The maximal height allowed for [Image] resources.
</constant>
<constant name="FORMAT_L8" value="0" enum="Format">
Texture format with a single 8-bit depth representing luminance.
</constant>
<constant name="FORMAT_LA8" value="1" enum="Format">
OpenGL texture format with two values, luminance and alpha each stored with 8 bits.
</constant>
<constant name="FORMAT_R8" value="2" enum="Format">
OpenGL texture format [code]RED[/code] with a single component and a bitdepth of 8.
</constant>
<constant name="FORMAT_RG8" value="3" enum="Format">
OpenGL texture format [code]RG[/code] with two components and a bitdepth of 8 for each.
</constant>
<constant name="FORMAT_RGB8" value="4" enum="Format">
OpenGL texture format [code]RGB[/code] with three components, each with a bitdepth of 8.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGBA8" value="5" enum="Format">
OpenGL texture format [code]RGBA[/code] with four components, each with a bitdepth of 8.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGBA4444" value="6" enum="Format">
OpenGL texture format [code]RGBA[/code] with four components, each with a bitdepth of 4.
</constant>
<constant name="FORMAT_RGB565" value="7" enum="Format">
</constant>
<constant name="FORMAT_RF" value="8" enum="Format">
OpenGL texture format [code]GL_R32F[/code] where there's one component, a 32-bit floating-point value.
</constant>
<constant name="FORMAT_RGF" value="9" enum="Format">
OpenGL texture format [code]GL_RG32F[/code] where there are two components, each a 32-bit floating-point values.
</constant>
<constant name="FORMAT_RGBF" value="10" enum="Format">
OpenGL texture format [code]GL_RGB32F[/code] where there are three components, each a 32-bit floating-point values.
</constant>
<constant name="FORMAT_RGBAF" value="11" enum="Format">
OpenGL texture format [code]GL_RGBA32F[/code] where there are four components, each a 32-bit floating-point values.
</constant>
<constant name="FORMAT_RH" value="12" enum="Format">
OpenGL texture format [code]GL_R32F[/code] where there's one component, a 16-bit "half-precision" floating-point value.
</constant>
<constant name="FORMAT_RGH" value="13" enum="Format">
OpenGL texture format [code]GL_RG32F[/code] where there are two components, each a 16-bit "half-precision" floating-point value.
</constant>
<constant name="FORMAT_RGBH" value="14" enum="Format">
OpenGL texture format [code]GL_RGB32F[/code] where there are three components, each a 16-bit "half-precision" floating-point value.
</constant>
<constant name="FORMAT_RGBAH" value="15" enum="Format">
OpenGL texture format [code]GL_RGBA32F[/code] where there are four components, each a 16-bit "half-precision" floating-point value.
</constant>
<constant name="FORMAT_RGBE9995" value="16" enum="Format">
A special OpenGL texture format where the three color components have 9 bits of precision and all three share a single 5-bit exponent.
</constant>
<constant name="FORMAT_DXT1" value="17" enum="Format">
The [url=https://en.wikipedia.org/wiki/S3_Texture_Compression]S3TC[/url] 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.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_DXT3" value="18" enum="Format">
The [url=https://en.wikipedia.org/wiki/S3_Texture_Compression]S3TC[/url] 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.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_DXT5" value="19" enum="Format">
The [url=https://en.wikipedia.org/wiki/S3_Texture_Compression]S3TC[/url] 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.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGTC_R" value="20" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression]Red Green Texture Compression[/url], normalizing the red channel data using the same compression algorithm that DXT5 uses for the alpha channel.
</constant>
<constant name="FORMAT_RGTC_RG" value="21" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression]Red Green Texture Compression[/url], normalizing the red and green channel data using the same compression algorithm that DXT5 uses for the alpha channel.
</constant>
<constant name="FORMAT_BPTC_RGBA" value="22" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression]BPTC[/url] compression with unsigned normalized RGBA components.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_BPTC_RGBF" value="23" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression]BPTC[/url] compression with signed floating-point RGB components.
</constant>
<constant name="FORMAT_BPTC_RGBFU" value="24" enum="Format">
Texture format that uses [url=https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression]BPTC[/url] compression with unsigned floating-point RGB components.
</constant>
<constant name="FORMAT_PVRTC2" value="25" enum="Format">
Texture format used on PowerVR-supported mobile platforms, uses 2-bit color depth with no alpha. More information can be found [url=https://en.wikipedia.org/wiki/PVRTC]here[/url].
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_PVRTC2A" value="26" enum="Format">
Same as [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC2[/url], but with an alpha component.
</constant>
<constant name="FORMAT_PVRTC4" value="27" enum="Format">
Similar to [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC2[/url], but with 4-bit color depth and no alpha.
</constant>
<constant name="FORMAT_PVRTC4A" value="28" enum="Format">
Same as [url=https://en.wikipedia.org/wiki/PVRTC]PVRTC4[/url], but with an alpha component.
</constant>
<constant name="FORMAT_ETC" value="29" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC1]Ericsson Texture Compression format 1[/url], also referred to as "ETC1", and is part of the OpenGL ES graphics standard. This format cannot store an alpha channel.
</constant>
<constant name="FORMAT_ETC2_R11" value="30" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]R11_EAC[/code] variant), which provides one channel of unsigned data.
</constant>
<constant name="FORMAT_ETC2_R11S" value="31" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]SIGNED_R11_EAC[/code] variant), which provides one channel of signed data.
</constant>
<constant name="FORMAT_ETC2_RG11" value="32" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]RG11_EAC[/code] variant), which provides two channels of unsigned data.
</constant>
<constant name="FORMAT_ETC2_RG11S" value="33" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]SIGNED_RG11_EAC[/code] variant), which provides two channels of signed data.
</constant>
<constant name="FORMAT_ETC2_RGB8" value="34" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]RGB8[/code] variant), which is a follow-up of ETC1 and compresses RGB888 data.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_ETC2_RGBA8" value="35" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]RGBA8[/code]variant), which compresses RGBA8888 data with full alpha support.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_ETC2_RGB8A1" value="36" enum="Format">
[url=https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC]Ericsson Texture Compression format 2[/url] ([code]RGB8_PUNCHTHROUGH_ALPHA1[/code] variant), which compresses RGBA data to make alpha either fully transparent or fully opaque.
[b]Note:[/b] When creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_ETC2_RA_AS_RG" value="37" enum="Format">
</constant>
<constant name="FORMAT_DXT5_RA_AS_RG" value="38" enum="Format">
</constant>
<constant name="FORMAT_MAX" value="39" enum="Format">
Represents the size of the [enum Format] enum.
</constant>
<constant name="INTERPOLATE_NEAREST" value="0" enum="Interpolation">
Performs nearest-neighbor interpolation. If the image is resized, it will be pixelated.
</constant>
<constant name="INTERPOLATE_BILINEAR" value="1" enum="Interpolation">
Performs bilinear interpolation. If the image is resized, it will be blurry. This mode is faster than [constant INTERPOLATE_CUBIC], but it results in lower quality.
</constant>
<constant name="INTERPOLATE_CUBIC" value="2" enum="Interpolation">
Performs cubic interpolation. If the image is resized, it will be blurry. This mode often gives better results compared to [constant INTERPOLATE_BILINEAR], at the cost of being slower.
</constant>
<constant name="INTERPOLATE_TRILINEAR" value="3" enum="Interpolation">
Performs bilinear separately on the two most-suited mipmap levels, then linearly interpolates between them.
It's slower than [constant INTERPOLATE_BILINEAR], but produces higher-quality results with much less 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.
[b]Note:[/b] If you intend to scale multiple copies of the original image, it's better to call [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.
</constant>
<constant name="INTERPOLATE_LANCZOS" value="4" enum="Interpolation">
Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscalng images.
</constant>
<constant name="ALPHA_NONE" value="0" enum="AlphaMode">
Image does not have alpha.
</constant>
<constant name="ALPHA_BIT" value="1" enum="AlphaMode">
Image stores alpha in a single bit.
</constant>
<constant name="ALPHA_BLEND" value="2" enum="AlphaMode">
Image uses alpha.
</constant>
<constant name="COMPRESS_S3TC" value="0" enum="CompressMode">
Use S3TC compression.
</constant>
<constant name="COMPRESS_PVRTC2" value="1" enum="CompressMode">
Use PVRTC2 compression.
</constant>
<constant name="COMPRESS_PVRTC4" value="2" enum="CompressMode">
Use PVRTC4 compression.
</constant>
<constant name="COMPRESS_ETC" value="3" enum="CompressMode">
Use ETC compression.
</constant>
<constant name="COMPRESS_ETC2" value="4" enum="CompressMode">
Use ETC2 compression.
</constant>
<constant name="USED_CHANNELS_L" value="0" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_LA" value="1" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_R" value="2" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_RG" value="3" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_RGB" value="4" enum="UsedChannels">
</constant>
<constant name="USED_CHANNELS_RGBA" value="5" enum="UsedChannels">
</constant>
<constant name="COMPRESS_SOURCE_GENERIC" value="0" enum="CompressSource">
Source texture (before compression) is a regular texture. Default for all textures.
</constant>
<constant name="COMPRESS_SOURCE_SRGB" value="1" enum="CompressSource">
Source texture (before compression) is in sRGB space.
</constant>
<constant name="COMPRESS_SOURCE_NORMAL" value="2" enum="CompressSource">
Source texture (before compression) is a normal texture (e.g. it can be compressed into two channels).
</constant>
</constants>
</class>
|