Pixel Avatar Generator API

Playground

Seed 기반의 결정적(Deterministic) 픽셀 아바타 생성 API입니다. 같은 seed는 항상 같은 아바타를 생성하여 프로필 이미지 등에 활용할 수 있습니다.

Features

Deterministic

같은 seed는 항상 같은 아바타 생성

Multiple Formats

PNG, SVG, JSON 출력 지원

Scalable

16px ~ 512px 크기 지원

Base URL

https://studyroom.vercel.app/api/avatar

Endpoints

GET/api/avatar/{resolution}/random

랜덤 아바타를 생성합니다. 매 요청마다 새로운 아바타가 생성됩니다.

Path Parameters

ParameterTypeDescription
resolutionstring8bit (16x16) 또는 16bit (32x32)

Example Request

curl "https://studyroom.vercel.app/api/avatar/16bit/random?size=128"
GET/api/avatar/{resolution}/seed/{seed}

Seed 기반 결정적 아바타를 생성합니다. 같은 seed는 항상 같은 아바타를 반환합니다.

Path Parameters

ParameterTypeDescription
resolutionstring8bit (16x16) 또는 16bit (32x32)
seedstring아무 문자열 (username, email, UUID 등)

Example Request

curl "https://studyroom.vercel.app/api/avatar/8bit/seed/john@example.com?size=64"

Query Parameters

ParameterTypeDefaultDescription
sizenumber64출력 크기 (16-512)
formatstringpngpng - 래스터 이미지
svg - 벡터 이미지
json - 아바타 파라미터

Resolution

8bit
16x16 pixels
레트로 스타일
16bit
32x32 pixels
디테일한 스타일

Response Formats

PNG (default)

래스터 이미지로 반환됩니다.

Content-Type: image/png

SVG

벡터 이미지로 반환됩니다. 무한 확대 가능.

Content-Type: image/svg+xml

JSON

아바타 생성에 사용된 파라미터를 반환합니다.

{
  "seed": "example",
  "resolution": "16bit",
  "face": { "type": "round", "skinTone": "#E8B88A", ... },
  "hair": { "type": "medium", "color": "#2C1810", ... },
  "accessories": { "hat": "none", "glasses": "none", ... }
}

Usage Examples

HTML

<img
  src="https://studyroom.vercel.app/api/avatar/16bit/seed/username"
  alt="User Avatar"
  style="image-rendering: pixelated;"
/>

React

function Avatar({ userId, size = 64 }) {
  return (
    <img
      src={`/api/avatar/16bit/seed/${userId}?size=${size}`}
      alt="User Avatar"
      style={{ imageRendering: 'pixelated' }}
    />
  );
}

cURL

# Download PNG avatar
curl -o avatar.png "https://studyroom.vercel.app/api/avatar/16bit/seed/myuser?size=256"

# Get SVG format
curl "https://studyroom.vercel.app/api/avatar/8bit/seed/myuser?format=svg" > avatar.svg

CORS

모든 API 엔드포인트는 CORS가 활성화되어 있어 외부 도메인에서도 호출 가능합니다.

studyroom.im