Magic Image

फ्रीमियम
द्वारा chr15m | अपडेट किया गया 14日前 | Media
लोकप्रियता

7.8 / 10

लेटेंसी

302ms

सेवा का स्तर

100%

Health Check

N/A

सभी ट्यूटोरियल पर वापस जाएं (3)

Simple curl example to resize and convert an image

You can use curl with this API to manipulate an image from the command line.

Here’s an example which will read image.png from the local file system, upload it, and apply the -resize 300 commnd. This will return an image that has been resized to a maximum of 300 pixels.

curl -s -X POST -H "Content-Type: multipart/form-data" -H "X-RapidAPI-Key: ${RAPIDAPI_KEY}"\
    -F "image=@image.png" -F "args=-resize 300" https://magic-image.p.rapidapi.com/convert-cli/output.jpg -o output.jpg

You’ll need to set the environment variable RAPIDAPI_KEY first:

export RAPIDAPI_KEY="...your key value..."