Image(ID)¶
base classes — bpy_struct
, ID
-
class
bpy.types.
Image
(ID)¶ Image datablock referencing an external or packed image
-
alpha_mode
¶ Representation of alpha information in the RGBA pixels
STRAIGHT
Straight, Transparent RGB and alpha pixels are unmodified.PREMUL
Premultiplied, Transparent RGB pixels are multiplied by the alpha channel.
Type: enum in [‘STRAIGHT’, ‘PREMUL’], default ‘STRAIGHT’
-
bindcode
¶ OpenGL bindcode
Type: int in [0, inf], default 0, (readonly)
-
channels
¶ Number of channels in pixels buffer
Type: int in [0, inf], default 0, (readonly)
-
colorspace_settings
¶ Input color space settings
Type: ColorManagedInputColorspaceSettings
, (readonly)
-
depth
¶ Image bit depth
Type: int in [0, inf], default 0, (readonly)
-
display_aspect
¶ Display Aspect for this image, does not affect rendering
Type: float array of 2 items in [0.1, inf], default (0.0, 0.0)
-
field_order
¶ Order of video fields (select which lines are displayed first)
EVEN
Upper First, Upper field first.ODD
Lower First, Lower field first.
Type: enum in [‘EVEN’, ‘ODD’], default ‘EVEN’
-
file_format
¶ Format used for re-saving this file
BMP
BMP, Output image in bitmap format.IRIS
Iris, Output image in (old!) SGI IRIS format.PNG
PNG, Output image in PNG format.JPEG
JPEG, Output image in JPEG format.TARGA
Targa, Output image in Targa format.TARGA_RAW
Targa Raw, Output image in uncompressed Targa format.OPEN_EXR_MULTILAYER
OpenEXR MultiLayer, Output image in multilayer OpenEXR format.OPEN_EXR
OpenEXR, Output image in OpenEXR format.TIFF
TIFF, Output image in TIFF format.AVI_JPEG
AVI JPEG, Output video in AVI JPEG format.AVI_RAW
AVI Raw, Output video in AVI Raw format.
Type: enum in [‘BMP’, ‘IRIS’, ‘PNG’, ‘JPEG’, ‘TARGA’, ‘TARGA_RAW’, ‘OPEN_EXR_MULTILAYER’, ‘OPEN_EXR’, ‘TIFF’, ‘AVI_JPEG’, ‘AVI_RAW’], default ‘TARGA’
-
filepath
¶ Image/Movie file name
Type: string, default “”, (never None)
-
filepath_raw
¶ Image/Movie file name (without data refreshing)
Type: string, default “”, (never None)
-
fps
¶ Speed of the animation in frames per second
Type: int in [1, 100], default 0
-
frame_duration
¶ Duration (in frames) of the image (1 when not a video/sequence)
Type: int in [0, inf], default 0, (readonly)
-
frame_end
¶ End frame of an animated texture
Type: int in [0, 255], default 0
-
frame_start
¶ Start frame of an animated texture
Type: int in [0, 255], default 0
-
generated_color
¶ Fill color for the generated image
Type: float array of 4 items in [0, inf], default (0.0, 0.0, 0.0, 0.0)
-
generated_height
¶ Generated image height
Type: int in [1, 65536], default 0
-
generated_type
¶ Generated image type
BLANK
Blank, Generate a blank image.UV_GRID
UV Grid, Generated grid to test UV mappings.COLOR_GRID
Color Grid, Generated improved UV grid to test UV mappings.
Type: enum in [‘BLANK’, ‘UV_GRID’, ‘COLOR_GRID’], default ‘BLANK’
-
generated_width
¶ Generated image width
Type: int in [1, 65536], default 0
-
has_data
¶ True if this image has data
Type: boolean, default False, (readonly)
-
is_dirty
¶ Image has changed and is not saved
Type: boolean, default False, (readonly)
-
is_float
¶ True if this image is stored in float buffer
Type: boolean, default False, (readonly)
-
is_multiview
¶ Image has more than one view
Type: boolean, default False, (readonly)
-
is_stereo_3d
¶ Image has left and right views
Type: boolean, default False, (readonly)
-
mapping
¶ Mapping type to use for this image in the game engine
UV
UV Coordinates, Use UV coordinates for mapping the image.REFLECTION
Reflection, Use reflection mapping for mapping the image.
Type: enum in [‘UV’, ‘REFLECTION’], default ‘UV’
-
packed_file
¶ First packed file of the image
Type: PackedFile
, (readonly)
-
packed_files
¶ Collection of packed images
Type: bpy_prop_collection
ofImagePackedFile
, (readonly)
-
pixels
¶ Image pixels in floating point values
Type: float in [-inf, inf], default 0.0
-
render_slots
¶ Render slots of the image
Type: RenderSlots
bpy_prop_collection
ofRenderSlot
, (readonly)
-
resolution
¶ X/Y pixels per meter
Type: float array of 2 items in [-inf, inf], default (0.0, 0.0)
-
size
¶ Width and height in pixels, zero when image data cant be loaded
Type: int array of 2 items in [-inf, inf], default (0, 0), (readonly)
-
source
¶ Where the image comes from
FILE
Single Image, Single image file.SEQUENCE
Image Sequence, Multiple image files, as a sequence.MOVIE
Movie, Movie file.GENERATED
Generated, Generated image.VIEWER
Viewer, Compositing node viewer.
Type: enum in [‘FILE’, ‘SEQUENCE’, ‘MOVIE’, ‘GENERATED’, ‘VIEWER’], default ‘FILE’
-
stereo_3d_format
¶ Settings for stereo 3d
Type: Stereo3dFormat
, (readonly, never None)
-
tiles_x
¶ Degree of repetition in the X direction
Type: int in [1, 16], default 0
-
tiles_y
¶ Degree of repetition in the Y direction
Type: int in [1, 16], default 0
-
type
¶ How to generate the image
Type: enum in [‘IMAGE’, ‘MULTILAYER’, ‘UV_TEST’, ‘RENDER_RESULT’, ‘COMPOSITING’], default ‘IMAGE’, (readonly)
-
use_alpha
¶ Use the alpha channel information from the image or make image fully opaque
Type: boolean, default False
-
use_animation
¶ Use as animated texture in the game engine
Type: boolean, default False
-
use_clamp_x
¶ Disable texture repeating horizontally
Type: boolean, default False
-
use_clamp_y
¶ Disable texture repeating vertically
Type: boolean, default False
-
use_deinterlace
¶ Deinterlace movie file on load
Type: boolean, default False
-
use_fields
¶ Use fields of the image
Type: boolean, default False
-
use_generated_float
¶ Generate floating point buffer
Type: boolean, default False
-
use_multiview
¶ Use Multiple Views (when available)
Type: boolean, default False
-
use_tiles
¶ Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)
Type: boolean, default False
-
use_view_as_render
¶ Apply render part of display transformation when displaying this image on the screen
Type: boolean, default False
-
views_format
¶ Mode to load image views
INDIVIDUAL
Individual, Individual files for each view with the prefix as defined by the scene views.STEREO_3D
Stereo 3D, Single file with an encoded stereo pair.
Type: enum in [‘INDIVIDUAL’, ‘STEREO_3D’], default ‘INDIVIDUAL’
-
save_render
(filepath, scene=None)¶ Save image to a specific path using a scenes render settings
Parameters: - filepath (string, (never None)) – Save path
- scene (
Scene
, (optional)) – Scene to take image parameters from
-
save
()¶ Save image to its source path
-
pack
(as_png=False, data="", data_len=0)¶ Pack an image as embedded data into the .blend file
Parameters: - as_png (boolean, (optional)) – as_png, Pack the image as PNG (needed for generated/dirty images)
- data (string, (optional, never None)) – data, Raw data (bytes, exact content of the embedded file)
- data_len (int in [0, inf], (optional)) – data_len, length of given data (mandatory if data is provided)
-
unpack
(method='USE_LOCAL')¶ Save an image packed in the .blend file to disk
Parameters: method (enum in [‘USE_LOCAL’, ‘WRITE_LOCAL’, ‘USE_ORIGINAL’, ‘WRITE_ORIGINAL’], (optional)) – method, How to unpack
-
reload
()¶ Reload the image from its source path
-
update
()¶ Update the display image from the floating point buffer
-
scale
(width, height)¶ Scale the image in pixels
Parameters: - width (int in [1, 10000]) – Width
- height (int in [1, 10000]) – Height
-
gl_touch
(frame=0, filter=9985, mag=9729)¶ Delay the image from being cleaned from the cache due inactivity
Parameters: - frame (int in [0, inf], (optional)) – Frame, Frame of image sequence or movie
- filter (int in [-inf, inf], (optional)) – Filter, The texture minifying function to use if the image wasn’t loaded
- mag (int in [-inf, inf], (optional)) – Magnification, The texture magnification function to use if the image wasn’t loaded
Returns: Error, OpenGL error value
Return type: int in [-inf, inf]
-
gl_load
(frame=0, filter=9985, mag=9729)¶ Load the image into OpenGL graphics memory
Parameters: - frame (int in [0, inf], (optional)) – Frame, Frame of image sequence or movie
- filter (int in [-inf, inf], (optional)) – Filter, The texture minifying function
- mag (int in [-inf, inf], (optional)) – Magnification, The texture magnification function
Returns: Error, OpenGL error value
Return type: int in [-inf, inf]
-
gl_free
()¶ Free the image from OpenGL graphics memory
-
filepath_from_user
(image_user=None)¶ Return the absolute path to the filepath of an image frame specified by the image user
Parameters: image_user ( ImageUser
, (optional)) – Image user of the image to get filepath forReturns: File Path, The resulting filepath from the image and it’s user Return type: string, (never None)
-
buffers_free
()¶ Free the image buffers from memory
-
Inherited Properties
Inherited Functions
References