Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:54:56+00:00 2026-05-30T02:54:56+00:00

What I have is a a large number of frames that need to be

  • 0

What I have is a a large number of frames that need to be placed together in a larger image (like a mosaic). The required positions of the images are known.

There are a very large number of images so loading them all into memory is impractical at best.

Based on some other answers here I was able to override the methods in RenderedImage (specifically getData(rect)) to load in the appropriate data and return it.

This works just fine, however the image writer is always calling getData and requesting rows of data. It seems to me I should be able to change the ImageWriterParam to call for individual tiles instead, but when I tried the write function still calls for a single line from getData.

How can I force this to use tiles and call getTile instead.

BufferedOutputStream bos=null;
try {
   bos = new BufferedOutputStream(new FileOutputStream(new File("test2.tiff")));

   ImageWriter writer =(ImageWriter) ImageIO.getImageWritersBySuffix("tif").next();

   ImageOutputStream ios=null

   ios = ImageIO.createImageOutputStream(bos); 

   writer.setOutput(ios);
   ImageWriteParam param = writer.getDefaultWriteParam();
   param.setTilingMode(ImageWriteParam.MODE_DEFAULT);

   RenderedImage mosaic = new MosaicImage(imageFiles[]);

   writer.write(null,new IIOImage(mosaic,null,null),param);

    } catch (FileNotFoundException ex) {

    }

Note I can use param.setTilingMode(ImageWriteParam.MODE_EXPLICIT); and setTiling(w,h,xoff,yoff);

However when using this, writer.write still calls getData(rect) in my image, and very annoyingly does not call for a rectangle of the size specified by w,h. It calls a rectangle of a size that is different by some random amount(probably comes from something)

For example if I use setTiling(100,100,0,0);

one would expect that even if it does not call getTile from the image, the Rectangle passed to getData should be (0,0,100,100) but instead it passes Rectangle (0,0,96,96) which is not a multiple of the image width or anything else i can think of.

Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:54:57+00:00Added an answer on May 30, 2026 at 2:54 am

    If you read up on the TIFF 6.0 spec under the TileWidth and TileLength fields, you will find the text

    TileWidth must be a multiple of 16. This restriction improves
    performance in some graphics environments and enhances compatibility
    with compression schemes such as JPEG.

    And similar for TileLength. 100×100 isn’t divisible by 16, but 96×96 is, which I bet is the TIFF encoder trying its best to fullfill your request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large number of csv files that look like this below: xxxxxxxx
I have a large number of records (10,000, increasing every day) that essentially is
I have a large number of documents (mainly PDFs) that I want to index
I have a large number of instances of a C structure like this: struct
I have a large number of C# WCF services that are being called by
I have very large dataframe and I need to choose variable number satisfying certain
I have a large data frame (named z ) that looks like this: RPos
I would like to resize a large number (about 5200) of image files (PPM
I've inherited a large Visual Basic project that has a number of frames (obviously,
I have a circle image that's fairly large in size to make it easy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.