4EVERLAND Documents
HomeTwitterDiscordBlogs
  • Welcome to 4EVERLAND
  • Get started
    • Our Features
    • Quick Start Guide
      • Registration
      • Login options
        • MetaMask
        • OKX Wallet
        • Binance Web3 Wallet
        • Bitget Wallet
        • Phantom
        • Petra
        • Lilico
      • Usage Introduction
      • Dashboard stats
      • Account
        • Linking Your EVM Wallet to 4EVERLAND Account
        • Balance Alert
    • Billing and Pricing
      • What is LAND?
      • How to Obtain LAND?
      • Pricing Model
      • Q&As
    • Tokenomics
  • HOSITNG
    • What is Hosting?
      • IPFS Hosting
      • Arweave Hosting
        • Auto-Generation of Manifest
      • Internet Computer Hosting
      • Greenfield Hosting
    • Guides
      • Creating a Deployment
        • With Git
        • With IPFS Hash
        • With a Template
      • Site Deployment
      • Domain Management
        • DNS Setup Guide
        • ENS Setup Guide
        • SNS Setup Guide
          • The gateway: 4sol.xyz
        • SPACE ID Setup Guide
      • Project Setting
        • Git
      • Troubleshooting
      • Common Frameworks
    • Hosting Templates Centre
      • Templates Configuration File
    • Quick Addition
      • Implement Github 4EVER Pin
      • Github Deployment Button
    • Hosting API
      • Create Project API
      • Deploy Project API
      • Get Task Info API
      • IPNS Deployment Update API
    • Hosting CLI
  • Storage
    • Bucket
      • IPFS Bucket
        • Get Root CID - Snapshots
      • Arweave Bucket
        • Path Manifests
          • Instructions for Building Manifest
          • Auto-Generation of Manifest
        • Arweave Tags
        • Unleash Arweave
      • Guides
      • Bucket API - S3 Compatible
        • Coding Examples
          • AWS SDK - Go (Golang)
          • AWS SDK - Java
          • AWS SDK - JavaScript
          • AWS SDK - .NET
          • AWS SDK - PHP
          • AWS SDK - Python
          • AWS SDK - Ruby
        • S3 Tags Instructions
      • 4EVER Security Token Service API
      • Bucket Tools
      • Bucket Gateway Optimizer
    • 4EVER Pin
      • Guides
      • Pinning Services API
      • IPFS Migrator
    • Storage SDK
  • Gateways
    • IPFS Gateway
    • IC Gateway
    • Arweave Gateway
    • Dedicated Gateways
      • Gateway Access Controls
      • Video Streaming
      • IPFS Image Optimizer
    • IPNS Manager
      • IPNS Manager API
  • RPC
    • Guides
    • API Keys
    • JSON Web Token (JWT)
    • What's CUs/CUPS
    • WebSockets
    • Archive Node
    • Debug API
    • Chains RPC
      • BSC / opBNB
      • Ethereum
      • Optimism
      • Polygon
      • Taiko
  • AI
    • AI RPC
      • Quick Start
      • Models
      • API Keys
      • Requests & Responses
      • Parameters
    • 4EVER Chat
  • RaaS - Beta
    • What's Rollups?
    • 4EVER Rollup Stack
  • DePIN
    • 4EVER Network
    • Storage Nodes
  • More
    • Use Cases
      • Livepeer
      • Lens Protocol
      • Optopia.ai
      • Linear Finance
      • Snapshot
      • Tape
      • Taiko
      • Hey.xyz
      • SyncSwap
    • Community
    • Tutorials
    • Security
    • 4EVERLAND FAQ
Powered by GitBook
On this page
  • API Usage:
  • Parameters
  • Width
  • Height
  • Aspect Ratio Crop
  • Quality
  • Sharpen
  • Blur
  • Crop
  • Crop Gravity
  • Flip
  • Flop
  • Brightness
  • Saturation
  • Hue
  • Contrast
  • Automatic Optimization
  • Sepia
  1. Storage
  2. Bucket

Bucket Gateway Optimizer

Last updated 1 year ago

The 4EVERLAND Optimizer is a real-time dynamic image optimization service that automatically optimizes images to accelerate image transmission speed and save bandwidth.

