Bildverktyg API
Slutpunkter for bildkomprimering, storleksandring, konvertering, rotation, beskaring, bakgrundsborttagning, uppskalning, ansiktsoskarpning och vattenmarkning. Alla slutpunkter accepterar multipart/form-data och returnerar den bearbetade bilden som en binar fil.
Bildkomprimering
/api/image-compressKomprimera en bild for att minska filstorleken med bibehallen visuell kvalitet. Stoder JPEG, PNG och WebP-format.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil (JPG, PNG, WebP) |
quality | number | Optional | Komprimeringskvalitet, 10-100. Standard: 80 |
targetSizeKB | number | Optional | Malfilstorlek i KB. Asidosatter kvalitet om angiven. |
keepMetadata | string | Optional | Satt till "true" for att bevara EXIF-metadata |
Binary filecurl -X POST https://freefiletools.io/api/image-compress \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "quality=75" \
-o compressed.jpgAndra bildstorlek
/api/image-resizeAndra storlek pa en bild till specifika dimensioner eller i procent. Stoder pixeldimensioner och procentuell skalning.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
width | number | Optional | Malbredd i pixlar |
height | number | Optional | Malhojd i pixlar |
percentage | number | Optional | Skalningsprocent (t.ex. 50 for halva storleken) |
fit | string | Optional | "inside" (behall proportioner) eller "fill" (stracks till exakta dimensioner) |
Binary file# Resize to specific width (height auto-calculated)
curl -X POST https://freefiletools.io/api/image-resize \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "width=800" \
-o resized.jpg
# Resize by percentage
curl -X POST https://freefiletools.io/api/image-resize \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "percentage=50" \
-o resized.jpgBildkonvertering
/api/image-convertKonvertera en bild mellan format. Stoder PNG, JPG, WebP och AVIF.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
format | string | Required | Malformat: "png", "jpg", "webp" eller "avif" |
quality | number | Optional | Utdatakvalitet, 10-100 |
Binary filecurl -X POST https://freefiletools.io/api/image-convert \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "format=webp" \
-F "quality=85" \
-o photo.webpBildrotering
/api/image-rotateRotera och/eller vand en bild. Stoder godtyckliga rotationsvinklar och horisontell/vertikal vandning.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
angle | number | Required | Rotationsvinkel i grader (t.ex. 90, 180, 270) |
flipH | string | Optional | Satt till "true" for att vanda horisontellt |
flipV | string | Optional | Satt till "true" for att vanda vertikalt |
Binary filecurl -X POST https://freefiletools.io/api/image-rotate \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "angle=90" \
-o rotated.jpgBildbeskaring
/api/image-cropBeskar en bild till ett specifikt rektangulart omrade.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
x | number | Required | Vansterforskjutning av beskarningsrektangeln i pixlar |
y | number | Required | Ovre forskjutning av beskarningsrektangeln i pixlar |
width | number | Required | Bredd pa beskarningsrektangeln i pixlar |
height | number | Required | Hojd pa beskarningsrektangeln i pixlar |
Binary filecurl -X POST https://freefiletools.io/api/image-crop \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "x=100" \
-F "y=50" \
-F "width=500" \
-F "height=400" \
-o cropped.jpgTa bort bakgrund
/api/remove-bgTa automatiskt bort bakgrunden fran en bild. Returnerar en PNG med transparent bakgrund.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
PNG-bild med transparent bakgrundcurl -X POST https://freefiletools.io/api/remove-bg \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o no-background.pngBildupskalning
/api/image-upscaleSkala upp en bild med AI for att oka upplosningen med bibehallen detalj.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
scale | number | Optional | Uppskalningsfaktor: 2 eller 4. Standard: 2 |
Binary filecurl -X POST https://freefiletools.io/api/image-upscale \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "scale=4" \
-o upscaled.jpgGora ansikte oskarpt
/api/blur-faceDetektera och gor automatiskt alla ansikten i en bild oskarpa for integritetsskydd.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
Binary filecurl -X POST https://freefiletools.io/api/blur-face \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o blurred.jpgVattenmark bild
/api/watermark-imageLagg till en textvattenstampel pa en bild. Anpassa text och position.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Bildfil |
text | string | Required | Vattenstampeltext |
position | string | Optional | Position: "center", "top-left", "top-right", "bottom-left", "bottom-right" |
Binary filecurl -X POST https://freefiletools.io/api/watermark-image \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "text=Copyright 2024" \
-F "position=bottom-right" \
-o watermarked.jpg