Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Fabric.js Image strokeMiterLimit Property

  • Last Updated : 01 Feb, 2021

In this article, we cover how to set the strokeMiterLimit of an Image using Fabric.js. The Image in Fabric.js is movable and can be stretched according to requirements. Further, the Image can be customized when it comes to initial stroke color, height, width, fill color, or stroke width.

To make it possible we are going to use a JavaScript library called Fabric.js. After importing the library, we will create a canvas block in the body tag that will contain the Image. After this, we will initialize instances of Canvas and Image provided by Fabric.js and set the strokeMiterLimit color of the canvas path using strokeMiterLimit property.


fabric.Image(image, {
      strokeMiterLimit : number

Parameters: This function takes a single parameter as mentioned above and described below:

  • strokeMiterLimit: This parameter takes a number value to set the strokeMiterLimit of the canvas image.

Example: This example uses FabricJS to set the strokeMiterLimit property of the canvas image as shown in the below example:


<!DOCTYPE html> 
    <!-- Adding the FabricJS library -->
    <script src
    <h1 style="color: green;"
        Fabric.js | Image strokeMiterLimit Property 
    <canvas id="canvas" width="400" height="300"
        style="border:2px solid #000000"
    <img src
        width="100" height="100" id="my-image"
        style="display: none;"
        // Creating the instance of canvas object 
        var canvas = new fabric.Canvas("canvas"); 
        // Getting the image 
        var img = document.getElementById('my-image'); 
        // Creating the image instance 
        var geeks = new fabric.Image(img, {
            strokeMiterLimit : 29,
            strokeLineJoin :"miter",


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!