It uses a simple API to process images in your 4EVERLAND Bucket.

API Usage:

Request Format:

{yourBucketName}.4everland.store/{fileName}?{parameter}={value}

Example:

To crop the file 04.jpeg in the 'opflower' Bucket to a width of 250 and height of 150, with an aspect ratio of 5:3, the API request would be:

opflower.4everland.store/04.jpeg?width=250&height=150&aspect_ratio=2:3

Request Result:

Original Image Before Processing:

Optimizer does not support the use of custom Bucket gateways at this time.

Parameters

Width

Parameter: width Units: Pixels Default: auto

Resize the output image to the given width maintaining the current aspect ratio.

Aspect Ratio Crop has priority over the Width or Height commands. If the Aspect Ratio Crop is defined in the query and is not set to auto, it will be applied first.

Aspect Ratio Crop has priority over the Width or Height commands. If the Aspect Ratio Crop is defined in the query and is not set to auto, it will be applied first.

?width=250

?width=100

Height

Parameter: height Units: Pixels Default: auto

Resize the output image to the given width maintaining the current aspect ratio.

?height=250

?height=100

Aspect Ratio Crop

Parameter: aspect_ratio Units: Pixels Default: auto

Crop the output image to match the given aspect ratio. The default origin point (gravity) is positioned on the center of the image.

?aspect_ratio=1:1

?aspect_ratio=2:1

Quality

Parameter: quality Units: Percent Range: 0-100 Default: 85

Determines the compression level of the resulting image with 100 being the lowest level of compression and 0 being the highest. Higher compression means smaller files, but might visually degrade the image (e.g. JPEG compression under 70 tends to produce visible artefacts.

?quality=10

?quality=100

Sharpen

Parameter: sharpen Units: Boolean Default: false

Sharpen the output image.

?sharpen=true

?sharpen=false

Blur

Parameter: blur Units: Number Range: 0-100 Default: 0

Blur the output image.

?blur=10

?blur=30

Crop

Parameter: crop Units: Pixels Format 1: width,height Format 2: width,height,x,y

Crop the output image to the given width and height. Two formats are accepted. Format 1 one only includes the width and height of the crop. Format 2 also includes the X and Y position where the crop should start. Image resizing with the width and height parameters is processed after the crop and the resized measurements apply.

If only width and height are given, the Crop Gravity parameter will be used.

?crop=180,60

?crop=180,60,10,10

Crop Gravity

Parameter: crop_gravity Default: center

Values: center, forget, east, north, south, west, northeast, northwest, southeast, southwest

Set the gravity of the crop operation. This is used with the Format 1 cropping only and snaps the crop to the selected position.

?crop=180,60&crop_gravity=center

?crop=180,60&crop_gravity=northeast

Flip

Parameter: flip Units: Boolean Default: false

Flip the output image vertically.

?flip=true

?flip=false

Flop

Parameter: flop Units: Boolean Default: false

Flip the output image horizontally.

?flop=true

?flop=false

Brightness

Parameter: brightness Units: Number Range: -100-100 Default: 0

Adjusts the brightness of the output image. This can either brighten or darker the image.

?brightness=80

?brightness=-20

Saturation

Parameter: saturation Units: Number Range: -100 - 100 Default: 0

Adjusts the saturation of the output image. Use -100 for grayscale.

?saturation=80

?saturation=-20

Hue

Parameter: hue Units: Number Range: 0-100 Default: 0

Adjusts the hue of the output image by rotating the color wheel. The default value of 0 is the base color and increasing the value modulates to the next color for each 33 change.

?hue=80

?hue=20

Contrast

Parameter: contrast Units: Number Range: -100 - 100 Default: 0

Adjusts the contrast of the output image.

?contrast=-20

?contrast=80

Automatic Optimization

Parameter: auto_optimize Units: String Values: low,medium,high Default: none

Automatically enhance the output image with multiple levels of optimizations. With high, sharpening is also applied automatically.

?auto_optimize=low

?auto_optimize=high

Sepia

Parameter: sepia Units: Integer Values: 0 - 100 Default: 0

Changes the image color to the sepia color scheme.

?sepia=20

?sepia=80