Skip to content

Latest commit

 

History

History
395 lines (316 loc) · 39.5 KB

File metadata and controls

395 lines (316 loc) · 39.5 KB

\VectorizationAPI

All URIs are relative to https://api.vectorizer.ai/api/v1

Method HTTP request Description
PostDelete Post /delete Delete a retained image
PostDownload Post /download Download a retained result
PostVectorize Post /vectorize Vectorize an image

PostDelete

DeleteImageResponse PostDelete(ctx).ImageToken(imageToken).Execute()

Delete a retained image

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/clv/vectorizer-go"
)

func main() {
	imageToken := "imageToken_example" // string | Image Token to delete before its retention period expires.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.VectorizationAPI.PostDelete(context.Background()).ImageToken(imageToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `VectorizationAPI.PostDelete``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostDelete`: DeleteImageResponse
	fmt.Fprintf(os.Stdout, "Response from `VectorizationAPI.PostDelete`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostDeleteRequest struct via the builder pattern

Name Type Description Notes
imageToken string Image Token to delete before its retention period expires.

Return type

DeleteImageResponse

Authorization

basicAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostDownload

*os.File PostDownload(ctx).ImageToken(imageToken).Receipt(receipt).OutputFileFormat(outputFileFormat).OutputShapeStacking(outputShapeStacking).OutputGroupBy(outputGroupBy).OutputDrawStyle(outputDrawStyle).OutputStrokesStrokeWidth(outputStrokesStrokeWidth).OutputStrokesNonScalingStroke(outputStrokesNonScalingStroke).OutputStrokesUseOverrideColor(outputStrokesUseOverrideColor).OutputStrokesOverrideColor(outputStrokesOverrideColor).OutputGapFillerEnabled(outputGapFillerEnabled).OutputGapFillerNonScalingStroke(outputGapFillerNonScalingStroke).OutputGapFillerClip(outputGapFillerClip).OutputGapFillerStrokeWidth(outputGapFillerStrokeWidth).OutputParameterizedShapesFlatten(outputParameterizedShapesFlatten).OutputCurvesLineFitTolerance(outputCurvesLineFitTolerance).OutputCurvesAllowedQuadraticBezier(outputCurvesAllowedQuadraticBezier).OutputCurvesAllowedCubicBezier(outputCurvesAllowedCubicBezier).OutputCurvesAllowedCircularArc(outputCurvesAllowedCircularArc).OutputCurvesAllowedEllipticalArc(outputCurvesAllowedEllipticalArc).OutputSvgVersion(outputSvgVersion).OutputSvgFixedSize(outputSvgFixedSize).OutputSvgAdobeCompatibilityMode(outputSvgAdobeCompatibilityMode).OutputPdfVersion(outputPdfVersion).OutputPdfCompressionMode(outputPdfCompressionMode).OutputEpsVersion(outputEpsVersion).OutputDxfCompatibilityLevel(outputDxfCompatibilityLevel).OutputBitmapAntiAliasingMode(outputBitmapAntiAliasingMode).OutputSizeScale(outputSizeScale).OutputSizeWidth(outputSizeWidth).OutputSizeHeight(outputSizeHeight).OutputSizeUnit(outputSizeUnit).OutputSizeAspectRatio(outputSizeAspectRatio).OutputSizeAlignX(outputSizeAlignX).OutputSizeAlignY(outputSizeAlignY).OutputSizeInputDpi(outputSizeInputDpi).OutputSizeOutputDpi(outputSizeOutputDpi).Execute()

Download a retained result

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/clv/vectorizer-go"
)

func main() {
	imageToken := "imageToken_example" // string | Image Token returned from a vectorize request with policy.retention_days > 0.
	receipt := "receipt_example" // string | Receipt returned in the X-Receipt response header when upgrading a preview result to production. Include it when downloading additional formats from that upgraded preview. (optional)
	outputFileFormat := "outputFileFormat_example" // string | Output file format to generate. (optional) (default to "svg")
	outputShapeStacking := "outputShapeStacking_example" // string | Whether shapes are cut out of each other or stacked atop each other. (optional) (default to "cutouts")
	outputGroupBy := "outputGroupBy_example" // string | Grouping of shapes in output. (optional) (default to "none")
	outputDrawStyle := "outputDrawStyle_example" // string | How shapes are rendered. (optional) (default to "fill_shapes")
	outputStrokesStrokeWidth := float32(3.4) // float32 | Width of stroke for shape outlines (when enabled). (optional) (default to 1)
	outputStrokesNonScalingStroke := true // bool | Use non-scaling strokes when drawing shape outlines. (optional) (default to true)
	outputStrokesUseOverrideColor := true // bool | Override shape color with a specific color. (optional) (default to false)
	outputStrokesOverrideColor := "outputStrokesOverrideColor_example" // string | Color value to override shape stroke color if enabled. Must be in '#RRGGBB' or 'rgba(r,g,b,a)' format. (optional) (default to "#000000")
	outputGapFillerEnabled := true // bool | Enable filling small visual gaps caused by vector rendering artifacts. (optional) (default to true)
	outputGapFillerNonScalingStroke := true // bool | Use non-scaling strokes for gap filling. (optional) (default to true)
	outputGapFillerClip := true // bool | Clip gap filler strokes to shape bounds when stacking shapes. (optional) (default to false)
	outputGapFillerStrokeWidth := float32(3.4) // float32 | Width of the gap filler strokes (in output units). (optional) (default to 2)
	outputParameterizedShapesFlatten := true // bool | Whether to flatten detected circles, rectangles, and stars to curves. (optional) (default to false)
	outputCurvesLineFitTolerance := float32(3.4) // float32 | Maximum allowed error when approximating curves with line segments. (optional) (default to 0.1)
	outputCurvesAllowedQuadraticBezier := true // bool | Allow quadratic Bézier curves in the output. (optional) (default to true)
	outputCurvesAllowedCubicBezier := true // bool | Allow cubic Bézier curves in the output. (optional) (default to true)
	outputCurvesAllowedCircularArc := true // bool | Allow circular arcs in the output. (optional) (default to true)
	outputCurvesAllowedEllipticalArc := true // bool | Allow elliptical arcs in the output. (optional) (default to true)
	outputSvgVersion := "outputSvgVersion_example" // string | SVG version to declare in the SVG output. (optional) (default to "svg_1_1")
	outputSvgFixedSize := true // bool | Whether to fix the SVG dimensions in the output file. (optional) (default to false)
	outputSvgAdobeCompatibilityMode := true // bool | Enable Illustrator compatibility by disabling unsupported SVG features. (optional) (default to false)
	outputPdfVersion := "outputPdfVersion_example" // string | PDF version to generate for PDF output. (optional) (default to "PDF_1_4")
	outputPdfCompressionMode := "outputPdfCompressionMode_example" // string | Compression method to apply to PDF output streams. (optional) (default to "Deflate")
	outputEpsVersion := "outputEpsVersion_example" // string | EPS format version for EPS output. (optional) (default to "PS_3_0_EPSF_3_0")
	outputDxfCompatibilityLevel := "outputDxfCompatibilityLevel_example" // string | Level of primitive support for DXF output. (optional) (default to "lines_and_arcs")
	outputBitmapAntiAliasingMode := "outputBitmapAntiAliasingMode_example" // string | Anti-aliasing mode for bitmap (PNG) output. (optional) (default to "anti_aliased")
	outputSizeScale := float32(3.4) // float32 | Overall uniform scaling factor for the output image. (optional)
	outputSizeWidth := float32(3.4) // float32 | Output width, in the selected unit (see output.size.unit). (optional)
	outputSizeHeight := float32(3.4) // float32 | Output height, in the selected unit (see output.size.unit). (optional)
	outputSizeUnit := "outputSizeUnit_example" // string | Measurement unit for output dimensions. (optional) (default to "none")
	outputSizeAspectRatio := "outputSizeAspectRatio_example" // string | How to preserve or stretch aspect ratio. (optional) (default to "preserve_inset")
	outputSizeAlignX := float32(3.4) // float32 | Horizontal alignment (0.0 = left, 0.5 = center, 1.0 = right) when aspect ratio is preserved. (optional) (default to 0.5)
	outputSizeAlignY := float32(3.4) // float32 | Vertical alignment (0.0 = top, 0.5 = center, 1.0 = bottom) when aspect ratio is preserved. (optional) (default to 0.5)
	outputSizeInputDpi := float32(3.4) // float32 | Override the detected DPI of the input image for size computations. (optional)
	outputSizeOutputDpi := float32(3.4) // float32 | DPI setting for the output image. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.VectorizationAPI.PostDownload(context.Background()).ImageToken(imageToken).Receipt(receipt).OutputFileFormat(outputFileFormat).OutputShapeStacking(outputShapeStacking).OutputGroupBy(outputGroupBy).OutputDrawStyle(outputDrawStyle).OutputStrokesStrokeWidth(outputStrokesStrokeWidth).OutputStrokesNonScalingStroke(outputStrokesNonScalingStroke).OutputStrokesUseOverrideColor(outputStrokesUseOverrideColor).OutputStrokesOverrideColor(outputStrokesOverrideColor).OutputGapFillerEnabled(outputGapFillerEnabled).OutputGapFillerNonScalingStroke(outputGapFillerNonScalingStroke).OutputGapFillerClip(outputGapFillerClip).OutputGapFillerStrokeWidth(outputGapFillerStrokeWidth).OutputParameterizedShapesFlatten(outputParameterizedShapesFlatten).OutputCurvesLineFitTolerance(outputCurvesLineFitTolerance).OutputCurvesAllowedQuadraticBezier(outputCurvesAllowedQuadraticBezier).OutputCurvesAllowedCubicBezier(outputCurvesAllowedCubicBezier).OutputCurvesAllowedCircularArc(outputCurvesAllowedCircularArc).OutputCurvesAllowedEllipticalArc(outputCurvesAllowedEllipticalArc).OutputSvgVersion(outputSvgVersion).OutputSvgFixedSize(outputSvgFixedSize).OutputSvgAdobeCompatibilityMode(outputSvgAdobeCompatibilityMode).OutputPdfVersion(outputPdfVersion).OutputPdfCompressionMode(outputPdfCompressionMode).OutputEpsVersion(outputEpsVersion).OutputDxfCompatibilityLevel(outputDxfCompatibilityLevel).OutputBitmapAntiAliasingMode(outputBitmapAntiAliasingMode).OutputSizeScale(outputSizeScale).OutputSizeWidth(outputSizeWidth).OutputSizeHeight(outputSizeHeight).OutputSizeUnit(outputSizeUnit).OutputSizeAspectRatio(outputSizeAspectRatio).OutputSizeAlignX(outputSizeAlignX).OutputSizeAlignY(outputSizeAlignY).OutputSizeInputDpi(outputSizeInputDpi).OutputSizeOutputDpi(outputSizeOutputDpi).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `VectorizationAPI.PostDownload``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostDownload`: *os.File
	fmt.Fprintf(os.Stdout, "Response from `VectorizationAPI.PostDownload`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostDownloadRequest struct via the builder pattern

Name Type Description Notes
imageToken string Image Token returned from a vectorize request with policy.retention_days > 0.
receipt string Receipt returned in the X-Receipt response header when upgrading a preview result to production. Include it when downloading additional formats from that upgraded preview.
outputFileFormat string Output file format to generate. [default to "svg"]
outputShapeStacking string Whether shapes are cut out of each other or stacked atop each other. [default to "cutouts"]
outputGroupBy string Grouping of shapes in output. [default to "none"]
outputDrawStyle string How shapes are rendered. [default to "fill_shapes"]
outputStrokesStrokeWidth float32 Width of stroke for shape outlines (when enabled). [default to 1]
outputStrokesNonScalingStroke bool Use non-scaling strokes when drawing shape outlines. [default to true]
outputStrokesUseOverrideColor bool Override shape color with a specific color. [default to false]
outputStrokesOverrideColor string Color value to override shape stroke color if enabled. Must be in '#RRGGBB' or 'rgba(r,g,b,a)' format. [default to "#000000"]
outputGapFillerEnabled bool Enable filling small visual gaps caused by vector rendering artifacts. [default to true]
outputGapFillerNonScalingStroke bool Use non-scaling strokes for gap filling. [default to true]
outputGapFillerClip bool Clip gap filler strokes to shape bounds when stacking shapes. [default to false]
outputGapFillerStrokeWidth float32 Width of the gap filler strokes (in output units). [default to 2]
outputParameterizedShapesFlatten bool Whether to flatten detected circles, rectangles, and stars to curves. [default to false]
outputCurvesLineFitTolerance float32 Maximum allowed error when approximating curves with line segments. [default to 0.1]
outputCurvesAllowedQuadraticBezier bool Allow quadratic Bézier curves in the output. [default to true]
outputCurvesAllowedCubicBezier bool Allow cubic Bézier curves in the output. [default to true]
outputCurvesAllowedCircularArc bool Allow circular arcs in the output. [default to true]
outputCurvesAllowedEllipticalArc bool Allow elliptical arcs in the output. [default to true]
outputSvgVersion string SVG version to declare in the SVG output. [default to "svg_1_1"]
outputSvgFixedSize bool Whether to fix the SVG dimensions in the output file. [default to false]
outputSvgAdobeCompatibilityMode bool Enable Illustrator compatibility by disabling unsupported SVG features. [default to false]
outputPdfVersion string PDF version to generate for PDF output. [default to "PDF_1_4"]
outputPdfCompressionMode string Compression method to apply to PDF output streams. [default to "Deflate"]
outputEpsVersion string EPS format version for EPS output. [default to "PS_3_0_EPSF_3_0"]
outputDxfCompatibilityLevel string Level of primitive support for DXF output. [default to "lines_and_arcs"]
outputBitmapAntiAliasingMode string Anti-aliasing mode for bitmap (PNG) output. [default to "anti_aliased"]
outputSizeScale float32 Overall uniform scaling factor for the output image.
outputSizeWidth float32 Output width, in the selected unit (see output.size.unit).
outputSizeHeight float32 Output height, in the selected unit (see output.size.unit).
outputSizeUnit string Measurement unit for output dimensions. [default to "none"]
outputSizeAspectRatio string How to preserve or stretch aspect ratio. [default to "preserve_inset"]
outputSizeAlignX float32 Horizontal alignment (0.0 = left, 0.5 = center, 1.0 = right) when aspect ratio is preserved. [default to 0.5]
outputSizeAlignY float32 Vertical alignment (0.0 = top, 0.5 = center, 1.0 = bottom) when aspect ratio is preserved. [default to 0.5]
outputSizeInputDpi float32 Override the detected DPI of the input image for size computations.
outputSizeOutputDpi float32 DPI setting for the output image.

Return type

*os.File

Authorization

basicAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: image/svg+xml, application/postscript, application/pdf, application/dxf, image/png, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostVectorize

*os.File PostVectorize(ctx).Image(image).ImageUrl(imageUrl).ImageBase64(imageBase64).ImageToken(imageToken).Mode(mode).InputMaxPixels(inputMaxPixels).PolicyRetentionDays(policyRetentionDays).ProcessingMaxColors(processingMaxColors).ProcessingShapesMinAreaPx(processingShapesMinAreaPx).ProcessingPalette(processingPalette).ProcessingColorProfileInput(processingColorProfileInput).ProcessingColorProfileOutput(processingColorProfileOutput).ProcessingParameterizedShapesEllipseGeneralEnabled(processingParameterizedShapesEllipseGeneralEnabled).ProcessingParameterizedShapesEllipseCircleEnabled(processingParameterizedShapesEllipseCircleEnabled).ProcessingParameterizedShapesTriangleGeneralEnabled(processingParameterizedShapesTriangleGeneralEnabled).ProcessingParameterizedShapesTriangleIsoscelesEnabled(processingParameterizedShapesTriangleIsoscelesEnabled).ProcessingParameterizedShapesQuadrilateralGeneralEnabled(processingParameterizedShapesQuadrilateralGeneralEnabled).ProcessingParameterizedShapesQuadrilateralRectangleEnabled(processingParameterizedShapesQuadrilateralRectangleEnabled).ProcessingParameterizedShapesQuadrilateralBulletEnabled(processingParameterizedShapesQuadrilateralBulletEnabled).ProcessingParameterizedShapesStarN3Enabled(processingParameterizedShapesStarN3Enabled).ProcessingParameterizedShapesStarN4Enabled(processingParameterizedShapesStarN4Enabled).ProcessingParameterizedShapesStarN5Enabled(processingParameterizedShapesStarN5Enabled).ProcessingParameterizedShapesStarN6Enabled(processingParameterizedShapesStarN6Enabled).OutputFileFormat(outputFileFormat).OutputShapeStacking(outputShapeStacking).OutputGroupBy(outputGroupBy).OutputDrawStyle(outputDrawStyle).OutputStrokesStrokeWidth(outputStrokesStrokeWidth).OutputStrokesNonScalingStroke(outputStrokesNonScalingStroke).OutputStrokesUseOverrideColor(outputStrokesUseOverrideColor).OutputStrokesOverrideColor(outputStrokesOverrideColor).OutputGapFillerEnabled(outputGapFillerEnabled).OutputGapFillerNonScalingStroke(outputGapFillerNonScalingStroke).OutputGapFillerClip(outputGapFillerClip).OutputGapFillerStrokeWidth(outputGapFillerStrokeWidth).OutputParameterizedShapesFlatten(outputParameterizedShapesFlatten).OutputCurvesLineFitTolerance(outputCurvesLineFitTolerance).OutputCurvesAllowedQuadraticBezier(outputCurvesAllowedQuadraticBezier).OutputCurvesAllowedCubicBezier(outputCurvesAllowedCubicBezier).OutputCurvesAllowedCircularArc(outputCurvesAllowedCircularArc).OutputCurvesAllowedEllipticalArc(outputCurvesAllowedEllipticalArc).OutputSvgVersion(outputSvgVersion).OutputSvgFixedSize(outputSvgFixedSize).OutputSvgAdobeCompatibilityMode(outputSvgAdobeCompatibilityMode).OutputPdfVersion(outputPdfVersion).OutputPdfCompressionMode(outputPdfCompressionMode).OutputEpsVersion(outputEpsVersion).OutputDxfCompatibilityLevel(outputDxfCompatibilityLevel).OutputBitmapAntiAliasingMode(outputBitmapAntiAliasingMode).OutputSizeScale(outputSizeScale).OutputSizeWidth(outputSizeWidth).OutputSizeHeight(outputSizeHeight).OutputSizeUnit(outputSizeUnit).OutputSizeAspectRatio(outputSizeAspectRatio).OutputSizeAlignX(outputSizeAlignX).OutputSizeAlignY(outputSizeAlignY).OutputSizeInputDpi(outputSizeInputDpi).OutputSizeOutputDpi(outputSizeOutputDpi).Execute()

Vectorize an image

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/clv/vectorizer-go"
)

func main() {
	image := os.NewFile(1234, "some_file") // *os.File | Binary file upload of the image to vectorize. Accepts .bmp, .gif, .jpeg, .png, or .tiff files. (optional)
	imageUrl := "imageUrl_example" // string | URL to fetch the input image from for vectorization. (optional)
	imageBase64 := string(BYTE_ARRAY_DATA_HERE) // string | Base64-encoded string of the input image. Maximum size 1 megabyte. (optional)
	imageToken := "imageToken_example" // string | An Image Token returned from an earlier vectorization call with policy.retention_days > 0. (optional)
	mode := "mode_example" // string | Mode of operation, useful during integration work. (optional) (default to "production")
	inputMaxPixels := int32(56) // int32 | Maximum input image size (width × height in pixels) before resizing. (optional) (default to 2097252)
	policyRetentionDays := int32(56) // int32 | Number of days to retain the uploaded image and its results for re-use. (optional) (default to 0)
	processingMaxColors := int32(56) // int32 | Maximum number of colors allowed in the vectorization result. 0 means unlimited. (optional) (default to 0)
	processingShapesMinAreaPx := float32(3.4) // float32 | Minimum shape area (in pixels) to keep in the result; smaller shapes are discarded. (optional) (default to 0.125)
	processingPalette := "processingPalette_example" // string | Palette remapping and color control, using '[color][-> remapped][~ tolerance];' format. (optional)
	processingColorProfileInput := "processingColorProfileInput_example" // string | How to handle ICC profiles embedded in input images. (optional) (default to "ignore")
	processingColorProfileOutput := "processingColorProfileOutput_example" // string | ICC profile behavior for output files: preserve, ignore. (optional) (default to "ignore")
	processingParameterizedShapesEllipseGeneralEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesEllipseCircleEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesTriangleGeneralEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesTriangleIsoscelesEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesQuadrilateralGeneralEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesQuadrilateralRectangleEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesQuadrilateralBulletEnabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesStarN3Enabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesStarN4Enabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesStarN5Enabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	processingParameterizedShapesStarN6Enabled := true // bool | Enable detection and parameterization of this parameterized shape type. (optional) (default to true)
	outputFileFormat := "outputFileFormat_example" // string | Output file format to generate. (optional) (default to "svg")
	outputShapeStacking := "outputShapeStacking_example" // string | Whether shapes are cut out of each other or stacked atop each other. (optional) (default to "cutouts")
	outputGroupBy := "outputGroupBy_example" // string | Grouping of shapes in output. (optional) (default to "none")
	outputDrawStyle := "outputDrawStyle_example" // string | How shapes are rendered. (optional) (default to "fill_shapes")
	outputStrokesStrokeWidth := float32(3.4) // float32 | Width of stroke for shape outlines (when enabled). (optional) (default to 1)
	outputStrokesNonScalingStroke := true // bool | Use non-scaling strokes when drawing shape outlines. (optional) (default to true)
	outputStrokesUseOverrideColor := true // bool | Override shape color with a specific color. (optional) (default to false)
	outputStrokesOverrideColor := "outputStrokesOverrideColor_example" // string | Color value to override shape stroke color if enabled. Must be in '#RRGGBB' or 'rgba(r,g,b,a)' format. (optional) (default to "#000000")
	outputGapFillerEnabled := true // bool | Enable filling small visual gaps caused by vector rendering artifacts. (optional) (default to true)
	outputGapFillerNonScalingStroke := true // bool | Use non-scaling strokes for gap filling. (optional) (default to true)
	outputGapFillerClip := true // bool | Clip gap filler strokes to shape bounds when stacking shapes. (optional) (default to false)
	outputGapFillerStrokeWidth := float32(3.4) // float32 | Width of the gap filler strokes (in output units). (optional) (default to 2)
	outputParameterizedShapesFlatten := true // bool | Whether to flatten detected circles, rectangles, and stars to curves. (optional) (default to false)
	outputCurvesLineFitTolerance := float32(3.4) // float32 | Maximum allowed error when approximating curves with line segments. (optional) (default to 0.1)
	outputCurvesAllowedQuadraticBezier := true // bool | Allow quadratic Bézier curves in the output. (optional) (default to true)
	outputCurvesAllowedCubicBezier := true // bool | Allow cubic Bézier curves in the output. (optional) (default to true)
	outputCurvesAllowedCircularArc := true // bool | Allow circular arcs in the output. (optional) (default to true)
	outputCurvesAllowedEllipticalArc := true // bool | Allow elliptical arcs in the output. (optional) (default to true)
	outputSvgVersion := "outputSvgVersion_example" // string | SVG version to declare in the SVG output. (optional) (default to "svg_1_1")
	outputSvgFixedSize := true // bool | Whether to fix the SVG dimensions in the output file. (optional) (default to false)
	outputSvgAdobeCompatibilityMode := true // bool | Enable Illustrator compatibility by disabling unsupported SVG features. (optional) (default to false)
	outputPdfVersion := "outputPdfVersion_example" // string | PDF version to generate for PDF output. (optional) (default to "PDF_1_4")
	outputPdfCompressionMode := "outputPdfCompressionMode_example" // string | Compression method to apply to PDF output streams. (optional) (default to "Deflate")
	outputEpsVersion := "outputEpsVersion_example" // string | EPS format version for EPS output. (optional) (default to "PS_3_0_EPSF_3_0")
	outputDxfCompatibilityLevel := "outputDxfCompatibilityLevel_example" // string | Level of primitive support for DXF output. (optional) (default to "lines_and_arcs")
	outputBitmapAntiAliasingMode := "outputBitmapAntiAliasingMode_example" // string | Anti-aliasing mode for bitmap (PNG) output. (optional) (default to "anti_aliased")
	outputSizeScale := float32(3.4) // float32 | Overall uniform scaling factor for the output image. (optional)
	outputSizeWidth := float32(3.4) // float32 | Output width, in the selected unit (see output.size.unit). (optional)
	outputSizeHeight := float32(3.4) // float32 | Output height, in the selected unit (see output.size.unit). (optional)
	outputSizeUnit := "outputSizeUnit_example" // string | Measurement unit for output dimensions. (optional) (default to "none")
	outputSizeAspectRatio := "outputSizeAspectRatio_example" // string | How to preserve or stretch aspect ratio. (optional) (default to "preserve_inset")
	outputSizeAlignX := float32(3.4) // float32 | Horizontal alignment (0.0 = left, 0.5 = center, 1.0 = right) when aspect ratio is preserved. (optional) (default to 0.5)
	outputSizeAlignY := float32(3.4) // float32 | Vertical alignment (0.0 = top, 0.5 = center, 1.0 = bottom) when aspect ratio is preserved. (optional) (default to 0.5)
	outputSizeInputDpi := float32(3.4) // float32 | Override the detected DPI of the input image for size computations. (optional)
	outputSizeOutputDpi := float32(3.4) // float32 | DPI setting for the output image. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.VectorizationAPI.PostVectorize(context.Background()).Image(image).ImageUrl(imageUrl).ImageBase64(imageBase64).ImageToken(imageToken).Mode(mode).InputMaxPixels(inputMaxPixels).PolicyRetentionDays(policyRetentionDays).ProcessingMaxColors(processingMaxColors).ProcessingShapesMinAreaPx(processingShapesMinAreaPx).ProcessingPalette(processingPalette).ProcessingColorProfileInput(processingColorProfileInput).ProcessingColorProfileOutput(processingColorProfileOutput).ProcessingParameterizedShapesEllipseGeneralEnabled(processingParameterizedShapesEllipseGeneralEnabled).ProcessingParameterizedShapesEllipseCircleEnabled(processingParameterizedShapesEllipseCircleEnabled).ProcessingParameterizedShapesTriangleGeneralEnabled(processingParameterizedShapesTriangleGeneralEnabled).ProcessingParameterizedShapesTriangleIsoscelesEnabled(processingParameterizedShapesTriangleIsoscelesEnabled).ProcessingParameterizedShapesQuadrilateralGeneralEnabled(processingParameterizedShapesQuadrilateralGeneralEnabled).ProcessingParameterizedShapesQuadrilateralRectangleEnabled(processingParameterizedShapesQuadrilateralRectangleEnabled).ProcessingParameterizedShapesQuadrilateralBulletEnabled(processingParameterizedShapesQuadrilateralBulletEnabled).ProcessingParameterizedShapesStarN3Enabled(processingParameterizedShapesStarN3Enabled).ProcessingParameterizedShapesStarN4Enabled(processingParameterizedShapesStarN4Enabled).ProcessingParameterizedShapesStarN5Enabled(processingParameterizedShapesStarN5Enabled).ProcessingParameterizedShapesStarN6Enabled(processingParameterizedShapesStarN6Enabled).OutputFileFormat(outputFileFormat).OutputShapeStacking(outputShapeStacking).OutputGroupBy(outputGroupBy).OutputDrawStyle(outputDrawStyle).OutputStrokesStrokeWidth(outputStrokesStrokeWidth).OutputStrokesNonScalingStroke(outputStrokesNonScalingStroke).OutputStrokesUseOverrideColor(outputStrokesUseOverrideColor).OutputStrokesOverrideColor(outputStrokesOverrideColor).OutputGapFillerEnabled(outputGapFillerEnabled).OutputGapFillerNonScalingStroke(outputGapFillerNonScalingStroke).OutputGapFillerClip(outputGapFillerClip).OutputGapFillerStrokeWidth(outputGapFillerStrokeWidth).OutputParameterizedShapesFlatten(outputParameterizedShapesFlatten).OutputCurvesLineFitTolerance(outputCurvesLineFitTolerance).OutputCurvesAllowedQuadraticBezier(outputCurvesAllowedQuadraticBezier).OutputCurvesAllowedCubicBezier(outputCurvesAllowedCubicBezier).OutputCurvesAllowedCircularArc(outputCurvesAllowedCircularArc).OutputCurvesAllowedEllipticalArc(outputCurvesAllowedEllipticalArc).OutputSvgVersion(outputSvgVersion).OutputSvgFixedSize(outputSvgFixedSize).OutputSvgAdobeCompatibilityMode(outputSvgAdobeCompatibilityMode).OutputPdfVersion(outputPdfVersion).OutputPdfCompressionMode(outputPdfCompressionMode).OutputEpsVersion(outputEpsVersion).OutputDxfCompatibilityLevel(outputDxfCompatibilityLevel).OutputBitmapAntiAliasingMode(outputBitmapAntiAliasingMode).OutputSizeScale(outputSizeScale).OutputSizeWidth(outputSizeWidth).OutputSizeHeight(outputSizeHeight).OutputSizeUnit(outputSizeUnit).OutputSizeAspectRatio(outputSizeAspectRatio).OutputSizeAlignX(outputSizeAlignX).OutputSizeAlignY(outputSizeAlignY).OutputSizeInputDpi(outputSizeInputDpi).OutputSizeOutputDpi(outputSizeOutputDpi).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `VectorizationAPI.PostVectorize``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostVectorize`: *os.File
	fmt.Fprintf(os.Stdout, "Response from `VectorizationAPI.PostVectorize`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostVectorizeRequest struct via the builder pattern

Name Type Description Notes
image *os.File Binary file upload of the image to vectorize. Accepts .bmp, .gif, .jpeg, .png, or .tiff files.
imageUrl string URL to fetch the input image from for vectorization.
imageBase64 string Base64-encoded string of the input image. Maximum size 1 megabyte.
imageToken string An Image Token returned from an earlier vectorization call with policy.retention_days > 0.
mode string Mode of operation, useful during integration work. [default to "production"]
inputMaxPixels int32 Maximum input image size (width × height in pixels) before resizing. [default to 2097252]
policyRetentionDays int32 Number of days to retain the uploaded image and its results for re-use. [default to 0]
processingMaxColors int32 Maximum number of colors allowed in the vectorization result. 0 means unlimited. [default to 0]
processingShapesMinAreaPx float32 Minimum shape area (in pixels) to keep in the result; smaller shapes are discarded. [default to 0.125]
processingPalette string Palette remapping and color control, using '[color][-> remapped][~ tolerance];' format.
processingColorProfileInput string How to handle ICC profiles embedded in input images. [default to "ignore"]
processingColorProfileOutput string ICC profile behavior for output files: preserve, ignore. [default to "ignore"]
processingParameterizedShapesEllipseGeneralEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesEllipseCircleEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesTriangleGeneralEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesTriangleIsoscelesEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesQuadrilateralGeneralEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesQuadrilateralRectangleEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesQuadrilateralBulletEnabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesStarN3Enabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesStarN4Enabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesStarN5Enabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
processingParameterizedShapesStarN6Enabled bool Enable detection and parameterization of this parameterized shape type. [default to true]
outputFileFormat string Output file format to generate. [default to "svg"]
outputShapeStacking string Whether shapes are cut out of each other or stacked atop each other. [default to "cutouts"]
outputGroupBy string Grouping of shapes in output. [default to "none"]
outputDrawStyle string How shapes are rendered. [default to "fill_shapes"]
outputStrokesStrokeWidth float32 Width of stroke for shape outlines (when enabled). [default to 1]
outputStrokesNonScalingStroke bool Use non-scaling strokes when drawing shape outlines. [default to true]
outputStrokesUseOverrideColor bool Override shape color with a specific color. [default to false]
outputStrokesOverrideColor string Color value to override shape stroke color if enabled. Must be in '#RRGGBB' or 'rgba(r,g,b,a)' format. [default to "#000000"]
outputGapFillerEnabled bool Enable filling small visual gaps caused by vector rendering artifacts. [default to true]
outputGapFillerNonScalingStroke bool Use non-scaling strokes for gap filling. [default to true]
outputGapFillerClip bool Clip gap filler strokes to shape bounds when stacking shapes. [default to false]
outputGapFillerStrokeWidth float32 Width of the gap filler strokes (in output units). [default to 2]
outputParameterizedShapesFlatten bool Whether to flatten detected circles, rectangles, and stars to curves. [default to false]
outputCurvesLineFitTolerance float32 Maximum allowed error when approximating curves with line segments. [default to 0.1]
outputCurvesAllowedQuadraticBezier bool Allow quadratic Bézier curves in the output. [default to true]
outputCurvesAllowedCubicBezier bool Allow cubic Bézier curves in the output. [default to true]
outputCurvesAllowedCircularArc bool Allow circular arcs in the output. [default to true]
outputCurvesAllowedEllipticalArc bool Allow elliptical arcs in the output. [default to true]
outputSvgVersion string SVG version to declare in the SVG output. [default to "svg_1_1"]
outputSvgFixedSize bool Whether to fix the SVG dimensions in the output file. [default to false]
outputSvgAdobeCompatibilityMode bool Enable Illustrator compatibility by disabling unsupported SVG features. [default to false]
outputPdfVersion string PDF version to generate for PDF output. [default to "PDF_1_4"]
outputPdfCompressionMode string Compression method to apply to PDF output streams. [default to "Deflate"]
outputEpsVersion string EPS format version for EPS output. [default to "PS_3_0_EPSF_3_0"]
outputDxfCompatibilityLevel string Level of primitive support for DXF output. [default to "lines_and_arcs"]
outputBitmapAntiAliasingMode string Anti-aliasing mode for bitmap (PNG) output. [default to "anti_aliased"]
outputSizeScale float32 Overall uniform scaling factor for the output image.
outputSizeWidth float32 Output width, in the selected unit (see output.size.unit).
outputSizeHeight float32 Output height, in the selected unit (see output.size.unit).
outputSizeUnit string Measurement unit for output dimensions. [default to "none"]
outputSizeAspectRatio string How to preserve or stretch aspect ratio. [default to "preserve_inset"]
outputSizeAlignX float32 Horizontal alignment (0.0 = left, 0.5 = center, 1.0 = right) when aspect ratio is preserved. [default to 0.5]
outputSizeAlignY float32 Vertical alignment (0.0 = top, 0.5 = center, 1.0 = bottom) when aspect ratio is preserved. [default to 0.5]
outputSizeInputDpi float32 Override the detected DPI of the input image for size computations.
outputSizeOutputDpi float32 DPI setting for the output image.

Return type

*os.File

Authorization

basicAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: image/svg+xml, application/postscript, application/pdf, application/dxf, image/png, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]