Please bookmark this page to avoid losing your image tool!

Image Round Corner Smoothing Tool

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, radius = 20) {
  const canvas = document.createElement('canvas');
  const ctx = canvas.getContext('2d');

  const width = originalImg.naturalWidth || originalImg.width;
  const height = originalImg.naturalHeight || originalImg.height;

  canvas.width = width;
  canvas.height = height;

  // Ensure radius is not too large
  if (radius > width / 2) radius = width / 2;
  if (radius > height / 2) radius = height / 2;
  if (radius < 0) radius = 0;

  // Convert radius to number if it's a string
  radius = Number(radius);

  ctx.beginPath();
  ctx.moveTo(radius, 0);
  ctx.lineTo(width - radius, 0);
  ctx.arcTo(width, 0, width, radius, radius);
  ctx.lineTo(width, height - radius);
  ctx.arcTo(width, height, width - radius, height, radius);
  ctx.lineTo(radius, height);
  ctx.arcTo(0, height, 0, height - radius, radius);
  ctx.lineTo(0, radius);
  ctx.arcTo(0, 0, radius, 0, radius);
  ctx.closePath();

  // Clip to the rounded rectangle
  ctx.clip();

  // Draw the image
  ctx.drawImage(originalImg, 0, 0, width, height);

  return canvas;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

The Image Round Corner Smoothing Tool allows users to apply rounded corners to images, enhancing their visual appeal and making them suitable for various design projects. This tool is perfect for web designers, social media marketers, and anyone looking to create polished graphics for websites, presentations, or social media posts. By customizing the radius of the corners, users can achieve different effects, ranging from subtle to dramatic, ensuring that the images fit seamlessly into modern design aesthetics.

Leave a Reply

Your email address will not be published. Required fields are marked *