Profile Picture Maker

Profile Picture Maker API

Design

Turn any photo into a polished profile picture: remove the background, add a colour, gradient or pattern backdrop, crop to a circle and add a ring.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

10 requests per minute

Endpoints

1 endpoint available

Overview

Turns one photo into a square profile picture PNG. By default an AI model (BiRefNet) removes the photo's background and the subject is placed on a new backdrop: a gradient, solid colour, pattern, the original background, or transparency. The picture is framed as a circle, rounded square or square (outside the shape is transparent), with an optional outline or glow around the subject, a ring around the frame and a drop shadow. It uses the same renderer as the web page.

Framing

  • zoom 1 means the photo just covers the frame. It can go down to 0.5 when the background is removed and replaced; otherwise the minimum is 1. The maximum is 5.
  • offsetX and offsetY move the photo's centre from the frame's centre, in frame widths (0.1 = 10% of the frame). They are clamped so the photo never leaves a gap at the frame's edge.
  • Leave all three out for the page's starting view: centred, with tall photos nudged down so the upper part (where a face usually is) stays in frame.
  • With removeBackground=false, the backdrop and outline settings have no effect and the photo fills the frame.

Limits and behavior

  • Send the photo as multipart/form-data in the file field: JPEG, PNG, WebP, GIF (first frame), AVIF or TIFF, up to 20 MB. HEIC is not supported. Photos are worked on at up to 2048 px on the long edge.
  • This endpoint can call a paid AI model, so it always uses the AI tier: 10 requests a minute and 200 a day per API key, even with removeBackground=false.
  • Booleans are the strings true or false. Colours are hex, #rgb or #rrggbb.
  • Photos and results are not stored. The response body is the PNG itself; errors are JSON.

Endpoints

POST
https://opentools.ca/api/v1/tools/profile-picture-maker
Make a square profile picture PNG from a photo

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
file
file
Required
The photo. JPEG, PNG, WebP, GIF, AVIF or TIFF, up to 20 MB.
removeBackground
boolean
OptionalRemove the photo background with AI and use the backdrop instead.Default: true
size
number
Enum: 400, 800, 1024
OptionalWidth and height of the PNG in pixels.Default: 1024
shape
string
Enum: circle, rounded, square
OptionalFrame shape. Outside a circle or rounded square is transparent.Default: circle
backdrop
string
Enum: gradient, solid, pattern, original, transparent
OptionalWhat goes behind the subject when the background is removed.Default: gradient
colour
string
OptionalBackdrop colour for backdrop=solid.Default: #ffffff
gradientFrom
string
OptionalStart colour for backdrop=gradient.Default: #f8fafc
gradientTo
string
OptionalEnd colour for backdrop=gradient.Default: #cbd5e1
gradientAngle
number
OptionalGradient angle in degrees, 0-360, as in CSS (0 points up, 90 points right).Default: 180
pattern
string
Enum: dots, stripes, sunburst, grid
OptionalPattern for backdrop=pattern.Default: dots
patternBase
string
OptionalPattern background colour. Defaults to the page preset for the pattern (dots #f1f5f9, stripes #dbeafe, sunburst #fdba74, grid #f8fafc).
patternInk
string
OptionalPattern colour. Defaults to the page preset (dots #cbd5e1, stripes #bfdbfe, sunburst #fb923c, grid #cbd5e1).
outline
string
Enum: none, outline, glow
OptionalSticker-style outline or soft glow around the cut-out subject.Default: none
outlineColour
string
OptionalOutline or glow colour.Default: #ffffff
outlineSize
number
OptionalOutline or glow size as a fraction of the picture width, 0.005-0.04.Default: 0.015
ringWidth
number
OptionalRing around the frame as a fraction of the picture width, 0-0.08. 0 means no ring.Default: 0
ringColour
string
OptionalRing colour.Default: #ffffff
shadow
boolean
OptionalSoft drop shadow under the subject.Default: false
zoom
number
OptionalPhoto zoom, 0.5-5 (1 = just covers the frame). See Framing.
offsetX
number
OptionalHorizontal offset of the photo centre, in frame widths. See Framing.
offsetY
number
OptionalVertical offset of the photo centre, in frame widths. See Framing.

Response Example

The body is the picture (Content-Type: image/png), sent as an attachment named "<photo name>-profile-<size>.png". Errors return JSON, for example:
{
  "success": false,
  "error": "Invalid request.",
  "details": [
    {
      "field": "shape",
      "message": "Invalid enum value. Expected 'circle' | 'rounded' | 'square', received 'oval'"
    }
  ]
}

Error Codes

400
Bad Request - No file, an invalid option, or the image could not be read
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key inactive, expired, or not allowed from this IP
413
Payload Too Large - The file is over 20 MB
415
Unsupported Media Type - The file is not a JPEG, PNG, WebP, GIF, AVIF or TIFF image
422
Unprocessable - The AI model could not process that image
429
Too Many Requests - Over 10 a minute or 200 a day for this key
500
Internal Server Error
502
Bad Gateway - The AI model is busy or returned no image
503
Service Unavailable - Background removal is not available right now
504
Gateway Timeout - Background removal took too long

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/profile-picture-maker \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@me.jpg" \
  -F "backdrop=solid" \
  -F "colour=#0a66c2" \
  -F "ringWidth=0.02" \
  -F "size=800" \
  -o me-profile.png

Ready to get started?

Create an API key to start using the Profile Picture Maker API.

Rather use it in your browser? Open the Profile Picture Maker