With the /AutoDigitize endpoint user can digitize images (.png, .jpeg, .jpg, .tiff)
POST
/api/AutoDigitize/Digitize
Digitize image
Request Example
Usage
Digitize is called first to upload an image and digitize it.
ReDigitize can be called after Digitize when the user wants to change the maximum number of colors (NumColors).
ChangeDigitizedImageColors can be called after Digitize or ReDigitize when the user wants to update the colors of the digitized image.
/api/AutoDigitize/Digitize
FormData
File: Posted filestream
NumColors: 15, // Required. Maximum number of colors for the digitize process
ApplyEmbroideryPattern: false, // Optional. Applies a layer on top of the updated digitized image which simulates a stitching effect
Unit: "pixels", // Optional. Possible values: "cm", "inches", "pixels"
Density: "Low" // Optional. Density of stitches used for calculating StitchEstimation. Possible values: "Low", "Medium", "High"
Response Example
{
"Data": {
"DesignColors": [ // The image colors
{
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 255,
"Code": null,
"Name": null,
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": "000000"
},
...
{
"Blue": 242,
"Red": 38,
"Green": 87,
"Alpha": 255,
"Code": null,
"Name": null,
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": "2657F2"
}
],
"ActualColors": [ // Mapping between the image colors and the available embroidery palette colors (The latter is what will be displayed to the user)
{
"DesignColor": { // The image color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 255,
"Code": null,
"Name": null,
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": "000000"
},
"PaletteColor":{ // The embroidery palette color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 255,
"Code": "001010",
"Name": "Black",
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": null
},
"NumPixels": 104022,
"NumPixelsPercentage": 41.6088
},
...
{
"DesignColor": { // The image color
"Blue": 242,
"Red": 38,
"Green": 87,
"Alpha": 255,
"Code": null,
"Name": null,
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": "2657F2"
},
"PaletteColor": { // The embroidery palette color
"Blue": 150,
"Red": 0,
"Green": 87,
"Alpha": 255,
"Code": "1076",
"Name": "1076 - Sapphire",
"Manufacturer": null,
"RelColor": 0, // Used for drawing stitches, The index of the needle (color) in the palette
"Value": null
},
"NumPixels": 30157,
"NumPixelsPercentage": 12.0628
}
],
"MaxNumColors": 3,
"Preview": "base64 preview string",
"Filename": "ybmFG_4k0UeqCwmiSJvXOA_status0",
"DPI": 72,
"Width": 500, // Depends on the Unit. Possible values: "cm", "inches", "pixels"
"Height": 500, // Depends on the Unit. Possible values: "cm", "inches", "pixels"
"StitchEstimation": 120563.27160493826,
"Unit": "pixels"
},
"Success": true,
"Errors": null
}
POST
/api/AutoDigitize/ReDigitize
ReDigitize image
Request Example
Usage
Digitize is called first to upload an image and digitize it.
ReDigitize can be called after Digitize when the user wants to change the maximum number of colors (NumColors).
ChangeDigitizedImageColors can be called after Digitize or ReDigitize when the user wants to update the colors of the digitized image.
/api/AutoDigitize/ReDigitize
{
Filename: "ybmFG_4k0UeqCwmiSJvXOA_status0", // Required. Filename returned from Digitize call
NumColors: 14, // Required. Maximum number of colors for the digitize process
ApplyEmbroideryPattern: false, // Optional. Applies a layer on top of the updated digitized image which simulates a stitching effect
Unit: "pixels", // Optional. Possible values: "cm", "inches", "pixels"
Width: 0, // Optional. Resize the digitized image. Value should be based on the Unit
Height: 0, // Optional. Resize the digitized image. Value should be based on the Unit
Density: "Low" // Optional. Density of stitches used for calculating StitchEstimation. Possible values: "Low", "Medium", "High"
}
Response Example
Same response as Digitize request
POST
/api/AutoDigitize/GetPreviews
Get previews of digitized files
Request Example
/api/AutoDigitize/GetPreviews
[
"ybmFG_4k0UeqCwmiSJvXOA_status0", // A list of file names that have been digitized (returned from Digitize call).
"vBvBk81HnU6bpd_kywkeBA_status0"
]
Response Example
Returns the base64 previews of requested digitized files (they have already been uploaded with Digitize request)
{
"Data": [
{
"Filename": "ybmFG_4k0UeqCwmiSJvXOA_status0",
"Base64Preview": "base64 preview string"
},
{
"Filename": "vBvBk81HnU6bpd_kywkeBA_status0",
"Base64Preview": "base64 preview string"
}
],
"Success": true,
"Errors": null
}
POST
/api/AutoDigitize/ChangeDigitizedImageColors
Update colors of the digitized image
Request Example
Usage
Digitize is called first to upload an image and digitize it.
ReDigitize can be called after Digitize when the user wants to change the maximum number of colors (NumColors).
ChangeDigitizedImageColors can be called after Digitize or ReDigitize when the user wants to update the colors of the digitized image.
/api/AutoDigitize/ChangeDigitizedImageColors
{
"Filename": "ybmFG_4k0UeqCwmiSJvXOA_status0" // Filename returned from Digitize or ReDigitize call
"Colors": [
{
"DesignColor": { // The image color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 255,
"Code": null,
"Name": null
},
"PaletteColor": { // The embroidery palette color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 255,
"Code": "black",
"Name": "Black"
}
},
...
{
"DesignColor": { // The image color
"Blue": 242,
"Red": 38,
"Green": 87,
"Alpha": 255,
"Code": null,
"Name": null,
},
"PaletteColor": { // The embroidery palette color
"Blue": 23,
"Red": 255,
"Green": 166,
"Alpha": 255,
"Code": "1024",
"Name": "1024 - Ochre",
}
},
{
"DesignColor": { // The image color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 0,
"Code": "tr",
"Name": "transparent"
},
"PaletteColor": { // The embroidery palette color
"Blue": 0,
"Red": 0,
"Green": 0,
"Alpha": 0,
"Code": "[transparent]",
"Name": "transparent"
}
}
],
"ApplyEmbroideryPattern": false, // Optional. Applies a layer on top of the updated digitized image which simulates a stitching effect
"Density": 0 // Optional. Density of stitches used for calculating StitchEstimation. Possible values: 0 (= "Low"), 1 (= "Medium"), 2 (= "High")
}
Response Example
{
"Preview": // Image preview in base64 format
"StitchEstimation": 43283.0
}
GET
/api/AutoDigitize/GetDigitizedFiles
Get files for digitized job
Request Example
/api/AutoDigitize/GetDigitizedFiles?job=MYJOB
Response Example
Returns the base64 previews of requested digitized files (they have already been uploaded with Digitize request)
{
"Data": [
{
"Filename": "ybmFG_4k0UeqCwmiSJvXOA_status0",
"Base64Preview": "base64 preview string"
},
{
"Filename": "vBvBk81HnU6bpd_kywkeBA_status0",
"Base64Preview": "base64 preview string"
}
],
"Success": true,
"Errors": null
}