I am developing an app in which I need the image in TIFF format. But in android you can convert your bitmap/image to only JPEG/PNG image.
Is there a good way to convert JPEG/PNG file to TIFF format on android?
I am developing an app in which I need the image in TIFF format. But in android you can convert your bitmap/image to only JPEG/PNG image.
Is there a good way to convert JPEG/PNG file to TIFF format on android?
I'm not sure that Android SDK supports Java Image I/O, but check out following question: Java API to convert JPEG to TIFF
Android does not support TIFF files. You can get the Bitmap's raw pixel data array and convert it to TIFF manually using any of the links from the previous comment.
I've recently found this great library on Github by Beyka (which uses libtiff and others natively) that provides many utilities for handling, opening, and writing .tiff files.
An example of converting JPEG to TIFF:
TiffConverter.ConverterOptions options = new TiffConverter.ConverterOptions();
//Set to true if you want use java exception mechanism
options.throwExceptions = false;
//Available 128Mb for work
options.availableMemory = 128 * 1024 * 1024;
//compression scheme for tiff
options.compressionScheme = CompressionScheme.LZW;
//If true will create one more tiff directory, else file will be overwritten
options.appendTiff = false;
TiffConverter.convertToTiff("in.jpg", "out.tif", options, progressListener);
Android Do Not Support java.awt.image.*
check this.
If you are willing to add some C++ to your project via the Android NDK, then libtiff should do what you want.