Converts an HEIC image into a PNG image using the pyheif
package and FastAPI
pip install -r requirements.txt
Run either one of the following commands in your terminal
python main.py
or
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
/heif2png http://localhost:8000/heif2png
Name | Required | Type | Description |
---|---|---|---|
save_flag |
optional | bool | Indicates if images are to be saved locally in server Default is False |
files = {
"file": ("image_file_name", "image_file_bytes")
}
{
"status": "ok",
"format": "heic",
"heif_file_size": [
1280,
720
],
"in_filename": "C001.heic",
"out_filename": "C001.png",
"converted_png_data": "base64 encoded image data"
}
{
"status": "error",
"details": "image is not heic format"
}
/docs http://localhost:8000/docs