How to upscale an image

In this guide, discover how to upscale images using the Picsart TypeScript SDK. By creating an UpscaleRequest object and setting the desired upscale factor, you can enhance image resolution effortlessly. Detailed instructions and code examples help you navigate the process and handle the results efficiently, providing the URL of the upscaled image for easy access. Start improving your image quality with this comprehensive tutorial.

Before you start

Check these out before you start

Upscale an Image

In Getting Started with TypeScript SDK you have already learned how to create your image source. Now, you can upscale that image using the upscale service.

Here’s how to implement it:

const result = await imageApi.upscale(  
    new UpscaleRequest()  
      .setImage(imageSource)  
      .setUpscaleFactor(UpscaleFactor.R2000x2000)  
);

In this example, the image will be upscaled to a resolution of 2000x2000 pixels.

To discover all available parameters for the upscale service, any additional limitations or details,

Handling the result

After the upscaling process is complete, you can access the URL of the upscaled image:

console.log(result.image.url); // The URL of the upscaled image

What's next:

See other operations you can perform on an image:

For more examples, check out the TypeScript SDK Repository.