Saving a tiff image N preserviing its resolution

hi guys ,
I am facing a problem saving an existing tiff file to a tiff format.
My original image is of 600 dpi both horizontal and vertical resolution.
When i save using my patch of code the resulting image is 96dpi in resolution.
I need to make sure taht there is no loss when i am saving my image
public void saveImage()
     File file3; // The file that the user wants to save.
JFileChooser fd; // File dialog that lets the user specify the file.
fd = new JFileChooser(".");
fd.setDialogTitle("Save Image As TIFF...");
int action = fd.showSaveDialog(this);
if (action != JFileChooser.APPROVE_OPTION) {
return;
file3 = fd.getSelectedFile();
if (file3.exists()) {
// If file already exists, ask before replacing it.
action = JOptionPane.showConfirmDialog(this,
"Replace existing file?");
if (action != JOptionPane.YES_OPTION)
return;
try {
FileOutputStream os = new FileOutputStream(file3);
TIFFEncodeParam param1 = new TIFFEncodeParam();// USE WHEN CONVERTING TO TIFF FILE
if(factor.isBinary())
     //param1.setCompression(TIFFEncodeParam.COMPRESSION_GROUP4); //USE IF BINARY IMAGE
     param1.setCompression(TIFFEncodeParam.COMPRESSION_GROUP4);
     //param1.setCompression(TIFFEncodeParam.COMPRESSION_NONE);//USE IF BINARY IMAGE
     //param1.setCompression(TIFFEncodeParam.COMPRESSION_LZW); //USE IF BINARY IMAGE
else
     param1.setCompression(TIFFEncodeParam.COMPRESSION_PACKBITS);
     //param1.setCompression(TIFFEncodeParam.COMPRESSION_NONE);
ImageEncoder enc =ImageCodec.createImageEncoder("TIFF",os,param1);
//enc.encode(source);
enc.encode(backup);
os.flush();
os.close();
catch (IOException e)
               // Some error has occurred while trying to write.
               //Show an error message.
               JOptionPane.showMessageDialog(this,
                              "Sorry, an error has occurred:\n" + e.getMessage());
Any suggestions ?
Aadil

Hi,
Could you find any method to change the tiff image compression or even resolution.
When i try this,
String filename="c:\\sample1.tif";      
          File file = new File(filename);
     SeekableStream s = new FileSeekableStream(file);
     ImageDecoder dec = ImageCodec.createImageDecoder("TIFF", s, null);
     //RenderedImage op = new NullOpImage(dec.decodeAsRenderedImage(), null,null, OpImage.OP_COMPUTE_BOUND);
     RenderedImage op = new NullOpImage(dec.decodeAsRenderedImage(0),null,null,OpImage.OP_IO_BOUND);
     ByteArrayOutputStream output = new ByteArrayOutputStream();
     TIFFEncodeParam tp=new TIFFEncodeParam();
     tp.setCompression(TIFFEncodeParam.COMPRESSION_GROUP4);
     //tp.setCompression(TIFFEncodeParam.COMPRESSION_GROUP3_2D);
     ImageEncoder encoder = ImageCodec.createImageEncoder("TIFF", output, tp);
     encoder.encode(op);
     encoder.setParam(tp);
     System.out.println(tp.getCompression());
     byte compressedData[] = output.toByteArray();
     FileOutputStream fouts=new FileOutputStream("c:\\sample2.tif");
     fouts.write(compressedData);
     output.close();
     fouts.close();
It's giving errro saying that "End of data reached before next EOL encountered" when i call encoder.encode(op);
method..
any suggestions?????

Similar Messages

  • Saving batch of images down to multiple resolutions?

    Something I've been running into but have no idea how to actually have Photoshop do this. When I get high res images from a client, we save them down to medium res and low res. To do this currently, I have two actions, the medium saving the images down to 150 dpi and the low saving down to 72 dpi. Right now I've been running each separately through the image processor. This is all well and good, but ideally I would love to run one script that once I select the folder with the high res images, would run both actions, putting the downsized medium res images into a MEDRES folder and low res into a LOWRES. Seems silly, but it would save time and would be especially helpful for the other guys around who are not as photoshop savy.

    Are you actually downsampling the image, or simply reassigning a resolution?  It sounds like the latter, in which case using PS sounds like overkill.  Resolution means nothing to a digital image, it's just a number assigned to an attribute (is it just in the metadata?) that can be read by a printer.  I would think there would be all kinds of programs that could simply change the number without having to actually edit the photo.

  • How to retain the same resolution while croping a tiff image using jai api

    Hi all,
    I have designed a program to crop a tiff image.But after croping the tiff,the resultant file resolution is not the same as the original source file.
    In the program,the source file Nadeshiko_v1_02.tif has the resolution(X) of 1200 DPI and resolution(Y) has 1200 DPI pixels.
    But after croping the resolution of output file is 100 DPI.
    Please give me some idea on how to retain the same resolution.
    <code>
    package jai;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import java.awt.image.renderable.ParameterBlock;
    import java.awt.image.renderable.RenderableImage;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.imageio.*;
    import javax.imageio.stream.ImageOutputStream;
    import javax.media.jai.Interpolation;
    import javax.media.*;
    import javax.media.jai.JAI;
    import javax.media.jai.PlanarImage;
    import javax.media.jai.RenderedOp;
    import javax.media.jai.widget.ScrollingImagePanel;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.TIFFEncodeParam;
    import javax.media.jai.OperationDescriptorImpl;
    import java.io.*;
    import java.util.Iterator;
    import javax.media.jai.operator.*;
    // import javax.media.jai.widget.ScrollingImagePanel;
    public class crop {
              /** The main method. */
    public static void main(String[] args) {
    /* Validate input. */
    /* if (args.length != 1) {
    System.out.println("Usage: java JAISampleProgram " +
    "input_image_filename");
    // System.exit(-1);
    float a=(float) 70.3;
    float b=(float) 70.4;
    float c=(float) 3100.3;
    float d=(float) 5522.4;
    * Create an input stream from the specified file name
    * to be used with the file decoding operator.
    String TIFF="TIFF";
    FileSeekableStream stream = null;
    try {
         stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_02.tif");
    // stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_01.jpg");
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(0);
    // Load the source image from a Stream.
    RenderedImage im = JAI.create("stream", stream);
    RenderedImage image2= CropDescriptor.create(im, a, b, c, d, null);
    ScrollingImagePanel panel = new ScrollingImagePanel(image2, 100, 100);
    // Create a frame to contain the panel.
    Frame window = new Frame("JAI Image Cropping");
    window.add(panel);
    window.pack();
    // window.show();
    // Define the source and destination file names.
    // String inputFile = "D:\\tif images\\Nadeshiko_v1_05.tif";
    String outputFile = "D:\\tif images\\Nadeshiko_v1_04.tif";
    // Save the image on a file. We cannot just store it, we must set the image encoding parameters
    // to ensure that it will be stored as a tiled image.
    TIFFEncodeParam tep = new TIFFEncodeParam();
    tep.setWriteTiled(true);
    tep.setTileSize(80,80);
    JAI.create("filestore",image2,outputFile,"TIFF",null);
    try {
                   stream.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    </code>
    Thanks,
    Sanat Meher

    Try the following,
    TIFFEncodeParam tep = new TIFFEncodeParam();
    // Create {X,Y}Resolution fields.
    TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_X, 1}});
    TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_Y, 1}});
    tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});

  • Iphoto photo import - best image type for max resolution (jpg vs tiff)

    What is the recommended image type for maximum resolution of photos brought into iphoto albums, since I will be enlarging them? (ie assuming everything brought into iphoto is set/reduced to a standard resolution, then jpg might allow more digital data for later enlargement; on the other hand tiff is often recommended for best resolution though it requires more space). Thanks, - D

    Thanks, Terence - OK, lets assume I shoot a 5-meg photo of a painting and adjust the paralax etc in photoshop so it is perfectly set inside the rectangular format. Now I want to import it into iphoto, knowing that I will use the crop tool to make two blow-up enlargements to go along with the original full-size image... total 3 related images of the artwork. As you mentioned these will eventually go into iweb as part of a series inside an album, with a hyperlink connecting the two enlargements to the full-size image... so viewers can tap to see finer detail and then go back to the overall composition. My question is, for the original photo image of the painting should I drag a 10-meg tiff into iphoto or a 2-meg jpg? (I do not know what importing the image into iphoto does to the original in terms of final image resolution and data size... Will a 2-meg jpg provide sufficient data to work with and enlarge via the cropping, or would the 10-meg tiff be better as a starting point? Or, if everything gets translated into a certain pre-ordained size anyway, would the tiff get watered down to, say, a 2-meg-size image anyway?) Thanks, - D

  • Color Handling when saving Word document as PDF, containing CMYK TIFF image?

    What is the proper procedure for creating PDFs from Word documents that contain a CMYK TIFF image? I have created a company logo by exporting an AI file with Pantone colors as a TIFF (with a CMYK color profile, since there is the intention of printing). Since it is a logo, color consistency is important and the utmost priority. I will be needing to insert this file into a Word document that will then be converted into a PDF.
    I've read somewhere that Word automatically converts images to RGB, and also have come across potential problems of colors being changed in the final PDF through unmanaged color handling and conversions. I figured instead of running around in circles trying to find the best solution, I'd post on here. Is this procedure possible? What is the best way to do this without changing my original color profile or CMYK values of the logo being used?
    This PDF has the intention of being placed online for offices to print/publish.
    Thanks!

    Though actually, let's take a step back -- why do you want to use CMYK? Most offices won't be using PostScript printers, so the CMYK will be converted to RGB for printing. For publishing - do you know the required CMYK profile to use for all possible publishing scenarios? Properly tagged RGB is generally considered the way to deal with this in modern workflows not targeted at a specific press. But still probably not with Word!

  • TIFF Images Rendering

    I imported a TIFF image into an FCE project. The image has text in it (as in drawings of texts). Using the Motion tab, I have the image moving in a of scrolling manner. However, even when this project is rendered and exported to decent quality, the text in the image is very jittery like and not smooth at all. I don't have the scrolling really moving all that fast at all.
    I used TIFF because it is Apple native. Should there be another image type I use? When I made the TIFF image I saved it with no compression and the layers of the image project were 'merged' rather than 'flattened'.
    Anyone else experience this issue or know the solution.
    Thanks

    Why don't you use Title Crawl in FCE?
    Please give exact details of the image, its size, resolution, color space, also the contents, colors, fonts, sizes, anything else. Maybe a screen shot of possible.

  • How do I Convert a  Tiff image to a jpeg without being FORCED to 8-bit Color?

    I am an Artist.  I have High quality TIFF images.  When I convert the tiffs to jpeg it forces me into 8-bit color automatically. (Forget about 32bit - it will not allow me to jpeg that at all)   The only way I can get back to 16bit color is to use the already SMAshed file and bring it up to 16bit.  THIS makes NO sense.  Once the jpeg is smashed, HOw in the world is it supposed to convert up again. ??  Then even though it says you converted the file to 16 -bit , the metadata refers still to the file as 8-bit.
    On top of all of that confusion, One picture, for example, when supposedly converted to 16bit,  gets much BRighter then even the original Tiff image.  It looks good on one hand and over exposed on the other.  I assume that is photoshop throwing in fake resolution, am I right?
    Am I wasting my time with this imaginary 16bit conversion?
    Is there ANY way to take that original Tiff image and convert it to 16bit jpeg without the Default 8bit?  I have been trying all kinds of things.  I even have asked my web guy.  My web guy says that 8-bit is unexceptable for printing, even for web.
    Could this have anything to do with my computer and scanner?
    I have the iMAC OS X 10.8.3 (3.2 GHz) 8 GB memory.
    And I also have an Epson Expression 10000XL graphic arts scanner capable of scanniing at 48bit color.
    This color stuff Really matters!  It MATTERS!  I HAve FINE art files.  I am already losing so much quality with the jpeg conversion. (which I am required to do for SmugMug, in addition to compressing all my files to 50mb or Under)
    Anyone who knows anything that could help me would be much appreciated. 
    Aloha,
    -Melissa

    First of all jpeg is 8 bit only there is no way to save as a 16 or 32 bit jpg, just does not exist. Secondly people print in 8 bit all the time and most if not all web graphics are in 8 bit as that is the only way to view it as there is no 16 bit or 32 bit monitors to view it. All but a few pro monitors are 8 bit monitors.
    If you care about the color gamut and want the full range of color that 16 and 32 bit provide, then why jpg? Jpg by its own nature throws out color just to compress, thats why it is popular on the web, because of its small file size not its quality. If you need 16 or 32 bit for anything it must be in a format that supports that color depth.
    That being said a jpg image at 8 bit will display 16+ million colors,  256 shades of red, 256 shades of green and 256 shades of blue.
    Now here is where I think your bit information is off. a jpg image is a 24 bit image that will produce 8 bits of red, 8 bits of green and 8 bits of blue.
    The 8, 16 and 32 are per channel not total color information.
    If the overall image was 8 bits, the image would be gayscale.

  • TIFF image problem

    I am using an outside contractor to create some computer generated images for me. As is usual--especially for wide, exterior shots like these--the CGI part is placed onto an actual photograph. The two images are pulled into Photoshop and tweaked until they match. When the artist sends the files to me, however, the photographic background is missing. All I see in Photoshop and InDesign is the CGI "half." Curiously, when I place them in an AI file there is a background, but it is fuzzy and indistinct--like a preview file. All the files were saved as TIFF/RGB. I told him to use CMYK, but I was lucky I was getting TIFFs at all. The previous files were JPEGs! One was actually a JPEG that was enlarged in Photoshop to the resolution I wanted and saved as a Tiff.
    One more thing, the renderings were created in Artlantis (a mid-level rendering program) and modified in something called "Paint Shop." All I get are what appear to be single layer TIFF/RGB files, not multi layer files. The artist insists he is sending files complete with the background.
    Before I send him packing, am I missing something? Is it possible the background is there, just invisible to Adobe products? Or is it possible he forgot to link a file or some such thing when saving in "Print Shop"? Any help is very much appreciated.
    MGuilfoile CS3, OS10.4.11, G5/2500

    Yes, I don't remember bit order ever being a problem either. I was just trying to give my contractor every benefit of the doubt before I cut him loose. I think what he has done is not include a linked file when he makes his TIFF. Just like in Quark, ID, AI or any app that supports file linking. I'm sure it opens fine in his program. Why he does not check it with some image viewer before sending it to me is beyond me.
    This person has produced beautiful work over the years, but I think he simply has gone of the rails somewhere. These are rookie mistakes he's making. The file was not zipped and I've had some associates look at it with the same results. If no one on this forum is aware of some Paint Shop quirk then I have to believe that I'm at a dead end. I'll just ask him to send the photo backgrounds to me separately and I'll create the images myself.
    Thanks for the help!
    MGuilfoile

  • Photoshop CS4, Saved a Tiff file now won't open correctly

    I saved a file as a .tif and it saved as normal then I shut down Photoshop and then the PC. The next day when I try to open the file it doesn't open correctly it opens but the right hand side of the photo is on the left and the left hand side of the image is now on the right, its like its been cut in half and put pack the wrong way.
    It also didn't open with the layers only as a locked background. When I view the file in the icon it looks fine until I open it.
    Help!

    Laura, I'd guess this is not promising for you.  TIFF files tend to be large, so I am wondering if you might have closed Photosho and the PC before it had finished saving?  Do you remember the pixel size of the original image, and what is the file size in Mb?  I am not sure how Photoshop treats TIFF images, depite them owning the file format after buying it from Aldus a few years ago, but it sounds like it was saved as a series of tiles, and the information about the order of those tiles is corrupted.  You might be able to Google TIF file recovery program, but it is unlikely you'll get the full file back with all the information saved with it.
    If you don't get a better answer, keep a weather out for when Chris Cox is posting, and bump this thread. 
    Good luck

  • A generic error occurred in GDI+ while assing tiff image file to Bitmap and Image

    Hi,
    I am getting "A generic error occurred in GDI+" error while reading the tiff image file to Bitmap or Image.
    Below is my sample code.
    string filePath=@"c:\Images\sample.tif";
    Bitmap bmp=new Bitmap(filePath);   // here getting exception
    int totalpages=bmp.GetFrameCount(.....);
    etc......
    I tried using Bitmap.FromFile() and also from FromStream() even for Image also but there is no use.
    Moreover i m having full permissions for the file path and the tiff file is having multiple pages.
    Can anyone help me to solve this issue please.
    Thanks & Regards,
    Kishore
    Kishore

    Make sure that the Tif file is valid (can other software open it)?  If you are able to save a Tif using GDI+, try saving that Tif, then opening it.  Part of me wonders if there is something about that specific Tif that GDI+ doesn't like.
    You could also try using WIC to open the TIF, perhaps you would have better luck there.

  • Problem Saving Gererating GIF Image

    Hello, we are having a problem in production environment when try to right mouse and select Print on an mii grid. Works just fine in all of our non-production environments. Checked the System Security pull downs and they all matched non-prod. Was not sure which one to compare, was not a ImageStorageServlet on pull down menu.
    After right mouse and select Print on grid, get:
    -Java Applet Window popup message - Problem Saving Gererating GIF Image
    -Then - blank browser page - .../XMII/ImageStorageServlet/View/null
    - Non-production servers works fine produces grid on browser page - XMII/ImageStorageServlet/View/2084280301
    NetWeaver Log:
    Location - com.sap.xmii.servlet.ImageStorageServlet
    Full Message Text
    ImageStorage - Error saving GIF file 
    Full Message Text
    ImageStorage - Error generating GIF output
    Any help would be appreciated.
    Thanks

    David,
    Have you put in a support ticket for this? I recommend doing so since its occurring in your production environment. You should also attach your log files as well.
    Regards,
    Kevin

  • How can I merge two TIFF images in one...?

    I need some help please, I am looking for a way to "resize" black & white single TIFF images.
    The process I need to do is like cutting a small image and paste it over a new blank letter-size image (at 300 dpi), like a template.
    Or better yet, is there a way to do something like this...?
    Open image...
    image.*width* = 2550;
    image.*height* = 3300;
    image.save();Some APIs and topics in the internet do or talk about resizing, but the final images get stretched or shrinked and I need them not to do so at all.
    Also, I do not need to display the images, only to get the TIFF images processed and saved back to a file.
    How can I do this with Java and JAI? Unfortunately I am almost new to this and I don't know how difficult it might be to deal with images.

    If 2550 x 3300 isn't the original aspect ratio of the image, then the image is going to looked streched or shrinked in at least one dimension. There is no way around that. It would be like resizing a 2 pixel by 2 pixel image into a 3 pixel by 6 pixel image. The image would look like it's height shrunk or it's width stretched. Had I resized it to 3 pixels by 3 pixels or 6 pixels by 6 pixels, though, then it wouldn't look shrunken or streched.
    Open image...
    image.*width* = 2550;
    image.*height* = 3300;
    image.save();*1)* To open a TIFF image you can use the javax.swing.ImageIO class. It has these static methods
    read(File input)
    read(ImageInputStream stream)
    read(InputStream input)
    read(URL input) You can use which ever method you want. But first you need to install [JAI-ImageIO|https://jai-imageio.dev.java.net/binary-builds.html]. The default ImageReaders that plug themselves into the ImageIO package are BMP, PNG, GIF, and JPEG. JAI-ImageIO will add TIFF, and a few other formats.
    The downside is that if clients want to you use your program on their machine then they to will need to install JAI-ImageIO to read the tiffs. To get around this, you can go to your Java/jdk1.x.x_xx/jre/lib/ext/ folder and copy the jai_imageio.jar file (after you've installed JAI-ImageIO). You can also obtain this jar from any one of the zip files of the [daily builds|https://jai-imageio.dev.java.net/binary-builds.html#Daily_builds]. If you add this jar to your program's classpath and package it together with your program, then clients won't need to install JAI-ImageIO and you'll still be able to read TIFF's. The downside of simply adding the jar to the classpath is that you won't be able to take advantage of a natively accelerated JPEG reader that comes with installing JAI-ImageIO (instead, ImageIO will use the default one).
    *2)* Once you've installed [JAI-ImageIO|https://jai-imageio.dev.java.net/binary-builds.html] and used ImageIO.read(...), you'll have a BufferedImage. To resize it you can do the following
    BufferedImage newImage = new BufferedImage(2550,3300,BufferedImage.TYPE_BYTE_BINARY);
    Graphics2D g = newImage.createGraphics();
    g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g.drawImage(oldImage,0,0,2550,3300,null);
    g.dispose();Here, I simply drew the old image (the one returned by ImageIO.read(...)) onto a new BufferedImage object of the appropriate size. Because you said they were black and white TIFF's, I used BufferedImage.TYPE_BYTE_BINARY, which is a black and white image. If you decide to use one the BufferedImage types that support color, then a 2550x3330 image would require at least 25 megabytes to hold into memory. On the other hand, a binary image of that size will only take up about one meg.
    I specified on the graphics object that I wanted Bilinear Interpolation when scaling. The default is Nearest Neighbor interpolation, which while fast, dosen't look very good. Bilinear offers pretty good results scaling both up or down at fast speeds. Bicubic interpolation is the next step up. If you find the resized image to be subpar, then come back and post. There are a couple of other ways to resize an image.
    Note, however, if 2550 x 3300 is not the same aspect ratio as the the TIFF image you loaded, then the resized image will look shrunk or stretched along one dimension. There is absolutely no way around this no matter what resizing technique you use. You'll need an image whose original dimensions are in a 2550/3300 = .772 ratio if you want the resized image to not look like it's streched (you can crop the opened image if you want).
    *3)* Now we save the "newImage" with the same class we read images with: ImageIO . It has these static methods
    write(RenderedImage im, String formatName, File output)
    write(RenderedImage im, String formatName, ImageOutputStream output)
    write(RenderedImage im, String formatName, OutputStream output)You'll suply the resized BufferedImage as the first parameter, "tiff" as the second parameter and an appropriate output for the third parameter. It's pretty much a one line statement to read or write an image. All in all, the whole thing is about 7 lines of code. Not bad of all.
    Now as for the 300 dpi thing, there is a way to set the dpi in the Image's metadata. I'm pretty good at reading an image's metadata, but I've never really tried writing out my own metadata. I know you can set the dpi, and I have a somewhat vague idea how it might be done, but it's not something I've tried before. I think I'll look more into it.

  • I am considering upgrading to lightroom 5. But first can I talk to someone to fix a major issue. My catalogue has disappeared and a new one without my chosen images has taken its place.I need to retrieve my original duplicate/ changed images?

    Hi there,
    I am considering up grading to lightroom 5. But first I need to be sure I can retrieve my original library, which has been replaced by images from iphoto I hadn't slected. I currently use a lightroom 3 and have spent countless hours as a professional photographer improving my original photographs. Can I speak to someone regarding this matter?
    I would really appreciate your help in resolving this matter asap.
    Kind reagards
    Pablo

    Morning Geoff,
    Hope you slept well. I have been busy looking into many of the things you
    have told me.
    Where should I start so much info.
    There are 7 Ircat folders. Some empty some contain approx 7000 images. Some
    of the images /altered on lightroom are here few maybe 50. Although they
    are missing or offline and now in the CR2 format ( photoshop elements),
    which is very strange. I think this an issue as to why it may have all
    gone, changed? In another Ircat folder many images are in the condition I
    left them although not all of them, the latest 2013 are missing. Also in
    another extension Ircat folder many of the images are there I imagine the
    same 7000 but cant be seen?
    On my hard drive there is a folder I cannot open, it reads in progress and
    says no App to open document, search App store for Application. Perhaps
    this is the key, I also have little storage space on my hard drive.
    Many images under 2012 on hard drive have the tiff image, with altered
    version created on lightroom some now show as CR2 version to view the photo
    photoshop elements opens up automatically, which I never use. I do feel
    this is a major reason/ issue?
    Also under certain folders with dates my images appear pixelated or blurry.
    Under another heading the jpg version is great approx 73 some are missing
    the latest and most important, unfortunately I want in Tiff.
    Under another folder on hard drive I have many of the images I am chasing
    approx 60 but the size is a concern 2-2.5mb, should be around 40mb?
    In another folder all are in CR2 photoshop elements.
    Time Machine, which I'm sure was inactive tells me it could not back up
    disk?
    Under thumbnails it looked promising all in DNG many missing and in CR2
    format.
    I thought I would let you know in case I haven't already that the memory on
    the imac is very low, hence why I began trashing/ deleting images yesterday
    thet are saved on my hard drive this is when all this mess occured.
    Are there short cuts I can use to remove images that are duplicates without
    lightroom becoming tempermental?
    Were too next? I am hoping the originals can be found and installed in
    their original form.
    I really appreciate all of your help and time, please help me
    Cheers mate
    Pablo
    On Mon, Dec 29, 2014 at 8:06 PM, Pablo Hughes <[email protected]>

  • Java returning incorrect values for width and height of a Tiff image

    I have some TIFF images (sorry, I cannot post them b/c of there confidential nature) that are returning the incorrect values for the width and height. I am using Image.getWidth(null) and have tried the relevant methods from BufferedImage. When I open the same files in external viewers (Irfanview, MS Office Document Imaging) they look fine and report the "correct" dimensions. When I re-save the files, my code works fine. Obviously, there is something wrong with the files, but why would the Java code fail and not the external viewers? Is there some way I can detect file problems?
    Here is the code, the relevant section is in the print() routine.
    * ImagePrinter.java
    * Created on Feb 27, 2008
    * Created by tso1207
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.print.PageFormat;
    import java.awt.print.PrinterException;
    import java.io.File;
    import java.io.IOException;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.FileImageInputStream;
    import javax.imageio.stream.ImageInputStream;
    import com.shelter.io.FileTypeIdentifier;
    public class ImagePrinter extends FilePrintable
       private final ImageReader _reader;
       private final int _pageCount;
       private final boolean _isTiff;
       //for speed we will hold current page info in memory
       private Image _image = null;
       private int _imgWidth = 0;
       private int _imgHeight = 0;
       private int _currentPage = -1;
       public ImagePrinter(File imageFile) throws IOException
          super(imageFile);
          ImageInputStream fis = new FileImageInputStream(getFile());
          Iterator readerIter = ImageIO.getImageReaders(fis);
          ImageReader reader = null;
          while (readerIter.hasNext())
             reader = (ImageReader) readerIter.next();
          reader.setInput(fis);
          _reader = reader;
          int pageCount = 1;
          String mimeType = FileTypeIdentifier.getMimeType(imageFile, true);
          if (mimeType.equalsIgnoreCase("image/tiff"))
             _isTiff = true;
             pageCount = reader.getNumImages(true);
          else
             _isTiff = false;
          _pageCount = pageCount;
       public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          throws java.awt.print.PrinterException
          int drawX = 0, drawY = 0;
          double scaleRatio = 1;
          if (getCurrentPage() != (pageIndex - getPageOffset()))
             try
                setCurrentPage(pageIndex - getPageOffset());
                setImage(_reader.read(getCurrentPage()));
                setImgWidth(getImage().getWidth(null));
                setImgHeight(getImage().getHeight(null));
             catch (IndexOutOfBoundsException e)
                return NO_SUCH_PAGE;
             catch (IOException e)
                throw new PrinterException(e.getLocalizedMessage());
             if (!_isTiff && getImgWidth() > getImgHeight())
                pf.setOrientation(PageFormat.LANDSCAPE);
             else
                pf.setOrientation(PageFormat.PORTRAIT);
          Graphics2D g2 = (Graphics2D) g;
          g2.translate(pf.getImageableX(), pf.getImageableY());
          g2.setClip(0, 0, (int) pf.getImageableWidth(), (int) pf.getImageableHeight());
          scaleRatio =
             (double) ((getImgWidth() > getImgHeight())
                ? (pf.getImageableWidth() / getImgWidth())
                : (pf.getImageableHeight() / getImgHeight()));
          //check the scale ratio to make sure that we will not write something off the page
          if ((getImgWidth() * scaleRatio) > pf.getImageableWidth())
             scaleRatio = (pf.getImageableWidth() / getImgWidth());
          else if ((getImgHeight() * scaleRatio) > pf.getImageableHeight())
             scaleRatio = (pf.getImageableHeight() / getImgHeight());
          int drawWidth = getImgWidth();
          int drawHeight = getImgHeight();
          //center image
          if (scaleRatio < 1)
             drawX = (int) ((pf.getImageableWidth() - (getImgWidth() * scaleRatio)) / 2);
             drawY = (int) ((pf.getImageableHeight() - (getImgHeight() * scaleRatio)) / 2);
             drawWidth = (int) (getImgWidth() * scaleRatio);
             drawHeight = (int) (getImgHeight() * scaleRatio);
          else
             drawX = (int) (pf.getImageableWidth() - getImgWidth()) / 2;
             drawY = (int) (pf.getImageableHeight() - getImgHeight()) / 2;
          g2.drawImage(getImage(), drawX, drawY, drawWidth, drawHeight, null);
          g2.dispose();
          return PAGE_EXISTS;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @return
       public int getPageCount()
          return _pageCount;
       public void destroy()
          setImage(null);
          try
             _reader.reset();
             _reader.dispose();
          catch (Exception e)
          System.gc();
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public Image getImage()
          return _image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgHeight()
          return _imgHeight;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgWidth()
          return _imgWidth;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param image
       public void setImage(Image image)
          _image = image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgHeight(int i)
          _imgHeight = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgWidth(int i)
          _imgWidth = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getCurrentPage()
          return _currentPage;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setCurrentPage(int i)
          _currentPage = i;
    }Edited by: jloyd01 on Jul 3, 2008 8:26 AM

    Figured it out. The files have a different vertical and horizontal resolutions. In this case the horizontal resolution is 200 DPI and the vertical is 100 DPI. The imgage width and height values are based on those resolution values. I wrote a section of code to take care of the problem (at least for TIFF 6.0)
       private void setPageSize(int pageNum) throws IOException
          IIOMetadata imageMetadata = _reader.getImageMetadata(pageNum);
          //Get the IFD (Image File Directory) which is the root of all the tags
          //for this image. From here we can get all the tags in the image.
          TIFFDirectory ifd = TIFFDirectory.createFromMetadata(imageMetadata);
          double xPixles = ifd.getTIFFField(256).getAsDouble(0);
          double yPixles = ifd.getTIFFField(257).getAsDouble(0);
          double xRes = ifd.getTIFFField(282).getAsDouble(0);
          double yres = ifd.getTIFFField(283).getAsDouble(0);
          int resUnits = ifd.getTIFFField(296).getAsInt(0);
          double imageWidth = xPixles / xRes;
          double imageHeight = yPixles / yres;
          //if units are in CM convert ot inches
          if (resUnits == 3)
             imageWidth = imageWidth * 0.3937;
             imageHeight = imageHeight * 0.3937;
          //convert to pixles in 72 DPI
          imageWidth = imageWidth * 72;
          imageHeight = imageHeight * 72;
          setImgWidth((int) Math.round(imageWidth));
          setImgHeight((int) Math.round(imageHeight));
          setImgAspectRatio(imageWidth / imageHeight);
       }

  • How to edit 16bit TIFF image sequence file in FCP?

    Dear all,
    I have a number of 16 bit TIFF image sequence files (2048 x 1024 resolution) - some of them are RED footage, and others came directly from our f/x guy. We are going into a color correction session in a post house and we've been asked to provide a sequential 16 bit TIFF image sequence of the edited time line.
    I need to do a cross dissolve b/w most of the clips I have. I have created image sequence QT movie (reference files) from the TIFF images. Though they play fine in QT player, when I try importing into FCP, I am met with a "general error". I tried both dragging it into QT, as well as File --> Import.
    I am wondering what can I do to get these clips into FCP in order to apply the cross dissolve transitions I need. Is this a problem relating to the 16bit nature of the TIFF files?
    I tried exporting the TIFF image sequence standalone QT movie, and those imported fine. However, I have a feeling that the standalone movie conversion also decrease my bit depth from 16 to 8. (When I do my final TIFF output from FCP after dissolves / transitions had been applied, each TIFF file is now 8 MB instead of 12 MB, hence my suspicion that the bit depth is adjusted).
    Are there any settings I am missing, or does FCP simply don't support 16 bit image sequence reference file. As a test, I had also converted all my TIFF to jpg, and created jpeg image sequence reference file. These reference QT file can be successfully imported to FCP and I can edit them as if they are a clip.
    If FCP is not able to handle these files, what are my other options? After Effects?
    Any help is appreciated.
    Thank you.
    Michael
    <Edited by Moderator>

    As far as I know, both FCP and Color only support up to 10 bit color, which is 1024 levels for each color channel, more than enough for avoiding color banding.
    If you need 16 bit for sure, I believe AE will support 16 bit output. Another 16 bit application would be the extended version of Photoshop, which has some limited time line capability.

Maybe you are looking for

  • How do I get 2 layers to move at the same time?

    How do you get 2 layers to move at the same time?

  • Qosmio F30: Can't connecting to internet with Wlan securely

    I have recently purchaced a Toshiba Qosmio F30 laptop, and have spent the best part of two days trying to connect to the internet wirelessly. After constantly calling Wanadoo (my provider) and blaming them for it all, I am told that the laptop itself

  • Import MBOX

    Hi I recently migrated from Windows 7 to Mac. I used Migration Assistant to migrate all data including Mails (I used Outlook earlier). After migration, I wanted to use Outlook again in Mac but realised that all my mails have been included in the defa

  • Credit Management Horizon not in months

    Hi All, In Dynamic credit check, if i want to enable the horizon as weeks or days instead of months, how to do that. When viewing the credit check screen for dynamic credit check, the field for selecting the month/week/days is always greyed out with

  • Using TM backup temporarily on different iMac

    Looking for best way to temp. use appns./access data from ext. HD TM backup on a different iMac while my mine is being repaired. My iMac crashed, but I have complete backup via TM on ext. HD. I want to access data from my TM backup using wife's iMac