Skip to content

BCoulange/tiff

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiff

This is a simple wrapper around libtiff using FFI. It only implements a small subset of libffi's features -- just enough to generate a TIFF image and read back some of its data. If you're interested in adding features, you can always send me a pull request (please include specs!).

Usage

Tiff::Image.open "filename.tif", "w" do |tiff|

  tiff.set_field :compression, :CCITTFAX4
  # or: tiff.set_field :compression, :CCITTFAX3

  tiff.set_field :photometric, :min_is_white
  # or: tiff.set_field :photometric, :min_is_black

  tiff.bits_per_sample = 1
  tiff.width = 200
  tiff.height = 40

  tiff.data = raw_data

end

image = Tiff::Image.open "filename.tif", "r"
image.get_field :width  # => 200
image.get_field :height # => 40

About

Ruby wrapper for libtiff with FFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%