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).
Détail technique
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.
Exemple
```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
);
```
Formats associés
Outils associés
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
Termes associés
Aspect Ratio (CSS)
Contrast Ratio
Compression Ratio
Alpha Channel
AVIF
Chroma Subsampling
Chromatic Aberration
Color Grading (Image)
Compression Artifact
Dithering (Image)
Image Histogram
Image Registration
Metadata
Resolution
Alpha Compositing
Image Pyramid
Rasterization
Bit Depth
Color Space
Lossy Compression
HDR
Raster Graphics
Vector Graphics
Sprite Sheet
Thumbnail
WebP
Crop
Image Optimization
Resize
ICC Profile
Image Interpolation
Canvas
Convolution
DPI/PPI
Gamma
Histogram
Golden Ratio
Noise Reduction (Image)
Panorama Stitching
Feature Matching
Image Segmentation
Object Detection
Mipmap
Morphological Operations
Texture Atlas
Gamut Mapping
IPTC
Tone Mapping
Focus Stacking
Vignetting
XMP
Batch Resize
Content-Aware Fill
Lossless Compression
EXIF
Color Profile
DPI