tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Image Advanced Compression

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-03-01 14:57: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

[//]: # ".cssg-snippet-ci-download-compress-image"
# 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.

Ajuda e Suporte

Esta página foi útil?

comentários