This page was machine-translated. Spotted a mistake?Help improve it.
Skip to content

Meme Generator

Buat meme menggunakan template bawaan atau gambar kustom. Tambahkan teks dengan gaya meme klasik (teks tebal dengan garis tepi), beberapa preset tata letak, dan pilihan font.

API Endpoint

POST /api/v1/tools/image/meme-generator

Menerima salah satu dari:

  • Multipart form data dengan berkas gambar dan field JSON settings (mode gambar kustom)
  • JSON body dengan templateId (mode template, tanpa perlu unggah berkas)

Parameters

ParameterTypeRequiredDefaultDescription
templateIdstringNo-ID template meme bawaan. Jika disediakan, tidak perlu mengunggah gambar
textLayoutstringNo"top-bottom"Tata letak kotak teks: top-bottom, top-only, bottom-only, center, side-by-side
textBoxesarrayNo[]Array objek kotak teks dengan field id dan text
fontFamilystringNo"anton"Font: anton, arial-black, comic-sans, montserrat, bebas-neue, permanent-marker, roboto
fontSizenumberNoautoUkuran font dalam piksel (8 hingga 200). Dihitung otomatis jika dihilangkan
textColorstringNo"#ffffff"Warna isi teks
strokeColorstringNo"#000000"Warna garis tepi/outline teks
textAlignstringNo"center"Perataan teks: left, center, right
allCapsbooleanNotrueUbah teks menjadi huruf besar

Text Boxes

Setiap entri dalam array textBoxes harus memiliki:

FieldTypeDescription
idstringPengenal kotak yang cocok dengan tata letak (mis., "top", "bottom", "left", "right", "center")
textstringTeks meme yang akan ditampilkan

Text Layout Box IDs

LayoutAvailable Box IDs
top-bottomtop, bottom
top-onlytop
bottom-onlybottom
centercenter
side-by-sideleft, right

Example Request

Gambar kustom dengan teks atas dan bawah:

bash
curl -X POST http://localhost:1349/api/v1/tools/image/meme-generator \
  -H "Authorization: Bearer si_your-api-key" \
  -F "[email protected]" \
  -F 'settings={"textLayout": "top-bottom", "textBoxes": [{"id": "top", "text": "When the code works"}, {"id": "bottom", "text": "On the first try"}], "fontFamily": "anton", "allCaps": true}'

Menggunakan template bawaan (JSON body, tanpa unggah berkas):

bash
curl -X POST http://localhost:1349/api/v1/tools/image/meme-generator \
  -H "Authorization: Bearer si_your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"templateId": "drake", "textBoxes": [{"id": "top", "text": "Manual testing"}, {"id": "bottom", "text": "Automated tests"}]}'

Example Response

json
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/meme-drake.png",
  "originalSize": 450000,
  "processedSize": 520000
}

Notes

  • Salah satu dari templateId atau berkas gambar yang diunggah wajib disediakan. Menyediakan keduanya akan menggunakan template.
  • Template menentukan posisi kotak teksnya sendiri; parameter textLayout diabaikan saat menggunakan template.
  • Teks dirender sebagai SVG dengan outline garis tepi untuk tampilan meme klasik.
  • Ukuran font dihitung otomatis agar pas dengan kotak teks jika tidak diatur secara eksplisit.
  • Kotak teks kosong dilewati (tidak ada rendering yang terjadi jika semua kotak kosong).
  • Nama berkas output menyertakan ID template saat menggunakan template (mis., meme-drake.png).
  • Input HEIC, RAW, PSD, dan SVG didekode secara otomatis sebelum diproses.