Concatenate two or more TIFF into 1 file

I have 2 or more 1-page TIFF input files that need to be stored into 1 large TIFF. Using JAI, is there any way I can do that?

Here is an example that does what youwant:
import java.io.*;
import java.util.*;
import java.awt.image.*;
import java.awt.image.RenderedImage;
import javax.media.jai.JAI;
import javax.media.jai.PlanarImage;
import com.sun.media.jai.codec.*;
public class Multipagetiff {
   public static PlanarImage readAsPlanarImage(String filename) {
      return JAI.create("fileload", filename);
   public static void saveAsMultipageTIFF(RenderedImage[] image, String file )
       throws java.io.IOException{
      String filename = file;
      if(!filename.endsWith(".tiff"))filename = new String(file+".tiff");
      OutputStream out = new FileOutputStream(filename);
      TIFFEncodeParam param = new TIFFEncodeParam();
      ImageEncoder encoder = ImageCodec.createImageEncoder("TIFF", out, param);
      Vector vector = new Vector();
      for(int i=1;i<image.length;i++) {
          vector.add(image);
param.setExtraImages(vector.iterator());
encoder.encode(image[0]);
out.close();
public void createMultipageTiff(String[] filenames){
RenderedImage image[] = new PlanarImage[filenames.length];
for(int i=0;i<filenames.length;i++) {
image[i] = readAsPlanarImage(filenames[i]);
try {
saveAsMultipageTIFF(image, "multipagetiff");
catch (Exception e) {e.printStackTrace();}
public static void main(String[] args){
Multipagetiff mtiff = new Multipagetiff();
if(args.length <1) {
System.out.println("Enter a image file names");
System.exit(0);
mtiff.createMultipageTiff(args);

Similar Messages

  • How do I combine two or more pictures into one?

    How do I combine two or more pictures into one?

    I found out how to do what I wanted and I'm giving my steps in hopes that it might help someone else.  I wanted to put several photos from a file onto a new blank image.  This is what I did.
    1.  Create a blank page.    File/New/ Blank File.   Put in the size.  I used 8x10.
    2.  Bring the photo  you want to use into Elements as you always do. It will list along the top next to the blank sheet.
    3.  Choose SELECT (top of screen)/ Select All.
    4.  Choose Edit/Copy   or Command "C"
    5.  Click on the Blank File.   Chose Edit/Paste  or Command "V"
    6.  Click on Image/ Transform or Command "T".  There should be a dotted line around your pasted image.  You can then move and adjust the image to how you want it.  When finished, press the check-mark on lower right of photo.
    7.   Repeat this with all the photos you want on the new blank file.
    8.  You will see on lower right of Elements,  the background layer and as many layers as you have photos.  These layers need to be permanently placed on the background layer. Go to Layers and press Merge Visible.  This will merge all layers to the background.
    9.  Save as and you are done.

  • Tiff into pdf files issue [edited by host for clarity]

    I now have the latest version of Adobe/ but since the update I can no longer convert my Tiff files into PDF. Will an older version of Adobe/ Acrobat bring back the option of being able to create the tiff into a PDF

    Well, you'd have to have Acrobat to do anything like this. The online converter (CreatePDF) can do it. It's a subscription service available with the latest version of Adobe Reader.
    But I guess the bigger question is, how exactly did you do it before? Did you use Export PDF? Is that what isn't working anymore? I can't tell with the little information given.

  • Writing data from two different acquisition rates into one file

    Hi,
    I'm using a compactRIO, and I have an anemometer outputting data at 4Hz to the serial port on the controller, and I am using a 9237 module to read strain from two channels at 40Hz. I would like to record all this data in one file, but I'm unsure how to have the data points match up with respect to time since they are read at different rates. Basically I have 10 strain data points for every one anemometer data point, but that one data point needs to somehow be associated with the other 10 read in the same amount of time. It would be okay to "extend" the slower data to the 10 strain points, and likewise to the next ten when the anemometer refreshes its values.
    Thanks for any input!
    Andrew

    Check out the Queue multi-plexer vi from the examples.  C:\Program Files\National Instruments\LabVIEW 2009\examples\general\queue.llb\Queue Multiplexer.vi
    If each data acquisition loop enqueues data to one file writing loop the data is writen in order.  Queues are really a good way to multiplex data sources 
    Message Edited by Jeff Bohrer on 01-29-2010 09:44 AM
    Jeff

  • How do I combine two or more CDs into one album?

    How do I combine multiple CDs, like box sets, into one album in iTunes?

    See also Grouping tracks into albums.
    tt2

  • Two or more sites on .mac file structure?

    Hello everyone,
    I need some advice before I screw up things again. Just did but I fixed it partially.
    I want to ftp 2 sites. first one is not a problem I upload the folder and the index file with transmit
    web/sites
    in the sites folder I now see
    _gallery (folder)
    my site (folder)
    index (file)
    if I upload another site (site 2 folder) no problem, what about the index file that is going to mess things up. So where do I put it?
    Thank you for your help
    Mireille

    Hi Mireille,
    You don't need to upload it. An index.html file that points to your directory on your server already exists, on the server. The index.html file that your Site needs, is in the Site folder itself and will be automatically uploaded when you put up the Site folder.
    -Mark

  • Concatenate strings from more rows into one row.

    Hi,
    what's the name of that analytical function (or connect by) that
    would return strings from more rows as one row concatenated. i.e.:
    (I know this is possible using regular pipelined functions.)
    ROW1:   STR1
    ROW2:   STR2
    ROW3:   STR3
    select tadah().... from ...
    result:
    ROW1: STR1 STR2 STR3Thanks.

    Hi,
    Here's a basic example of SYS_CONNECT_BY_PATH.
    The query below produces one row of output per department, containing a list of the employees in that department, in alphabetioc order.
    WITH     got_rnum     AS
         SELECT     ename
         ,     deptno
         ,     ROW_NUMBER () OVER ( PARTITION BY  deptno
                                         ORDER BY          ename
                              ) AS rnum
         FROM     scott.emp
    --     WHERE     ...          -- Any filtering goes here
    SELECT     deptno
    ,     LTRIM ( SYS_CONNECT_BY_PATH ( ename
                                  , ','     -- Delimiter, must never occur in ename
               )          AS ename_list
    FROM     got_rnum
    WHERE     CONNECT_BY_ISLEAF     = 1
    START WITH     rnum          = 1
    CONNECT BY     rnum          = PRIOR rnum + 1
         AND     deptno          = PRIOR deptno
    ;Output:
    .   DEPTNO ENAME_LIST
            10 CLARK,KING,MILLER
            20 ADAMS,FORD,JONES,SCOTT,SMITH
            30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARDThe basic CONNECT BY query would produce one row per employee, for example:
    .   DEPTNO ENAME_LIST
            10 ,CLARK
            10 ,CLARK,KING
            10 ,CLARK,KING,MILLER
            20 ,ADAMS
            20 ,ADAMS,FORD
    ...The WHERE clause: <tt>WHERE CONNECT_BY_ISLEAF = 1</tt> means that we'll only see the last row for every department.
    SYS_CONNECT_BY_PATH (which is a row function, by the way, not an analytic fucntion) puts a delimiter (',' in the example above) before every item on the list, including the first one.
    The query above uses LTRIM to remove the delimiter at the very beginning.
    WM_COMCAT (or the equivalent user-defined STRAGG, which you can copy from AskTom) is much more convenient if order is not important.

  • How to show two or more PDF in one PDF-Reader / Concatenate PDF-Files

    Hi,
    I want to show two or more PDF files in one PDF reader window or to concatenate two or mor PDF files to one file.
    We use WD4A and ADS.
    Have someone an idea to solve this without an external program?
    Thx in advance
    Jürgen

    We have done this successfully a few times using WDA - it wasn't easy - it took us 2 full weeks to figure it out, so i need to get full points for this one!
    It's going to much easier to do this if you start a brand new WDA. If not, you'll have to re-do all your Context Node navigations within your methods.
    The first thing you need to do is to define your Context properly:
    You need a top level Node defined as 1:1 cardinality (as with all PDF development)
    Next, you need another Container Node 1:n cardinality (this holds the collection of content nodes)
    Finally, you have your PDF Content Node 1:n cardinality - This holds each instance of your PDF form
    In our scenario, we are passed in a list of Project Numbers. We need to generate a PDF sheet for each project in the same PDF session.
    pseudo code - i'm leaving out some of the unnessary details
    Loop through the project number table.
    ADD 1 TO v_cnt.
    * navigate from <TOP> to <PDF_CONTAINER> via lead selection
        lo_nd_pdf_container = lo_nd_top->get_child_node( name = wd_this->wdctx_pdf_container ).
    * This is the Important Part - we check to see if there is an element where index = v_cnt
    * If not, we create one where we can store the new set of data
    * get element via lead selection
        lo_el_pdf_container = lo_nd_pdf_container->get_element( index = v_cnt ).
        IF lo_el_pdf_container IS INITIAL.
          lo_el_pdf_container  = lo_nd_pdf_container->create_element( ).
          lo_nd_pdf_container->bind_element( new_item = lo_el_pdf_container
                                               set_initial_elements = ' '   ).
        ENDIF.
        lo_nd_ideasheet_data =  lo_el_pdf_container->get_child_node( 'IDEASHEET_DATA' ).
        lo_el_ideasheet_data = lo_nd_ideasheet_data->get_element( index = 1 ).
    * fill all the data then bind the structure
    Select * from XXX into lt_XXX
      where project_number = lt_project-project_number.
    * Move Data to appropriate fields/tables
    * Bind the info back to the element
        lo_el_ideasheet_data->set_static_attributes( static_attributes =
                                                  ls_ideasheet_data ).
    Endloop.

  • Merging two or more audio files, by a contextual menu item within the finder

    Hello, everyone,
    I want to merge or concatenate two or more simple audio files (wavs at the same sample rate and bit depth) into a new wav file - which don't need any conversion. I want to do this using a contextual menu service within the finder. Is there any possibility to do this? I can't find any software in the market that will allow me to do this.
    so that,
    'start.end_1.wav' + 'start.end_2.wav' + 'start.end_3.wav' = 'start.end_1&start.end_2&start.end_3.wav'
    Can anyone help? would sox help me with this, and if so, how to add it onto a finder contextual menu?

    Both of those directories are empty and I have deleted them and re-created them. I have been able to add and remove plugins for other applications so this is very strange.
    Using "Easy Find" I did locate a preference file, which I have deleted but that has not resolved it. I have tried safe mode and single user mode but no luck. I couldn't find any automator actions either.
    When I click on the menu item it says "ClamXav is not installed. Please install ClamXav and try again" so it knows it needs to use this program somehow.
    It's very odd and must be a result of a crash I had, though I would love to get to the bottom of it, it isn't serious and will hopefully go when I upgrade to Snow Leopard
    Thanks for your help though as it has taught me a few things!

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

  • CS4 - Book using two or more files

    I am using CS4 and need to set up a book (I know how to do that) that encompasses two or more files.  In File 1 I have a text block placed across a two page spread.  The last column will be a page number pointing to a specific page in File 2.
    Question 1:  How do I get File 1 to link to the specific page in File 2?
    Question 2:  Is there a way so that if the page in File 2 moves within the file, to have the reference in File 1 change?
    Question 3:  Is there perhaps a tutorial for this?
    Question 4:  Am I correct in that if this works I will be able to output a PDF with internal links in place?
    Cordially,
    A. Wayne Webb

    Afternoon Peter,
    Thank you for the responses.  I am taking four old timey reference works and combining them into one modern book.  The text pages represent three sets of records merged together.  I will end up with an Indesign "book" containing four files: front matter, text, survey images, and an index.  I am guessing it will be somewhere around 600 pages or so.  As for InDesign crashing, it has happened all too often.  And on this computer it has happended twice.  'Tis a brand new computer that I home-built with all the best toys.  It cost me northward of $3,900 and everything was installed fresh.  As for others and the "crash and trash" problem, it has been written about so often as to seem normal workflow for ID.
    The "1, 2, 3" numbers represent the page of the second portion of the PDF (the surveys / File 2). Clicking on a number, when it is correct, takes you to the survey image.  Clicking on the survey image takes you back to the text entry.  I can easily set the view in the options of the hyperlink or cross reference.
    The end of it is that I after I have the text and the images in place in File 1 and File 2, I will have to manually come back and update the "1, 2, 3" references.  InDesign, at least my version, cannot handle automatically updating the links and numbers.
    As for your last thought, yeah, as soon as I win the lottery.  I will figure this one out though.
    Cordially,
    A. Wayne Webb

  • How to concatenate two colums into one single column

    I need some ideas to concatenate two different columns into one single column using a set of distinct values.
    For Example,
    Customer Product Number
    xyz A 1
    xyz B 2
    xyz B 1
    AAA C 7
    AAA A 1
    The result should look like this,
    Customer Value
    xyz A1 B2 B1
    AAA C7 A1
    How would I group this into once value ?
    Thanks in advance ...

    Tom's discussion of writing your own aggregate routines
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
    starts off with a link to the 8i alternatives
    "see
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:229614022562
    for 8i methods (not aggregates)"
    Unforutnately, it's a lot more work in 8i.
    Justin

  • Can I export my sidecar files to two or more hard drives at the same time from one computer?

    Can I export my sidecar files to two or more hard drives at the same time from one computer?  How do I do this, if it is possible?

    Each image is imported into the LR Catalog from just one stated location on disk. And that is where the sidecar gets written.
    But if you want, outside of LR, you can have a file sync utility replicate all physical changes within those folders on disk, into other corresponding locations on other drives - which hold a copy of all the same images, and a copy of the sidecars too. This might happen continuously, periodically or on demand depending on the particular tool you use... for example, the Dropbox desktop app.
    If you also want to have your LR Catalog replicated, I think this can only be done when LR is not running and using that.

  • How do I split up a project into two or more projects?

    How do I split up a project into two or more projects?

    Select the Images you want to put in the new Project and then run "File➞New➞Project" and check "Move selected items to new project".

  • I have two different itunes music files on my computer.  How do I combine them into one file?

    I have two different itunes music files on my computer.  How do I combine them into one file?

    I don't think so. The only other ID I have is a developer id, and I didn't get that until several months after I got the phone. In addition purchases I made from the App Store onthe phone would sync up with It unes on the Mac meaning it would be the same id.
    However I looked at the AppStore on my phone while it was connected to the Mac with iTunes open, and now the balance has changed to the same as the others.

Maybe you are looking for