All Projects → ngageoint → tiff-java

ngageoint / tiff-java

Licence: MIT license
Tagged Image File Format Java Library

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to tiff-java

tiff-ios
Tagged Image File Format iOS Library
Stars: ✭ 26 (-60%)
Mutual labels:  tiff, geopackage-libraries, nga, geopackage
geopackage-mapcache-ios
GeoPackage MapCache iOS App
Stars: ✭ 20 (-69.23%)
Mutual labels:  geopackage-libraries, nga, geopackage
geopackage-android-map
GeoPackage Android Map Library
Stars: ✭ 26 (-60%)
Mutual labels:  geopackage-libraries, nga, geopackage
geopackage-mapcache-android
GeoPackage MapCache Android App
Stars: ✭ 33 (-49.23%)
Mutual labels:  geopackage-libraries, nga, geopackage
geopackage-ios
GeoPackage iOS Library
Stars: ✭ 45 (-30.77%)
Mutual labels:  geopackage-libraries, nga, geopackage
Useful Java Links
A list of useful Java frameworks, libraries, software and hello worlds examples
Stars: ✭ 5,126 (+7786.15%)
Mutual labels:  java-api, java-libraries
pygeopackage
A Python package to read/write spatial data to a geopackage.
Stars: ✭ 33 (-49.23%)
Mutual labels:  geopackage-libraries, geopackage
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+32409.23%)
Mutual labels:  tiff
Naps2
Scan documents to PDF and other file types, as simply as possible.
Stars: ✭ 1,018 (+1466.15%)
Mutual labels:  tiff
Djv
Professional media review software for VFX, animation, and film production
Stars: ✭ 282 (+333.85%)
Mutual labels:  tiff
dartexif
Dart package to decode Exif data from tiff, jpeg and heic files
Stars: ✭ 16 (-75.38%)
Mutual labels:  tiff
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (+580%)
Mutual labels:  tiff
Format parser
file metadata parsing, done cheap
Stars: ✭ 46 (-29.23%)
Mutual labels:  tiff
Photosauce
MagicScaler high-performance, high-quality image processing pipeline for .NET
Stars: ✭ 291 (+347.69%)
Mutual labels:  tiff
Metadata Extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 1,972 (+2933.85%)
Mutual labels:  tiff
Selene
A C++17 image representation, processing and I/O library.
Stars: ✭ 266 (+309.23%)
Mutual labels:  tiff
Imageprocessor
📷 A fluent wrapper around System.Drawing for the processing of image files.
Stars: ✭ 2,452 (+3672.31%)
Mutual labels:  tiff
Tifffile
Read and write TIFF files. Forked from https://pypi.org/project/tifffile
Stars: ✭ 119 (+83.08%)
Mutual labels:  tiff
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (+1103.08%)
Mutual labels:  tiff
Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+9275.38%)
Mutual labels:  tiff

TIFF Java

Tagged Image File Format Lib

The TIFF Library was developed at the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the MIT license.

Pull Requests

If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.

Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.

About

TIFF is a Java library for reading and writing Tagged Image File Format files. It was primarily created to provide license friendly TIFF functionality to Android applications. Implementation is based on the TIFF specification and this JavaScript implementation: https://github.com/constantinius/geotiff.js

Usage

View the latest Javadoc

Read

//File input = ...
//InputStream input = ...
//byte[] input = ...
//ByteReader input = ...

TIFFImage tiffImage = TiffReader.readTiff(input);
List<FileDirectory> directories = tiffImage.getFileDirectories();
FileDirectory directory = directories.get(0);
Rasters rasters = directory.readRasters();

Write

int width = 256;
int height = 256;
int samplesPerPixel = 1;
FieldType fieldType = FieldType.FLOAT;
int bitsPerSample = fieldType.getBits();

Rasters rasters = new Rasters(width, height, samplesPerPixel,
		fieldType);

int rowsPerStrip = rasters.calculateRowsPerStrip(
		TiffConstants.PLANAR_CONFIGURATION_CHUNKY);

FileDirectory directory = new FileDirectory();
directory.setImageWidth(width);
directory.setImageHeight(height);
directory.setBitsPerSample(bitsPerSample);
directory.setCompression(TiffConstants.COMPRESSION_NO);
directory.setPhotometricInterpretation(
		TiffConstants.PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO);
directory.setSamplesPerPixel(samplesPerPixel);
directory.setRowsPerStrip(rowsPerStrip);
directory.setPlanarConfiguration(
		TiffConstants.PLANAR_CONFIGURATION_CHUNKY);
directory.setSampleFormat(TiffConstants.SAMPLE_FORMAT_FLOAT);
directory.setWriteRasters(rasters);

for (int y = 0; y < height; y++) {
	for (int x = 0; x < width; x++) {
		float pixelValue = 1.0f; // any pixel value
		rasters.setFirstPixelSample(x, y, pixelValue);
	}
}

TIFFImage tiffImage = new TIFFImage();
tiffImage.add(directory);
byte[] bytes = TiffWriter.writeTiffToBytes(tiffImage);
// or
// File file = ...
// TiffWriter.writeTiff(file, tiffImage);

Installation

Pull from the Maven Central Repository (JAR, POM, Source, Javadoc)

<dependency>
    <groupId>mil.nga</groupId>
    <artifactId>tiff</artifactId>
    <version>3.0.0</version>
</dependency>

Build

Build & Test

Build this repository using Eclipse and/or Maven:

mvn clean install
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].