The IMAGE entity (DXF Reference) represents a raster image, the image file itself is
not embedded into the DXF file, it is always a separated file.
The IMAGE entity is like a block reference, it can be used to add the image multiple times
at different locations with different scale and rotation angles. Every IMAGE entity
requires an image definition, see entity
Ezdxf creates only images in the xy-plan, it’s possible to place images in 3D space,
Image.dxf.u_pixel and the
has to be set accordingly.
Inherited DXF attributes
Required DXF version
DXF R2000 (
Do not instantiate entity classes by yourself - always use the provided factory functions!
- class ezdxf.entities.Image¶
U-vector of a single pixel as (x, y, z) tuple. This vector points along the visual bottom of the image, starting at the insertion point.
V-vector of a single pixel as (x, y, z) tuple. This vector points along the visual left side of the image, starting at the insertion point.
Image size in pixels as (x, y) tuple
Show image when not aligned with screen
Use clipping boundary
Transparency is on
Brightness value in the range [0, 100], default is 50
Contrast value in the range [0, 100], default is 50
Fade value in the range [0, 100], default is 0
Number of clip boundary vertices, this attribute is maintained by ezdxf.
requires DXF R2010 or newer
A list of vertices as pixel coordinates, Two vertices describe a rectangle, lower left corner is (-0.5, -0.5) and upper right corner is (ImageSizeX-0.5, ImageSizeY-0.5), more than two vertices is a polygon as clipping path. All vertices as pixel coordinates. (read/write)
- reset_boundary_path() None ¶
Reset boundary path to the default rectangle [(-0.5, -0.5), (ImageSizeX-0.5, ImageSizeY-0.5)].
- set_boundary_path(vertices: Iterable[UVec]) None ¶
Set boundary path to vertices. Two vertices describe a rectangle (lower left and upper right corner), more than two vertices is a polygon as clipping path.
- boundary_path_wcs() list[Vec3] ¶
Returns the boundary/clipping path in WCS coordinates.
from ezdxf.path import make_path image = ... # get image entity clipping_path = make_path(image)