Image Operators

bpy.ops.image.change_frame(frame=0)

Interactively change the current frame number

Parameters:frame (int in [-1048574, 1048574], (optional)) – Frame
bpy.ops.image.clear_render_border()

Clear the boundaries of the border render and disable border render

bpy.ops.image.curves_point_set(point='BLACK_POINT')

Set black point or white point for curves

Parameters:point (enum in ['BLACK_POINT', 'WHITE_POINT'], (optional)) – Point, Set black point or white point for curves
bpy.ops.image.cycle_render_slot(reverse=False)

Cycle through all non-void render slots

Parameters:reverse (boolean, (optional)) – Cycle in Reverse
bpy.ops.image.external_edit(filepath="")

Edit image in an external application

Parameters:filepath (string, (optional, never None)) – filepath
File:startup/bl_operators/image.py:61
bpy.ops.image.invert(invert_r=False, invert_g=False, invert_b=False, invert_a=False)

Invert image’s channels

Parameters:
  • invert_r (boolean, (optional)) – Red, Invert Red Channel
  • invert_g (boolean, (optional)) – Green, Invert Green Channel
  • invert_b (boolean, (optional)) – Blue, Invert Blue Channel
  • invert_a (boolean, (optional)) – Alpha, Invert Alpha Channel
bpy.ops.image.match_movie_length()

Set image’s user’s length to the one of this video

bpy.ops.image.new(name="Untitled", width=1024, height=1024, color=(0.0, 0.0, 0.0, 1.0), alpha=True, generated_type='BLANK', float=False, gen_context='NONE', use_stereo_3d=False)

Create a new image

Parameters:
  • name (string, (optional, never None)) – Name, Image data-block name
  • width (int in [1, inf], (optional)) – Width, Image width
  • height (int in [1, inf], (optional)) – Height, Image height
  • color (float array of 4 items in [0, inf], (optional)) – Color, Default fill color
  • alpha (boolean, (optional)) – Alpha, Create an image with an alpha channel
  • generated_type (enum in ['BLANK', 'UV_GRID', 'COLOR_GRID'], (optional)) –

    Generated Type, Fill the image with a grid for UV map testing

    • 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.
  • float (boolean, (optional)) – 32 bit Float, Create image with 32 bit floating point bit depth
  • gen_context (enum in ['NONE', 'PAINT_CANVAS', 'PAINT_STENCIL'], (optional)) – Gen Context, Generation context
  • use_stereo_3d (boolean, (optional)) – Stereo 3D, Create an image with left and right views
