Skip to content

Geometric Transformations

Transform images with rotation, flipping, padding, and borders for layout and design needs.

Parameters

flip

Flip image horizontally, vertically, or both.

Type: string
Values: h, v, hv
Default: None (no flipping)

rot

Rotate image by specified degrees.

Type: float
Range: 0 - 360 degrees
Default: 0 (no rotation)

pad

Add uniform padding around the image.

Type: integer
Range: 0+ pixels
Default: 0 (no padding)

Individual Padding

Add different padding to each side.

  • pad_top - Top padding in pixels
  • pad_right - Right padding in pixels
  • pad_bottom - Bottom padding in pixels
  • pad_left - Left padding in pixels

border

Add border around the image.

Type: integer
Range: 0+ pixels
Default: 0 (no border)

border_color

Specify border color.

Type: string (color value)
Default: black

border_radius

Add rounded corners to border.

Type: integer
Range: 0+ pixels
Default: 0 (square corners)

border_radius_inner

Specify inner corner radius (for complex border effects).

Type: integer
Range: 0+ pixels
Default: None

Usage

Image Flipping

image.jpg?flip=h
Flip horizontally (mirror).

image.jpg?flip=v
Flip vertically (upside down).

image.jpg?flip=hv
Flip both horizontally and vertically (180° rotation effect).

Rotation

image.jpg?rot=45
Rotate 45 degrees clockwise.

image.jpg?rot=270
Rotate 270 degrees (equivalent to 90° counter-clockwise).

Padding

image.jpg?pad=20
Add 20px padding on all sides.

image.jpg?pad_top=30&pad_right=10&pad_bottom=20&pad_left=40
Add different padding to each side.

Borders

image.jpg?border=5&border_color=red
Add 5px red border.

image.jpg?border=10&border_color=#3366CC&border_radius=15
Add blue border with rounded corners.

Geometric Transformations Guide

Flipping Applications

  • Horizontal (h): Create mirror effects, fix orientation
  • Vertical (v): Correct upside-down images
  • Both (hv): 180° rotation alternative, create symmetrical layouts

Rotation Use Cases

  • 90°/270°: Portrait to landscape conversion
  • 180°: Fix upside-down orientation
  • 45°: Dynamic, diagonal compositions
  • Custom angles: Artistic tilting effects

Padding Strategies

  • Uniform: Create consistent spacing around content
  • Asymmetric: Accommodate text overlays or UI elements
  • Top-heavy: Leave space for titles or captions
  • Side padding: Prepare for mobile-responsive layouts

Border Styling

  • Thin borders (1-3px): Subtle definition
  • Medium borders (5-10px): Frame emphasis
  • Thick borders (15px+): Artistic, poster-like effects
  • Rounded corners: Modern, friendly appearance

Advanced Combinations

Product Photography Frame

product.jpg?w=500&h=500&fit=fill&pad=40&bg=white&border=2&border_color=#CCCCCC

Polaroid Effect

photo.jpg?w=400&pad_top=20&pad_left=20&pad_right=20&pad_bottom=60&bg=white&border=1&border_color=#DDD

Instagram Square with Padding

image.jpg?w=800&h=800&fit=fill&pad=40&bg=white

Rotated Banner

banner.jpg?rot=5&pad=30&bg=transparent

Profile Picture with Border

portrait.jpg?w=200&h=200&fit=crop&crop=faces&border=4&border_color=white&border_radius=100

Processing Order

Geometric transformations are applied in sequence: 1. Flip transformations 2. Rotation 3. Padding application
4. Border addition

Background Colors for Padding

When adding padding, specify background color using bg parameter:

image.jpg?pad=30&bg=white
image.jpg?pad=20&bg=#F0F0F0  
image.jpg?pad=25&bg=rgb(240,240,240)
image.jpg?pad=15&bg=transparent

Use Cases by Industry

E-commerce

product.jpg?w=600&h=600&fit=fill&pad=30&bg=white&border=1&border_color=#E0E0E0
Consistent product presentation with clean borders.

Social Media

post.jpg?w=1080&h=1080&fit=crop&pad=40&bg=#F8F8F8&border_radius=20
Modern social media post formatting.

photo.jpg?w=800&h=600&pad=50&bg=white&border=3&border_color=black
Traditional photo mounting appearance.

Web Design

hero.jpg?rot=2&pad_top=60&pad_bottom=40&bg=rgba(255,255,255,0.9)
Subtle rotation with space for text overlay.

Marketing Materials

graphic.jpg?w=500&border=8&border_color=#FF6B35&border_radius=12&pad=20&bg=#FAFAFA
Branded border treatment.

Best Practices

Rotation Considerations

  • Use small angles (±5°) for subtle dynamism
  • 90° increments for orientation correction
  • Consider crop areas when rotating to avoid empty corners
  • Large rotations may require padding to prevent content loss

Padding Strategy

  • Match padding to your design grid system
  • Use consistent padding values across similar images
  • Consider mobile breakpoints when setting padding
  • White/transparent backgrounds work best for product images

Border Design

  • Match border colors to your brand palette
  • Use subtle colors for professional applications
  • Ensure sufficient contrast between border and content
  • Round borders work well for profile pictures and thumbnails

Performance

  • Simple transformations (flip, 90° rotations) are very fast
  • Complex rotations require more processing time
  • Large padding/borders increase final file size
  • Results are cached for subsequent requests

Examples

Logo Preparation

logo.jpg?w=200&h=200&fit=fill&pad=20&bg=transparent&border=1&border_color=rgba(0,0,0,0.1)

Certificate/Award Image

certificate.jpg?border=15&border_color=gold&border_radius=5&pad=10&bg=white

Profile Picture

avatar.jpg?w=150&h=150&fit=crop&crop=faces&border=3&border_color=white&border_radius=75

Dynamic Layout Element

feature.jpg?rot=3&pad=25&bg=transparent&border=2&border_color=#4A90E2