Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Make Image SquareNew to Visual Studio Code? Get it now.
Make Image Square

Make Image Square

ilovejackylee

|
1 install
| (0) | Free
Compute 1:1 letterbox/pillarbox padding from a photo's width and height.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Make Image Square

Tiny helper that turns any image size into a 1:1 layout plan: square canvas size plus left/right/top/bottom padding so you can fit without cropping.

Useful when you already know the pixel size of a photo and need the letterbox / pillarbox numbers before you draw to a canvas, write CSS boxes, or prep Instagram and profile assets.

Command

  • Make Image Square: Layout

It asks for width, height, an optional square edge (leave empty to use max(width, height)), and a mode:

Mode Behavior
fit (default) Entire image visible; empty bands become padding
fill Image covers the square; caller is expected to crop overflow

Example: 1200×800 in fit mode → canvas 1200, pad top/bottom 200.

This extension only returns numbers. It does not decode or rewrite image files.

Notes

  • Padding is computed in the same units you type (usually pixels).
  • Prefer a UI instead of typing sizes in the command palette? There is a web tool that pads photos to 1:1 that can letterbox, blur the frame, or crop in a browser.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft