How to Remove Transparency from an Image using Java

One easy way to remove transparency from an image is to apply an opaque white background behind the original image. That’s exactly what our Transparency Removal API does, otherwise rendering the image at the same resolution & in the same file format.

The best part? You can use this API for free (up to 800 API calls per moth) by registering a free account on our website & using the code examples provided below to install the API client & structure your API call in Java.

We can begin installing the client by adding a reference to the repository in pom.xml:

And we can wrap it up by adding a reference to the dependency in pom.xml:

Next, we can include the following imports at the top of our file:

And finally, we can call the function, passing through our input file path & API key where indicated in the comments:

After that, you’re all done — no more coding required. Easy as pie!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

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