GithubHelp home page GithubHelp logo

Comments (2)

dragon66 avatar dragon66 commented on July 26, 2024

@reecefenwick: yes, you could have a look at issue #23 which for animated GIF but there is a similar function inside TIFFTweaker.

TIFFWriter writer = new TIFFWriter();
List<IFD> ifds = new ArrayList<IFD>();
FileOutputStream fout = new FileOutputStream("NEW.tif");
RandomAccessOutputStream rout = new FileCacheRandomAccessOutputStream(fout);
int writeOffset = TIFFTweaker.prepareForWrite(rout);
// Grab BufferedImage one by one and write them
BufferedImage bi = aBufferedImage;//
writeOffset = TIFFTweaker.writePage(bi, rout, ifds, writeOffset, writer);
// Keep writing until done, then finish up
TIFFTweaker.finishWrite(rout, ifds);
rout.close();

With this approach, you can set image parameters to TIFFWriter instance to control what kind of TIFF image you want to write - Full color, indexed, black and white etc.. You can even set different color types for different pages of the output multipage TIFF image.

from icafe.

reecefenwick avatar reecefenwick commented on July 26, 2024

Thanks @dragon66 ! Solved my memory problems with your suggestion and it's very stable now

from icafe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.