How to Convert Images to PNG Format in Power Automate

Cloudmersive
4 min readDec 2, 2024

--

Power Automate is an excellent tool to use for converting images to different formats at scale.

If, for example, we’re interested in converting JPG images from a OneDrive or SharePoint folder to PNG, we can simply employ the Cloudmersive Image Processing connector in a quick & easy flow.

In this article, we’ll build an example flow that converts three JPG images to PNG format, and we’ll save those files in the same folder as the originals. This way, we’ll have both JPG and PNG versions of our images available to us whenever we need them.

We’ll start by creating a manually triggered instant cloud flow.

In our first step, we’ll add a List files in folder (OneDrive) or Get files (SharePoint) action into our flow.

We’ll configure this action by finding our JPG image folder via the correct file path.

Next, we’ll add a Get file content action into our flow, and we’ll use file information from our List files in folder action to retrieve the contents of our JPG images.

Note that since we’re dealing with multiple files in our folder, Power Automate will automatically wrap our Get file content action in a For each control.

Within the For each control, we’ll add a new action and search for Cloudmersive connectors.

After we type “Cloudmersive” into the connector search bar, we’ll find ourselves looking at a list of several different Cloudmersive connector options.

We’re looking for the Cloudmersive Image Processing connector in this context, which has a yellow logo.

After we click “See more” to view the full actions list, we’ll look for an action called Convert input image to PNG format.

Upon selecting this action, we’ll need to create our Cloudmersive Image Processing connection (assuming we haven’t used this connector in the past).

To authorize our connection, we’ll need to obtain a free Cloudmersive API key from the Cloudmersive website. This will allow us a limit of 800 API calls each month with no commitments (our call total will reset at the beginning of each month).

Once we’ve finished creating our connection, we’ll place our dynamic image content in the initial request parameter, and we’ll place our dynamic image name content in the second request parameter.

Finally, we’ll add a Create file action within the For each control, and we’ll use dynamic content available in our flow to save our new PNG images in the same folder as the original JPG files.

In my example, I’m using the Name without extension value to retain the original file name for each image, and I’m then adding a .png extension to that name to ensure OneDrive recognizes the file type.

Now we’ll save our flow and run a test.

Note that the length of time required for this flow to run can depend on the size of the image files involved and the traffic Power Automate is experiencing at any given time.

And just like that, we now have JPG and PNG versions of our images stored together in a OneDrive folder.

We can use other Cloudmersive Image Processing actions to convert images to JPG, BMP (Bitmap), TIFF, and PSD among others.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet