See on professionaalne lahendus TIFF faili tihendamiseks Java abil. Kasutage meie TIFF optimeerimise API t, et luua Java s kaasaskantavat, tugevat ja turvalist tarkvara. Proovige seda veebis tasuta!
Muutke suured TIFF failid väiksemaks ilma kvaliteeti kaotamata. Kustutage mittevajalikud ja kasutamata andmed. Vähendage koodis TIFF faili suurust. Java teek pakub arendajatele integreeritud API d TIFF sisu optimeerimiseks.
Java teek on iseseisev lahendus ja see ei nõua kolmanda osapoole tarkvara installimist.
'Aspose.Words for Java' kadudeta pakkimise ja sisu sügava optimeerimise lihtsaks. Järgmine näide demonstreerib, kuidas optimeerida TIFF faili Java:
// Repository path: https://releases.aspose.com/java/repo/
// Maven, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>ver</version>
<classifier>jdk17</classifier>
</dependency>
Kopeeri
// Repository path: https://releases.aspose.com/java/repo/
// Gradle, where 'ver' - Aspose.Words version number, for example, 24.4.
compile(group: 'com.aspose', name: 'aspose-words', version: 'ver', classifier: 'jdk17')
Kopeeri
// Repository path: https://releases.aspose.com/java/repo/
// Ivy, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency org="com.aspose" name="aspose-words" rev="ver">
<artifact name="aspose-words" m:classifier="jdk17" ext="jar"/>
</dependency>
Kopeeri
// Repository path: https://releases.aspose.com/java/repo/
// Sbt, where 'ver' - Aspose.Words version number, for example, 24.4.
libraryDependencies += "com.aspose" % "aspose-words" % "ver"
Kopeeri
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertImage("Input.tiff");
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.TIFF);
saveOptions.setTiffCompression(TiffCompression.LZW);
shape.getShapeRenderer().save("Output.tiff", saveOptions);
import com.aspose.words.*;
Document doc = new Document("Input.tiff");
doc.cleanup();
NodeCollection nodes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable<Shape>) nodes)
{
if (shape.isImage())
{
// Kujutise tihendamiseks teegi valib arendaja.
BufferedImage image = ImageIO.read(shape.getImageData().toStream());
// ...
// Tihendage pilt ja seadke see tagasi kujundisse.
shape.getImageData().setImage("yourCompressedImage");
}
}
OoxmlSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setCacheBackgroundGraphics(true);
doc.save("Output.tiff", saveOptions);
import com.aspose.words.*;
Document doc = new Document("Input.tiff");
doc.cleanup();
NodeCollection nodes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable<Shape>) nodes)
{
if (shape.isImage)
{
// Kujutise tihendamiseks teegi valib arendaja.
BufferedImage image = ImageIO.read(shape.getImageData().toStream());
// ...
// Tihendage pilt ja seadke see tagasi kujundisse.
shape.getImageData().setImage("yourCompressedImage");
}
}
doc.save("Output.tiff");
import com.aspose.words.*;
Document doc = new Document("Input.tiff");
doc.cleanup();
NodeCollection nodes = doc.getChildNodes(NodeType.SHAPE, true);
for (Shape shape : (Iterable<Shape>) nodes)
{
if (shape.isImage())
{
// Kujutise tihendamiseks teegi valib arendaja.
BufferedImage image = ImageIO.read(shape.getImageData().toStream());
// ...
// Tihendage pilt ja seadke see tagasi kujundisse.
shape.getImageData().setImage("yourCompressedImage");
}
}
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
saveOptions.setCompressionLevel(CompressionLevel.MAXIMUM);
doc.save("Output.tiff", saveOptions);
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertImage("Input.tiff");
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.TIFF);
saveOptions.setTiffCompression(TiffCompression.LZW);
shape.getShapeRenderer().save("Output.tiff", saveOptions);
Hoidame oma Java pakette Maveni hoidlates. 'Aspose.Words for Java' on tavaline JAR fail. Järgige samm-sammult juhiseid selle installimiseks oma Java arendajakeskkonda.
Java SE 7 ja uuemaid Java versioone. Java SE 6 jaoks eraldi paketti juhuks, kui olete kohustatud seda aegunud JRE kasutama.
Meie Java pakett on platvormideülene ja töötab kõigis JVM rakendusega Microsoft Windows, Linux, macOS, Android ja iOS.
Lisateavet valikuliste pakettide sõltuvuste kohta, nagu JogAmp JOGL, Harfbuzz fondimootor, Java Advanced Imaging JAI, vaadake toote dokumentatsioonist.
Saate optimeerida faile paljudes teistes failivormingutes: