このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Using Image Processing on OBS Console

Updated on 2024-10-24 GMT+08:00

Process

On the image processing page of OBS Console, you can create a processing style for an image by specifying parameters on the GUI or by editing code. You can then view the new image effect on the Preview Image tab page on the image's details page. You can also click Copy Link to get the link for accessing the new image.

You can use OBS Console, OBS SDKs, or REST APIs to process images. Figure 1 shows the flowchart of using image processing on OBS Console.

Figure 1 Flowchart of using image processing on OBS Console

Procedure 1: Logging In to OBS Console

Before using image processing, you must have a cloud service account and enable OBS. Once OBS is enabled, image processing is available for use. To use OBS properly, make sure that you have sufficient account balance or you have a valid payment method. If you have already enabled OBS and you can use it properly, skip this section.

  1. Visit the Huawei Cloud official website.
  2. Create a HUAWEI ID.

    If you already have one, start from 3.
    1. On the right of the top navigation bar, click Sign Up.
    2. Complete the account creation as instructed.

      After the creation is complete, you will be navigated to your information page.

  3. On the right of the top navigation bar, click Sign In, and enter the username and password.
  4. On the right of the top navigation menu, click Console to go to the management console.
  5. Click Service List and choose Storage > Object Storage Service.
  6. (Recommended) Make sure that you have sufficient account balance or you have a valid payment method, so that you can properly use OBS.

Procedure 2: Uploading an Image

NOTE:

For the constraints on the format and size of images you can upload, see Notes and Constraints.

  1. On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
  2. In the bucket list, click the bucket you want to go to the Objects page.
  3. Click Upload Object to open the Upload Object dialog box.
  4. Click add files marked by red box in Figure 2 to open the local file browser.

    Figure 2 Uploading an image

  5. Select the image that you want to upload and click Open.
  6. Click Upload.

Procedure 3: Creating an Image Style

Each image style specifies a set of processing operations, including cropping, compression, and adding watermarks. For multiple images that require the same processing operations in a bucket, you can create an image style to apply it to the images.

When creating a style, you can preview the style effect of the sample image on the right in real time.

When using REST APIs to access image processing, you can call the style name in the URL to avoid entering complex commands. For details about the domain name rules for API access, see Access with a Style Name.

You can create up to 100 styles for a bucket.

You can also replicate existing image processing styles from another bucket.

NOTE:

If you are an IAM user, before creating an image style, make sure that programmatic access has been enabled for yourself. For details, see Viewing or Modifying IAM User Information.

  1. On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
  2. Click a desired bucket name. In the navigation pane, choose Data Processing > Image Processing.

    Figure 3 Image processing


  3. Click Create to go to the style editing page shown in Figure 4.

    Figure 4 Creating a style


  4. On the editing page, specify a style name and configure properties:

    • Style Name

      Enter an easy-to-remember style name. Only letters (uppercase or lowercase), digits, periods (.), underscores (_), and hyphens (-) are allowed. The style name contains 1 to 256 characters, for example, rotate_0001.

    • Edit Mode

      Choose either GUI or Code to create an image style by configuring parameters or by editing code.

      An example code is as follows:

      image/sharpen,100/blur,r_1,s_1/resize,m_lfit,h_400,w_400,limit_1
    • Other settings

      Configure the image effect, resizing, watermark, and output.

  5. Click OK to save the style. The new style will be displayed in the style list.

Replicating Image Styles

You can replicate an existing image style to quickly create one.

  1. On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
  2. Click a desired bucket name. In the navigation pane, choose Data Processing > Image Processing.
  3. Click Replicate.
  4. Select a replication source, which is the source bucket where the required image styles were configured.

    NOTE:
    • The image styles replicated from a source bucket will not overwrite existing styles in the current bucket, and any that conflict with the existing ones will not be replicated.
    • The version of both source and destination buckets must be 3.0.
    • You can remove the styles that you do not want to replicate.
    Figure 5 Replicating image styles


  5. Click OK to replicate the image styles to the current bucket.

Procedure 4: Using the Image Style

You can use existing image styles in a bucket in either of the following ways:

  • Copying a link (see Copying a Link): On an image's details page of OBS Console, you can copy a link for accessing the image with a style applied on the Preview Image tab page. By pasting the copied link in a browser, you can get the new image.
  • Editing a domain name: You can edit a domain name by referring to the format given below and open it in a browser to have the image with the style applied.
    <Image link>?x-image-process=style/<Style name>

    Image link can be obtained from the image details page. For details, see Editing a Domain Name. Style name is the one defined when the style was created. A style name can contain only uppercase or lowercase letters, digits, periods (.), underscores (_), and hyphens (-) and is 1 to 256 characters long, for example, rotate_0001.

Copying a Link

  1. On the console homepage, click Service List in the upper left corner and choose Storage > Object Storage Service.
  2. Click the name of the bucket that houses desired styles to go to the Objects page.
  3. Click the name of an existing image or of a newly uploaded image to go to its details page.
  4. Click the Preview Image tab to preview the image effect in one or more styles.

    Figure 6 Preview Image

  5. Click Copy Link in the style card you want. If Copied successfully. is prompted, you have got the link for accessing the image with the style applied.

Editing a Domain Name

  1. On the OBS object list page, click an image to be processed to go to its details page.
  2. Choose Object ACL > User Access > Anonymous User and click Edit. In the displayed dialog box, grant the object read permission to anonymous users and click OK. For details, see Figure 7.

    Figure 7 Granting the object read permission to anonymous users


  3. Click the icon next to Link to copy the image link.
  4. Add ?x-image-process=style/<Style name> to the end of the copied link and open the new link in a browser. Then, you can access the image with the style applied.

    Link example:

    https://bucketname.obs.ap-southeast-1.myhuaweicloud.com/example.jpg?x-image-process=style/stylename

    NOTE:

    The links and style names above are for reference only. Change them accordingly in practice.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback