Skip to main content
POST
/
api
/
v1
/
analyze
Analyze Design
curl --request POST \
  --url https://api.example.com/api/v1/analyze \
  --header 'Content-Type: application/json' \
  --data '
{
  "imageUrl": "<string>",
  "imageData": "<string>",
  "quantity": 123
}
'
{
  "colors": {
    "count": 123,
    "dominant": [
      {}
    ],
    "pantone": [
      {}
    ]
  },
  "dimensions": {
    "width": 123,
    "height": 123,
    "aspectRatio": 123,
    "hasTransparency": true
  },
  "recommendation": {
    "technique": "<string>",
    "reason": "<string>",
    "complexity": "<string>"
  },
  "pricing": {
    "dtg": {},
    "screen": {}
  },
  "warnings": [
    {}
  ]
}

Analyze Design

Analyze a design image for color count, complexity, and recommended print technique.
This endpoint is free — no tokens required.

Endpoint

POST https://garmint.app/api/v1/analyze

Request Body

imageUrl
string
URL of the design image to analyze. Must be publicly accessible.
imageData
string
Base64-encoded image data. Use this for direct uploads.
quantity
number
default:"50"
Target print quantity for pricing estimates (1-10,000).
Provide either imageUrl OR imageData, not both.

Response

colors
object
Color analysis results.
dimensions
object
Image dimension analysis.
recommendation
object
Print technique recommendation.
pricing
object
Estimated pricing by technique.
warnings
array
Array of potential issues detected.

Example

curl -X POST https://garmint.app/api/v1/analyze \
  -H "Authorization: Bearer gm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/my-design.png",
    "quantity": 100
  }'

Response Example

{
  "colors": {
    "count": 5,
    "dominant": ["#1a1a1a", "#ff6b6b", "#4ecdc4", "#ffffff", "#2c3e50"],
    "pantone": ["Black C", "Warm Red C", "3242 C"]
  },
  "dimensions": {
    "width": 2400,
    "height": 3000,
    "aspectRatio": 0.8,
    "hasTransparency": true
  },
  "recommendation": {
    "technique": "dtg",
    "reason": "Design has 5 colors with gradients - DTG handles color complexity well",
    "complexity": "moderate"
  },
  "pricing": {
    "dtg": {
      "perUnit": 8.50,
      "currency": "USD"
    },
    "screen": {
      "perUnit": 4.25,
      "setup": 125.00,
      "minimumQuantity": 24,
      "currency": "USD"
    }
  },
  "warnings": [
    "Design has significant transparency - consider the garment color"
  ]
}

Use Cases

Pre-flight Check

Run analysis before generation to catch issues:
async function validateDesign(designUrl: string) {
  const analysis = await analyzeDesign(designUrl);
  
  if (analysis.colors.count > 12) {
    console.warn('High color count may increase costs');
  }
  
  if (analysis.dimensions.width < 1000) {
    throw new Error('Design resolution too low for quality print');
  }
  
  if (analysis.warnings.length > 0) {
    console.warn('Warnings:', analysis.warnings);
  }
  
  return analysis;
}

Dynamic Pricing

Use analysis to show customers estimated costs:
function calculateQuote(analysis: AnalysisResult, quantity: number) {
  const { pricing } = analysis;
  
  // Compare DTG vs Screen for this quantity
  const dtgTotal = pricing.dtg.perUnit * quantity;
  const screenTotal = pricing.screen.setup + (pricing.screen.perUnit * quantity);
  
  return {
    dtg: { total: dtgTotal, perUnit: pricing.dtg.perUnit },
    screen: { total: screenTotal, perUnit: screenTotal / quantity },
    recommended: quantity >= 50 ? 'screen' : 'dtg',
  };
}
TechniqueBest ForColor Limit
DTGFull-color, photos, gradientsUnlimited
ScreenSimple designs, large runs1-8 colors
EmbroideryLogos, text, premium look1-15 colors
VinylNames, numbers, simple shapes1-3 colors