The following options are available as a type: You can provide the following options to convert your image: convert Source converted = nvert( new Options().with( "type", "image/jpeg")).transform( new Options().with( "background", "#000000")) Source source = omFile( "panda-sticker.png") The background of a transparent image will be filled. Specify a background property in the transform object. If you wish to convert an image with a transparent background to one with a solid background, In case you want to include formats that do not support transparency (JPEG), one can specify a background color that replaces the transparency using the transform object. Images with a transparent background will only be converted to formats that support transparency. String extension = converted.extension() Ĭonverted.toFile( "panda-sticker." + extension) If you use Gradle instead, you can use the following: dependencies )).result() RELEASE with a specific version: com.tinify tinify RELEASE To avoidīreaking changes in your code when we update the client, replace You can use the Java client as a Maven dependencyīy adding the following to your application’s pom.xml. Languages make it very easy to interact with the Tinify API. The Tinify API allows you to compress and optimize WebP, JPEG and PNG images.
0 Comments
Leave a Reply. |