{"id":21820051,"url":"https://github.com/ngageoint/tiff-java","last_synced_at":"2025-08-20T08:33:34.805Z","repository":{"id":42998777,"uuid":"69067440","full_name":"ngageoint/tiff-java","owner":"ngageoint","description":"Tagged Image File Format Java Library","archived":false,"fork":false,"pushed_at":"2024-04-03T15:50:36.000Z","size":62887,"stargazers_count":72,"open_issues_count":6,"forks_count":35,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-10T20:51:44.217Z","etag":null,"topics":["geopackage","geopackage-libraries","java","java-api","java-libraries","java-library","java-sdk","nga","tiff","tiff-java"],"latest_commit_sha":null,"homepage":"https://ngageoint.github.io/tiff-java","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngageoint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-23T23:25:38.000Z","updated_at":"2024-06-06T04:55:27.000Z","dependencies_parsed_at":"2024-04-03T16:59:09.956Z","dependency_job_id":null,"html_url":"https://github.com/ngageoint/tiff-java","commit_stats":{"total_commits":148,"total_committers":11,"mean_commits":"13.454545454545455","dds":"0.43243243243243246","last_synced_commit":"5100e1e332d28c5544954329dc8a41b608d9e221"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Ftiff-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Ftiff-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Ftiff-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Ftiff-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngageoint","download_url":"https://codeload.github.com/ngageoint/tiff-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408171,"owners_count":18220974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geopackage","geopackage-libraries","java","java-api","java-libraries","java-library","java-sdk","nga","tiff","tiff-java"],"created_at":"2024-11-27T16:28:12.393Z","updated_at":"2024-12-19T09:08:05.374Z","avatar_url":"https://github.com/ngageoint.png","language":"Java","readme":"# TIFF Java\n\n#### Tagged Image File Format Lib ####\n\nThe TIFF Library was developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](https://www.caci.com/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](http://choosealicense.com/licenses/mit/).\n\n### Pull Requests ###\nIf 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.\n\nSoftware 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.\n\n### About ###\n\n[TIFF](http://ngageoint.github.io/tiff-java/) 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](https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf) and this JavaScript implementation: https://github.com/constantinius/geotiff.js\n\n### Usage ###\n\nView the latest [Javadoc](http://ngageoint.github.io/tiff-java/docs/api/)\n\n#### Read ####\n\n```java\n\n//File input = ...\n//InputStream input = ...\n//byte[] input = ...\n//ByteReader input = ...\n\nTIFFImage tiffImage = TiffReader.readTiff(input);\nList\u003cFileDirectory\u003e directories = tiffImage.getFileDirectories();\nFileDirectory directory = directories.get(0);\nRasters rasters = directory.readRasters();\n\n```\n\n#### Write ####\n\n```java\n\nint width = 256;\nint height = 256;\nint samplesPerPixel = 1;\nFieldType fieldType = FieldType.FLOAT;\nint bitsPerSample = fieldType.getBits();\n\nRasters rasters = new Rasters(width, height, samplesPerPixel,\n\t\tfieldType);\n\nint rowsPerStrip = rasters.calculateRowsPerStrip(\n\t\tTiffConstants.PLANAR_CONFIGURATION_CHUNKY);\n\nFileDirectory directory = new FileDirectory();\ndirectory.setImageWidth(width);\ndirectory.setImageHeight(height);\ndirectory.setBitsPerSample(bitsPerSample);\ndirectory.setCompression(TiffConstants.COMPRESSION_NO);\ndirectory.setPhotometricInterpretation(\n\t\tTiffConstants.PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO);\ndirectory.setSamplesPerPixel(samplesPerPixel);\ndirectory.setRowsPerStrip(rowsPerStrip);\ndirectory.setPlanarConfiguration(\n\t\tTiffConstants.PLANAR_CONFIGURATION_CHUNKY);\ndirectory.setSampleFormat(TiffConstants.SAMPLE_FORMAT_FLOAT);\ndirectory.setWriteRasters(rasters);\n\nfor (int y = 0; y \u003c height; y++) {\n\tfor (int x = 0; x \u003c width; x++) {\n\t\tfloat pixelValue = 1.0f; // any pixel value\n\t\trasters.setFirstPixelSample(x, y, pixelValue);\n\t}\n}\n\nTIFFImage tiffImage = new TIFFImage();\ntiffImage.add(directory);\nbyte[] bytes = TiffWriter.writeTiffToBytes(tiffImage);\n// or\n// File file = ...\n// TiffWriter.writeTiff(file, tiffImage);\n\n```\n\n### Installation ###\n\nPull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga|tiff|3.0.0|jar) (JAR, POM, Source, Javadoc)\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003emil.nga\u003c/groupId\u003e\n        \u003cartifactId\u003etiff\u003c/artifactId\u003e\n        \u003cversion\u003e3.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\n### Build ###\n\n[![Build \u0026 Test](https://github.com/ngageoint/tiff-java/workflows/Build%20\u0026%20Test/badge.svg)](https://github.com/ngageoint/tiff-java/actions/workflows/build-test.yml)\n\nBuild this repository using Eclipse and/or Maven:\n\n    mvn clean install\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Ftiff-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngageoint%2Ftiff-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Ftiff-java/lists"}