bpy.ops.image.open(filepath="", directory="", files=None, filter_blender=False, filter_backup=False, filter_image=True, filter_movie=True, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=9, relative_path=True, show_multiview=False, use_multiview=False, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA', use_sequence_detection=True)

Open image

Parameters:
  • filepath (string, (optional, never None)) – File Path, Path to file
  • directory (string, (optional, never None)) – Directory, Directory of the file
  • files (bpy_prop_collection of OperatorFileListElement, (optional)) – Files
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_backup (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_alembic (boolean, (optional)) – Filter Alembic files
  • filter_folder (boolean, (optional)) – Filter folders
  • filter_blenlib (boolean, (optional)) – Filter Blender IDs
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • show_multiview (boolean, (optional)) – Enable Multi-View
  • use_multiview (boolean, (optional)) – Use Multi-View
  • display_type (enum in ['DEFAULT', 'LIST_SHORT', 'LIST_LONG', 'THUMBNAIL'], (optional)) –

    Display Type

    • DEFAULT Default, Automatically determine display type for files.
    • LIST_SHORT Short List, Display files as short list.
    • LIST_LONG Long List, Display files as a detailed list.
    • THUMBNAIL Thumbnails, Display files as thumbnails.
  • sort_method (enum in ['FILE_SORT_ALPHA', 'FILE_SORT_EXTENSION', 'FILE_SORT_TIME', 'FILE_SORT_SIZE'], (optional)) –

    File sorting mode

    • FILE_SORT_ALPHA Sort alphabetically, Sort the file list alphabetically.
    • FILE_SORT_EXTENSION Sort by extension, Sort the file list by extension/type.
    • FILE_SORT_TIME Sort by time, Sort files by modification time.
    • FILE_SORT_SIZE Sort by size, Sort files by size.
  • use_sequence_detection (boolean, (optional)) – Detect Sequences, Automatically detect animated sequences in selected images (based on file names)
bpy.ops.image.pack(as_png=False)

Pack an image as embedded data into the .blend file

Parameters:as_png (boolean, (optional)) – Pack As PNG, Pack image as lossless PNG
bpy.ops.image.project_apply()

Project edited image back onto the object

File:startup/bl_operators/image.py:230
bpy.ops.image.project_edit()

Edit a snapshot of the view-port in an external image editor

File:startup/bl_operators/image.py:159
bpy.ops.image.properties()

Toggle the properties region visibility

bpy.ops.image.read_renderlayers()

Read all the current scene’s render layers from cache, as needed

bpy.ops.image.reload()

Reload current image from disk

bpy.ops.image.render_border(xmin=0, xmax=0, ymin=0, ymax=0)

Set the boundaries of the border render and enable border render

Parameters:
  • xmin (int in [-inf, inf], (optional)) – X Min
  • xmax (int in [-inf, inf], (optional)) – X Max
  • ymin (int in [-inf, inf], (optional)) – Y Min
  • ymax (int in [-inf, inf], (optional)) – Y Max
bpy.ops.image.replace(filepath="", filter_blender=False, filter_backup=False, filter_image=True, filter_movie=True, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=9, relative_path=True, show_multiview=False, use_multiview=False, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA')

Replace current image by another one from disk

Parameters:
  • filepath (string, (optional, never None)) – File Path, Path to file
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_backup (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_alembic (boolean, (optional)) – Filter Alembic files
  • filter_folder (boolean, (optional)) – Filter folders
  • filter_blenlib (boolean, (optional)) – Filter Blender IDs
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • show_multiview (boolean, (optional)) – Enable Multi-View
  • use_multiview (boolean, (optional)) – Use Multi-View
  • display_type (enum in ['DEFAULT', 'LIST_SHORT', 'LIST_LONG', 'THUMBNAIL'], (optional)) –

    Display Type

    • DEFAULT Default, Automatically determine display type for files.
    • LIST_SHORT Short List, Display files as short list.
    • LIST_LONG Long List, Display files as a detailed list.
    • THUMBNAIL Thumbnails, Display files as thumbnails.
  • sort_method (enum in ['FILE_SORT_ALPHA', 'FILE_SORT_EXTENSION', 'FILE_SORT_TIME', 'FILE_SORT_SIZE'], (optional)) –

    File sorting mode

    • FILE_SORT_ALPHA Sort alphabetically, Sort the file list alphabetically.
    • FILE_SORT_EXTENSION Sort by extension, Sort the file list by extension/type.
    • FILE_SORT_TIME Sort by time, Sort files by modification time.
    • FILE_SORT_SIZE Sort by size, Sort files by size.
bpy.ops.image.sample()

Use mouse to sample a color in current image

bpy.ops.image.sample_line(xstart=0, xend=0, ystart=0, yend=0, cursor=1002)

Sample a line and show it in Scope panels

Parameters:
  • xstart (int in [-inf, inf], (optional)) – X Start
  • xend (int in [-inf, inf], (optional)) – X End
  • ystart (int in [-inf, inf], (optional)) – Y Start
  • yend (int in [-inf, inf], (optional)) – Y End
  • cursor (int in [0, inf], (optional)) – Cursor, Mouse cursor style to use during the modal operator
bpy.ops.image.save()

Save the image with current name and settings

bpy.ops.image.save_as(save_as_render=False, copy=False, filepath="", check_existing=True, filter_blender=False, filter_backup=False, filter_image=True, filter_movie=True, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=9, relative_path=True, show_multiview=False, use_multiview=False, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA')

Save the image with another name and/or settings

Parameters:
  • save_as_render (boolean, (optional)) – Save As Render, Apply render part of display transform when saving byte image
  • copy (boolean, (optional)) – Copy, Create a new image file without modifying the current image in blender
  • filepath (string, (optional, never None)) – File Path, Path to file
  • check_existing (boolean, (optional)) – Check Existing, Check and warn on overwriting existing files
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_backup (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_alembic (boolean, (optional)) – Filter Alembic files
  • filter_folder (boolean, (optional)) – Filter folders
  • filter_blenlib (boolean, (optional)) – Filter Blender IDs
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • show_multiview (boolean, (optional)) – Enable Multi-View
  • use_multiview (boolean, (optional)) – Use Multi-View
  • display_type (enum in ['DEFAULT', 'LIST_SHORT', 'LIST_LONG', 'THUMBNAIL'], (optional)) –

    Display Type

    • DEFAULT Default, Automatically determine display type for files.
    • LIST_SHORT Short List, Display files as short list.
    • LIST_LONG Long List, Display files as a detailed list.
    • THUMBNAIL Thumbnails, Display files as thumbnails.
  • sort_method (enum in ['FILE_SORT_ALPHA', 'FILE_SORT_EXTENSION', 'FILE_SORT_TIME', 'FILE_SORT_SIZE'], (optional)) –

    File sorting mode

    • FILE_SORT_ALPHA Sort alphabetically, Sort the file list alphabetically.
    • FILE_SORT_EXTENSION Sort by extension, Sort the file list by extension/type.
    • FILE_SORT_TIME Sort by time, Sort files by modification time.
    • FILE_SORT_SIZE Sort by size, Sort files by size.
bpy.ops.image.save_dirty()

Save all modified textures

File:startup/bl_operators/image.py:124
bpy.ops.image.save_sequence()

Save a sequence of images

bpy.ops.image.toolshelf()

Toggles tool shelf display

bpy.ops.image.unpack(method='USE_LOCAL', id="")

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
  • id (string, (optional, never None)) – Image Name, Image data-block name to unpack
bpy.ops.image.view_all(fit_view=False)

View the entire image

Parameters:fit_view (boolean, (optional)) – Fit View, Fit frame to the viewport
bpy.ops.image.view_ndof()

Use a 3D mouse device to pan/zoom the view

bpy.ops.image.view_pan(offset=(0.0, 0.0))

Pan the view

Parameters:offset (float array of 2 items in [-inf, inf], (optional)) – Offset, Offset in floating point units, 1.0 is the width and height of the image
bpy.ops.image.view_selected()

View all selected UVs

bpy.ops.image.view_zoom(factor=0.0)

Zoom in/out the image

Parameters:factor (float in [-inf, inf], (optional)) – Factor, Zoom factor, values higher than 1.0 zoom in, lower values zoom out
bpy.ops.image.view_zoom_border(gesture_mode=0, xmin=0, xmax=0, ymin=0, ymax=0)

Zoom in the view to the nearest item contained in the border

Parameters:
  • gesture_mode (int in [-inf, inf], (optional)) – Gesture Mode
  • xmin (int in [-inf, inf], (optional)) – X Min
  • xmax (int in [-inf, inf], (optional)) – X Max
  • ymin (int in [-inf, inf], (optional)) – Y Min
  • ymax (int in [-inf, inf], (optional)) – Y Max
bpy.ops.image.view_zoom_in(location=(0.0, 0.0))

Zoom in the image (centered around 2D cursor)

Parameters:location (float array of 2 items in [-inf, inf], (optional)) – Location, Cursor location in screen coordinates
bpy.ops.image.view_zoom_out(location=(0.0, 0.0))

Zoom out the image (centered around 2D cursor)

Parameters:location (float array of 2 items in [-inf, inf], (optional)) – Location, Cursor location in screen coordinates
bpy.ops.image.view_zoom_ratio(ratio=0.0)

Set zoom ratio of the view

Parameters:ratio (float in [-inf, inf], (optional)) – Ratio, Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out