tencent cloud

masukan

Image Advanced Compression

Terakhir diperbarui:2024-02-05 11:05:12

    Overview

    This document provides an overview of APIs and SDK code samples for image advanced compression.
    API
    Description
    Compresses an image in a specified bucket.

    Image Advanced Compression

    Feature description

    CI uses the imageMogr2 API to provide the image advanced compression feature.

    Method prototype

    ci_download_compress_image(self, Bucket, Key, DestImagePath, CompressType, **kwargs)

    Sample request

    # TPG compression
    response = client.ci_download_compress_image(
    Bucket='examplebucket-1250000000',
    Key='sample.png',
    DestImagePath='sample.tpg',
    CompressType='tpg'
    )
    
    # HEIF compression
    response = client.ci_download_compress_image(
    Bucket='examplebucket-1250000000',
    Key='sample.png',
    DestImagePath='sample.heif',
    CompressType='heif'
    )

    Parameter description

    Parameter
    Description
    Type
    Required
    Bucket
    Bucket name in the format of BucketName-APPID. For more information, see Bucket Overview.
    String
    Yes
    Key
    Object key. It can contain up to 128 bytes of letters, digits, spaces, plus signs, minus signs, underscores, equal signs, dots, colons, and slashes.
    String
    Yes
    DestImagePath
    Local path to save the compressed image
    String
    Yes
    CompressType
    Compression format, which can be TPG or HEIF.
    String
    Yes

    Response description

    This API returns the response header.
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24