Aspect Ratio
Aspect Ratio (Width-to-Height Proportion)
Aspect ratio is the proportional relationship between an image's width and height, expressed as two numbers separated by a colon. Common ratios include 16:9 (widescreen), 4:3 (classic), and 1:1 (square).
Technical Detail
Aspect ratio is calculated by dividing width and height by their greatest common divisor. Changing an image's aspect ratio without cropping requires adding padding or distorting the content.
Example
```javascript
// Crop image to specific region
const canvas = document.createElement('canvas');
canvas.width = cropWidth;
canvas.height = cropHeight;
const ctx = canvas.getContext('2d');
ctx.drawImage(
img,
cropX, cropY, cropWidth, cropHeight, // source rect
0, 0, cropWidth, cropHeight // dest rect
);
```
Related Formats
Related Tools
A
Aspect Ratio Calculator
C
Compress Image
G
Golden Ratio Calculator
R
Resize Image
C
Crop Image
R
Rotate Image
F
Flip Image
C
Convert Image
W
Watermark Image
S
SVG to PNG
I
Image to Base64
R
Round Corners
A
Add Border
I
Image Filters
A
Adjust Image
B
Blur Image
S
Sharpen Image
M
Make Square
G
Grayscale Image
S
Sepia Image
P
Pixelate Image
S
Strip Image Metadata
Related Terms
Alpha Channel
Alpha Compositing
Aspect Ratio (CSS)
AVIF
Batch Resize
Bit Depth
Canvas
Chroma Subsampling
Chromatic Aberration
Color Grading (Image)
Color Profile
Color Space
Compression Artifact
Compression Ratio
Content-Aware Fill
Contrast Ratio
Convolution
Crop
Dithering (Image)
DPI
DPI/PPI
EXIF
Feature Matching
Focus Stacking
Gamma
Gamut Mapping
Golden Ratio
HDR
Histogram
ICC Profile
Image Histogram
Image Interpolation
Image Optimization
Image Pyramid
Image Registration
Image Segmentation
IPTC
Lossless Compression
Lossy Compression
Metadata
Mipmap
Morphological Operations
Noise Reduction (Image)
Object Detection
Panorama Stitching
Raster Graphics
Rasterization
Resize
Resolution
Sprite Sheet
Texture Atlas
Thumbnail
Tone Mapping
Vector Graphics
Vignetting
WebP
XMP