Docs | imagemash.io
DashboardSign up for Free
  • 🎉imagemash.io
  • 🚀Getting Started
    • Simple CDN Link Usage
  • 💽Sources
    • IM Cloud Storage
    • Image URL
    • Storage Providers
      • Amazon S3
      • Google Cloud
      • S3 Compatible Storage
    • Web Folder
  • 🖼️Image Transform
    • Transform Options
      • Quality
      • Width
      • Height
      • Scale
      • Crop
      • Gravity
      • Background
      • Border
      • Round
      • Output Format
      • Angle (Rotate)
      • Flip
      • Helpers
        • x, y
      • Filters
        • Tint
        • Flatten
        • Grayscale
        • Blur
        • Sharpen
        • Median
        • Threshold
        • Negative
    • Transform Cheat Sheet
    • Named Transforms
  • 🛠️API
    • API - Good to knows
    • API Methods
      • Account
        • Named Transforms
          • Get named transforms
          • Add named transform
          • Remove named transform
        • Image URL Restriction
          • Get keyword list
          • Add keyword to list
          • Remove keyword from list
          • Change keyword list usage
      • Storage
        • Upload file
        • Get and search files
        • Delete files
        • Add new tags to files
        • Set tags of files
        • Remove tags from files
        • Purge Cache
      • Optimize / Transform
  • ❓How it works?
    • Custom Domain
    • Bandwidth
    • Cloud Storage
    • Caching
    • Purge Cache
    • Limits
  • Contact Us
Powered by GitBook
On this page
  • Understand Main Crop Types
  • Original Image
  • Cover (default) - c_cover
  • Contain - c_contain
  • Fill - c_fill
  • Crop - c_crop
  • Thumb - c_thumb
  1. Image Transform
  2. Transform Options

Crop

crop - c - c_<crop type>

PreviousScaleNextGravity

Last updated 2 years ago

Value
Type
Description

crop type

string

Default Value: cover

Value can be;

  • cover

  • contain

  • fill

Sets the crop type of image. When both and are provided, the original image aspect ratio might get broken. By changing crop type, you can adjust the aspect ratio.

Understand Main Crop Types

Crop Types Visualised

Original Image

Cover (default) - c_cover

Preserves the aspect ratio. Tries to cover the requested dimensions without disturbing images. Some parts of the image may get clipped off.

Contain - c_contain

Fill - c_fill

Ignores the aspect ratio. Stretches the image to fill empty spaces.

Crop - c_crop

Crops a region from image.

Crop needs a region in order to work.

https://demo.imagemash.io/w_200,h_200,x_100,y_300,c_crop/woman3.jpg

https://demo.imagemash.io/w_100,h_100,g_face,c_crop/woman3.jpg

https://demo.imagemash.io/g_laptop,c_crop/woman3.jpg

Thumb - c_thumb

https://demo.imagemash.io/w_200,h_200,g_face,c_thumb/woman3.jpg

Making a rounded thumbnail from an image.

https://demo.imagemash.io/w_200,h_200,g_face,c_thumb,r_100,bo_10_skyblue/woman3.jpg

Making a banner from an image.

https://demo.imagemash.io/w_800,h_200,g_face,c_thumb,r_15,bo_5_skyblue/woman3.jpg

crop ( or )

thumb ()

Eg. c_contain, c_crop, ... Required Parameters: ,

You can use to adjust image gravity. By default, it is . (g_center)

With parameter set to (g_face)

With parameter set to Laptop (g_laptop)

With parameter set to (g_t)

With parameter set to (g_b)

Preserves the aspect ratio. Fits the whole image in the requested dimensions. If there are empty spaces, they are filled with (bg).

Should either use with coordinates or .

To satisfy this condition, we provide , , .

Cropping with dimensions and

You can also use c_crop with without width and height. It returns the detected region as a result.

Thumb is specifically designed to make thumbnails from images. It has special algorithms that differentiate it from . Use c_thumb instead of c_crop if you are making thumbnails.

Needs in order to work.

Hey! Take a look at , you can assign your transforms into custom variables.

🖼️
Gravity
background color
width
height
x, y
Named Transforms
Crop
width
height
width
height
Gravity
Gravity
Gravity
Gravity
x,y
x,y
https://demo.imagemash.io/woman3.jpg
https://demo.imagemash.io/w_400,h_150/woman3.jpg
https://demo.imagemash.io/w_400,h_150,g_face/woman3.jpg
https://demo.imagemash.io/w_400,h_150,g_laptop/woman3.jpg
https://demo.imagemash.io/w_400,h_150,g_t/woman3.jpg
https://demo.imagemash.io/w_400,h_150,g_b/woman3.jpg
https://demo.imagemash.io/w_400,h_150,c_contain/woman3.jpg
https://demo.imagemash.io/w_400,h_150,c_fill/woman3.jpg
center
Face
Top
Bottom
AI Object Gravity
AI Object Gravity
AI Object Gravity
AI Object gravity
AI Object Position needed
AI Object Position needed