Automated Computed Embroidery

Example Request

POST

An ACE request is a POST to https://<ZSKAddress>/StitchJob with a JSON body (see Overview). It needs "Client": "ACE", a valid WebApiLicense, one image source and the ACE parameter objects. The supported input formats are listed in Automated Computed Embroidery (ACE).

Request types
RequestTypeResult in RequestData (Base64)Further response fields
CreateTCEmbroidery data in TC (Z00) formatInfo (size, stitches), NeedleColor, NeedleSequence. With "WithPreview": true also PreviewData: a TrueView preview PNG from the same request, billed only once.
CreatePNG, CreateStatPNGTrueView preview of the embroidery as PNGInfo, NeedleColor, NeedleSequence. CreatePNG is handled as CreateStatPNG.
CreateACEVectorThe vectorized design as DXF–
CreateACEPngThe image after the color reduction of the embroidery step (ACEParaBitmapOptimize) as PNG–
OptimizePngThe optimized PNG, without creating embroidery dataInfo. See Optimize.
RasterizeVectorThe SVG or AI file from VectorBase64/VectorType as PNG, without optimization and without creating embroidery data: rasterized at 300 DPI with smooth edges, longer side between 512 and 4096 pixels, background kept. Needs no ACEPara objects and is not billed.–

The response is a JobResponseType. Info, NeedleColor and NeedleSequence are JSON strings; parse them a second time.

Before the embroidery is created
  • For PNG, SVG and AI input, the server first runs the optimization with ACEParaOptimize (color reduction, thread table, background detection, scaling). It also runs with the defaults if ACEParaOptimize is left out. Check the settings with OptimizePng first.
  • For thread numbers in the embroidery file, send the thread series in ACEParaOptimize.ThreadTable or in ACEParaBitmapToPunch.UseThreadCones; the server copies it to the other field if that one is empty. If you send both, use the same name. See Color reduction.
  • The embroidery parameters are described in ACEParaBitmapOptimize, ACEParaBitmapToVector and ACEParaBitmapToPunch. Send all three objects in every Create request. Values in these objects may be sent as strings, as in the example.
  • TrueView sets the look of the PNG preview (CreatePNG, CreateStatPNG, WithPreview); see TrueView. Without it, default values are used.
Billing and errors
  • Every successful Create request uses license quota. How many units depend on your license type.
  • Input errors (missing source, unsupported format, missing parameter objects) return HTTP 400; see Automated Computed Embroidery (ACE). No licence token found. and Invalid licence token. also return HTTP 400.
  • If the embroidery step fails, the response is HTTP 503 with Communication with GiS ASPWebService failed! or No data received from GiS ASPWebService. Failed requests are not billed.

The example creates TC embroidery data plus a preview from a PNG logo on a plain background, with the thread series Amann-Isacord 40 and a width of 100 mm.

Parameters

Parameter Type Description Required
RequestType string CreateTC, CreatePNG, CreateStatPNG, CreateACEVector, CreateACEPng, OptimizePng or RasterizeVector (see Request types). Yes
Client string "ACE". Routes the request to the ACE service. Yes
WebApiLicense string Your ZSK Web API license key, format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx. Yes
PictureType string "PNG", "JPG" or "BMP", in upper case. Required together with PictureBase64. No
PictureBase64 string The PNG, JPG or BMP file as Base64, without a data-URL prefix. Send either PictureBase64 or VectorBase64. No
VectorType string "SVG" or "AI", in upper case. Required together with VectorBase64. No
VectorBase64 string The SVG or AI file as Base64. Send either VectorBase64 or PictureBase64. No
ACEParaOptimize object Optimization settings (color reduction, thread table, background detection, scaling). Defaults are used if omitted. See ACEParaOptimize. No
ACEParaBitmapOptimize object Color reduction settings of the embroidery step. Required for every Create request. Yes
ACEParaBitmapToVector object Vectorization and background settings. Required for every Create request. Yes
ACEParaBitmapToPunch object Stitch settings and UseThreadCones. Required for every Create request. Yes
ACEParaVector object Required for SVG/AI input; an empty object {} is enough. No
TrueView object Look of the PNG preview (CreatePNG, CreateStatPNG, WithPreview). Defaults are used if omitted. No
WithPreview bool CreateTC only: also return a PNG preview in PreviewData. Billed once together with the embroidery data. Default false. No

Example

{
  "RequestType": "CreateTC",
  "Client": "ACE",
  "WebApiLicense": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx",
  "WithPreview": true,
  "PictureType": "PNG",
  "PictureBase64": "",
  "ACEParaOptimize": {
    "TargetColorCount": 6,
    "NoiseStrength": 2,
    "PreSmoothStrength": 0,
    "ThreadTable": "Amann-Isacord 40",
    "EnableBackgroundReplacement": true,
    "BackgroundDetectionMode": "Auto",
    "BackgroundTolerance": 30,
    "EnableResample": true,
    "TargetWidthMm": 100
  },
  "ACEParaBitmapOptimize": {
    "Resolution": "0",
    "ImageType": "0",
    "Tolerance": "0",
    "RemoveArea": "0",
    "MaxColors": "24"
  },
  "ACEParaBitmapToVector": {
    "Tolerance": "20",
    "Smoothing": "150",
    "DetermineBackgroundColor": "0",
    "BackgroundColor": "255,255,255",
    "BackgroundFill": "1"
  },
  "ACEParaBitmapToPunch": {
    "LineWidth": "4",
    "SatinStitchWidth": "50",
    "Overlap": "2",
    "MinimumAreaSize": "5",
    "MinimumHoleSize": "1",
    "MinimumLineLength": "30",
    "UseThreadCones": "Amann-Isacord 40"
  },
  "TrueView": {
    "LineThickness": "400",
    "Brightness": "100",
    "LightingOn": "1",
    "LightingAngle": "90",
    "HideStitches": "1",
    "HideStitchesFrom": "127"
  }
}