Save U32 bit image as 16 bit tiff

Right now I am using IMAQ to grab a RGB(U32) color image in real-time. I am then trying to save the image as a 16 bit tiff file. However, the images only save as 8 bit tiff files. How can I fix this problem?
Thanks,
David

Hi David,
The simple VI that I attached reads an image from file and writes it as a TIFF.  If you would like to test it, you can open up one of the images in the Vision >> Images folder (for example, candy.png which is U32) and you will see that it should save it as a U32 TIFF file.  If the image you are reading in is I16 (i.e. IMAQ Create has type I16 wired in as a constant) then you should get an appropriate image out.  If you are successful with this VI, I would recommend migrating it into your application.  I hope this helps give you a good start.
Vu
Attachments:
Write TIF.vi ‏55 KB

Similar Messages

  • Can PSE8 for mac convert an 8 bit image to 16 bit?

    can Photoshop Elements 8 for mac convert an 8 bit image to 16 bit?
    I use Photomatix Pro and when I am working with a single image in Photomatix Pro, it has to be 16 bit.

    Yes, you can. These are the steps when using the elements editor.
    Depending on the file format:
    1. If this file is from a camera raw file, simply open the original
        raw file and at the bottom of the camera raw dialog choose 16 bits.
        This would open the file in pse editor as a 16 bit file.
        Then save as a tif file with no compression.
    2. If the file is a jpg or tif file, in the pse editor select: File>Open As>Camera Raw.
        This will open the file in the camera raw dialog. Then select 16 bit from the menu
        at the bottom of the camera raw dialog. After the file opens in pse editor, in 16 bits,
        save as a tif with no compression.
    3. If the file is a psd file with no layers, then step 2 will work. If the psd file has layers,
        open the the file in pse editor and resave the file using maximize compatibilty.
        This will allow the psd file to have both layers and open in the camera raw dialog as
        in step 2. When you open the file in the pse editor, it will just be a single layer and then
        just save as a tif file with no compression.
    Hope this helps.
    MTSTUNER

  • Need conversion mechanism for converting 24 bit image to 16 bit

    In my java project I need to convert 24 bit image to 16 bit image. I don't have any clue. Please provide me the option to implement it.
    Thanks,
    jai

    That doesn't tell me much, and I know what you're talking about. I doubt that it tells the OP anything useful whatsoever.Sorry EJP, it was a mouthful I know. Maybe this will help instead, a ColorConversionOps class to work on *32 bit > 16 bit > 32 bit colors*. To help clarify where the 16 bit color input and output goes, some of the methods return or require parameters of type short. Also take notice the bitmask for variables of type short vs the bitmasks for int. AND pay particular attention to the unsigned right bit-shifting of the most-significant-digit.
    public class ColorConversionOps
      public static short convert32_16(int rgb) {
        int a = ((rgb & 0xF0000000) >>> 16);
        int r = ((rgb & 0x00F00000) >>  12);
        int g = ((rgb & 0x0000F000) >>   8);
        int b = ((rgb & 0x000000F0) >>   4);
        return (short)( a | r | g | b);
      public static int convert16_32(short rgb) {
        int a = ((rgb & 0xF000) << 16);
        int r = ((rgb & 0x0F00) << 12);
        int g = ((rgb & 0x00F0) <<  8);
        int b = ((rgb & 0x000F) <<  4);
        return (a | r | g | b);
      public static void printRGB_32(int rgb) {
        System.out.println("a="+((rgb & 0xFF000000) >>> 24));
        System.out.println("r="+((rgb & 0x00FF0000) >>  16));
        System.out.println("g="+((rgb & 0x0000FF00) >>  8));
        System.out.println("b="+ (rgb & 0x000000FF));
        System.out.println();
      public static void printRGB_16(short rgb) {
        System.out.println("a="+((rgb & 0xF000) >>> 12));
        System.out.println("r="+((rgb & 0x0F00) >>  8));
        System.out.println("g="+((rgb & 0x00F0) >>  4));
        System.out.println("b="+ (rgb & 0x000F));
        System.out.println();
    }Now to make the conversion from 32 bit color to 16 bit color and back. NOTICE there willl be a loss of precision -- just like someone else has already said.
    public class Test
      public static void main(String[] args)
        int rgb = 0xFFFFFFFF;
        ColorConversionOps.printRGB_32(rgb);
        //a=255
        //r=255
        //g=255
        //b=255
        rgb = ColorConversionOps.convert32_16(rgb);
        ColorConversionOps.printRGB_16((short)rgb);
        //a=15
        //r=15
        //g=15
        //b=15
        rgb = ColorConversionOps.convert16_32((short)rgb);
        ColorConversionOps.printRGB_32(rgb);
        //a=240
        //r=240
        //g=240
        //b=240
    }And now we see, the reason 16bit color is so unpopular to the rest of the world, but not for us here!

  • Quicktime converting 24 bit images to 16 bit images on paste

    I am doing image processing of a QuickTime (7.1.5 pro) movie in Photoshop (CS2) using Applescript. When I copy an image (either with Applescript or manually) and paste it into a new QuickTime Player movie the image gets converted to a video depth of 16 (thousands) rather than 24. I have tried:
    set DestMovie to make new movie with properties {data rate:SourceRate, video depth:24, high quality:true} -- I also tried video depth:0
    paste
    I also try:
    tell movie 1
    paste given video depth:24 -- I've also tried just paste
    end tell
    and still it converts my images to thousands. The image gets to photoshop perfectly. If I paste it into a Pages document the image depth is correct. I have tried both RGB and CMYK in 8 and 16 bit depths in Photoshop. If I save the file as JPEG in high quality mode and then open the file with Quicktime and copy and paste it, it works great, the only problem is I then have to make a new file for every image I process because if I close the file, QuickTime keeps it open so Photoshop can't then save to the same file.....
    Will someone please help me figure out how to keep my image quality on pasting into Quicktime???
    Thanks
    Powerbook G4   Mac OS X (10.4.9)  

    I open my original movie in Quicktime. I make a new movie in Quicktime for the modified images to be pasted into.
    I copy the current frame from my source movie and paste it into Photoshop. I do my image processing and then save as a jpeg high quality and close my file (which strips out the audio from a muxed mpeg-1 file) then reopen the file in Photoshop. Now I have a good quality image in Photoshop. I have been using RGB 8 bit as my mode in Photoshop. I only tried CMYK to see if it would work better. It was exactly the same.
    I then do a select all and copy in Photoshop, then go to Quicktime and do a paste. This is when it gets converted to 16 bit depth. If I do the same exact sequence and paste into a Pages document the image stays 24 bit, so I am pretty sure it is something in Quicktime.
    Again, if I save the file in Photoshop and then open the same file in Quicktime, copy the image and then paste it into my destination movie, it works great. The only problem with this method is I have 15 minutes of video to process with is 27,000 jpeg files in the end. I prefer to use one file if I can. The reason for the 27,000 files is that when I open an image in Quicktime and paste it into a movie, it saves it as a track in the movie and even when I close the original file, Quicktime keeps it as in use. When I look at the movie properties, it keeps the original file in the list until I do a save as movie and it flattens the movie. If I flatten the movie once, then when I do another save, it keeps the original file open again. I would have to do a save as movie... again 27,000 movie files now. Geez...
    Thanks!

  • How do i save STACKS of images (e.g. TIFF) as a SINGLE file in IMAQ?

    I would like to save stacks of images (movies and time series) as single files (TIFF in particular) but i can only find support in IMAQ for saving single images to single files. Does anyone know how to save STACKS? (As far as i know that is a common feature in most frame grabbers).
    I am using a PCI-1408 card for analog acquisition and NI-IMAQ driver in Windows 2000.

    Bernhard,
    There are no utilities in IMAQ to save image sequences in a single file.
    One possible solution, if you aren't trying to compress the images, is to extract the 2D array of pixel intensities and save them as a standard array. You would be able to store as many arrays as you want in a single file.
    If you want to compress the images, there are utilities for creating AVI files. I have used a wavelet compression utility that I wrote LV drivers for, also. If you are willing to spend a little money, that might be a good solution. You can contact me at bruce@ammonsengineering if you want to discuss it further.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • How to convert a 16-bit image to 8-bit

    I am having difficulties in skeletonizing my image. Although I already threshold my image, it still cannot be skeletonized. When I create the image using IMAQ create, the image type must be set to 16-bit, otherwise it will create an error message. An enthusiast in the forum told me that the image must be 8-bit so that it can be skeletonized. But I do not know how to convert the image from 16-bit to 8-bit. So is there anybody out there that can provide me with a solution. Attached is the VI that I used. Really appreciate your help.
    Attachments:
    Image_Acquisition.vi ‏68 KB

    Try using the IMAQ Cast Image function under Motion & Vision>>Vision Utilities>>Image Management>>IMAQ Cast Image.
    Regards,
    Steve

  • Convert 256-bit image to one-bit

    I want to convert 256-bit bmp image to 1-bit.So please help me.

    armalcolm wrote:
    OK here's a frameworkUmm... Drawing onto a BI of TYPE_BYTE_BINARY should achieve this in just a few lines. The API says
    When color data is stored in an image of this type, the closest color in the colormap is determined by the IndexColorModel and the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in the IndexColorModel colormap.
    Of course, if this is homework then OP will probably be required to reinvent the wheel.
    db

  • Save 12 bit image as 12 bit image, not 16 bit

    Hi all,
    I have 12 bit gray scale images coming from a camera and am trying to save these images.
    I called function "IMAQ Write to File 2" to do this job.
    The function always scales the original data from 12 bit to 16 bit and then save it. 
    In the end, I have a 16-bit tiff image.
    Is there anyway that I can save my original 12 bit data without any scaling?
    Thanks a lot for your information.

    hi,
    for every data you save, a specific data type is used...so for example 16 bit integers, 8bit integers... there's no datatype with a length of 12 bit, so this can't be done by "simple methods"...if your intention is to save hard disk space, then better use a compression or use tif-files with lzw-compression. if you really like to save 12 bit, you can do it like this: use for example 16 bit integers for saving, but only use 12 bit...the left four bits are used by the next integer and so on:
    2 16 bit integers:
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  -  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 - ...
    use them as follow:
         FIRST 12 BIT        SECOND 12 BIT         AGAIN 12 BIT
    1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2     2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3
    This will be a lot of calculation stuff, you can for example do it by converting a number to a bool array or mathematical functions...as you like
    Hope this helps
    christian
    THINK G!! ;-)
    Using LabView 2010 and 2011 on Mac and Win
    Programming in Microsoft Visual C++ (Win), XCode (Mac)

  • Dealing with IMAQ saving 12 bit images as 16 bit

    I'm trying to get an image of a CCD camera which has a depth of 12 bit. I read on the forums here that it is stored as 16 bit. I am however curious as to what this means: are the values of the image scaled? So is like a value of 4095 scaled to be a value of 65535? And a value of 2047 scaled to a value of 32767?
    Or does it leave the actual values of the pixels unchanged?

    Hello Choisai,
    Or in other words:
    The actual pixel/integer values should stay the same.
    You could consider this as a sort of zero-padding at the most significant side.
    This example can help you understand the concept:
    http://digital.ni.com/public.nsf/allkb/6D4D5300ECE4AFD08625752700680770
    Just have a look at the maximum and minimum values that are being generated in the 2D array.
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.

  • Best way to combine 8-bit and 16-bit image files?

    I produce large photographic art prints by combining my own edited 16-bit RAW photo images with 8-bit stock photo images and 8-bit photoshop artwork. I used to just reduce my 16-bit photos to 8-bit and then edit my composite image as 8-bit, but I ran into banding and other problems in the color gradients I created later in my composite image.
    I want my composite image to be 16-bit to get more accurate colors and better gradients. What is the best way to bring 8-bit image files into my composition and maintain best quality? Is it good to convert 8-bit images to 16-bit in PS before importing? I also heard about bringing 8-bit images in as Smart Objects? Thanks for any help on this.

    *Photonic wrote:
    Thanks Jack and Noel. My workflow usually starts w. a 16-bit RAW image brought into Photoshop as the background layer of the master file. Color space is AdobeRGB. Then 8-bit stock photo and art elements (objects) are brought in by dragging the open 8-bit image up to the master image file tab, and then dropping it back into the image window after the file opens.
    Should I use the "Paste In" command instead? I usually avoid copy/paste since some of my element files are usually over 100MB and that seems to challenge my Mac after a while.
    Could I convert the 8-bit image files prior to import, like Noel suggests (Image>Mode>16bits)?  Thanks.
    There is no need to convert 8bit open documents to 16bit mode Photoshop will convert the copied layers to 16bit bit during the drag copy.  Converting the open document would just increase Photoshop RAM usage every layer pixels bytes used  would double in size.
    If you element files are over 100MB they are most likely layered files.  If all you need is a composite you should avoid using Place for that will needlessly inflate your document size. Instead open the element file create a new layer that is a stamp visible layer (Shift+Alt|Opt+Ctrl|Cmd+E) and drag that layer to you document then close nosave your element file. Copy only copies the targeted layer or there is a Copy Merge that copies the composit merge of all targeted layers. It a bit hard to create an action that would be able to use Copy or Copy Merge. Using the above stamp visible way can be made into an action. You also do not want to drag all the layers to your document if you just need a composit layer.
    You could also automate the element file copy with an action.
    Action Step 1 Insert menu into File>Open this will be an interactive step you must select a file to open. When the action is played.
    Step 2 (Shift+Alt|Opt+Ctrl|Cmd+N) Create a new empty layer This will always work
    Step 3 (Shift+Alt|Opt+Ctrl|Cmd+E) stamp visible layers into the new layer
    Step 4 (Ctrl|Cmd+A) select all
    Step 5 (Ctrl|Cmd+C) Copy
    Step 6 Close current document no save
    Step 7 (Ctrl|Cmd+P) Paste into the document your working on Photoshop will convert to 16bit if the document is 16bit mode and the clipboard content is 8bit.
    When you use Photoshop and do something.  Think to yourself how did Photoshop do what you asked it to do. Thing about what is involved what layers must be used etc. How is the feature/function done.
    Message was edited by: JJMack
    Message was edited by: JJMack

  • How to display 16 bit image in VBAI custom inspection interface?

    I'm working with 16 bit grey scale images in VBAI. In configuration mode, there is an option on how to handle 16 bit display mapping, and it works very well to preview the effect of the different display possibilities. However, those settings do not carry over into inspection mode. In the custom inspection interface, if I right click on the image display area it also has an option for 16 bit image mapping, with a default value of "Full Dynamic". It allows me to choose something else, but if I save the custom interface and reopen it, the value always reverts back to "Full Dynamic" For the time being, I've worked around it by adding a vision assistant step to convert the 16 bit image to 8 bit, but I would really prefer to take this step out. Are there any tricks to getting the image mapping setting to work properly within the custom interface? Thanks, Jason

    I would not expect that to happen. I will investigate. In the mean time if you have LabVIEW you can export the custom ui and edit the block diagram in LabVIEW. Then you can add a property node for the image display control to set the 16 bit display mapping when the vi runs. Make sure to reimport this updated ui and edit the step that updates the custom ui to run the code when the step executes. I'll let you know what I find out about why it reverts when you try to set it from the editor in VBAI.
    Thanks
    Brad

  • How can I keep overlay image on 8 bit image at video acqusition​?

    Hi, I am using AVT camera Pike with Laview vision 2012
    When I use Example code 'Grab and Attributes Setup.vi' (<NI supported Example),
    I simply add the event case for overlay function (such as 'IMAQ Overlay Oval') with Image  by Local Variables connection (image input - output).
    Event case:
                 Image------[IMAQ Overlay Oval]--------Image
                 Rectangle Control ---|
    IMAQ Overlay should keep the overlay on buffer memory if I input the rectangle value.
    Problem is that the overlay disappeared if I use 8 bit image format?.
    but at the 16bit image format, the image keep the overlay image (colored overlay).
    It seems the overlay buffer is removed by acquiring new 8 bit image, but 16 bit format, the overlay is still alive. 
    Is it bug or what am I wrong?  

    upload the error situation block diagram
    Attachments:
    8bit overlay error1.jpg ‏364 KB

  • Using IMAQ Cast Image to convert 16 bit to 8 bit image.

    I am trying to convert a 16 bit image to a bit image, and I am using IMAQ Cast Image. I am wondering what I am supposed to wire into the # of shifts? When I use NI Vision Assistant it asks I can convert by the adjust dynamic method. Does anyone know how to do this with IMAQ Cast Image? Thank you in advance.

    The number of shifts is the number of bits that will be chopped (in the dark regions) from the initial image to fit into 8 bits.
    For instance, if you have a 10 bit image, compressing into an 8 bit image will obviously introduce some losses. You can decide to loose information either in the "whithe" parts or in the "black" parts of the image.
    With #shifts = 0, the two most significant bits will be lost, so the whitest parts of the image will be uniformely white, but the darl grey levels will be preserved.
    With #shifts = 2, the two least significant bits will be lost, preversing the whitest parts grey variations, but losing the subtilities in the darkest parts.
    With #shifts = 1, a single bit is lost on either sides...
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • What happens to a 12-bit image in LabVIEW/IMAQ Vision?

    I'm using the DALSA DALSTAR 1M30 camera, and we are building a cable for it, and have not yet got it up and running, but I am already programming our application for it. I was wondering, since the IMAQ Vision VI's seem to pertain to 8-bit, 16-bit, and floating point images, I was wondering if they will work fine with a 12-bit image like the one from the 1M30 camera. I was also wondering, if they do work fine, what format the output of a VI like IMAQ ImageToArray will be. Will the 12-bit pixel values be converted into 16-bit?
    Thanks for the help.

    A 12 bit image is stored within IMAQ as a 16 bit image. Only routines that accept 16 bit images can be used for manipulating the image.
    The IMAQ WindDraw converts 16 bit images to 8 bit images for display, using the selected method. You can also manually convert to an 8 bit image for automatic thresholding and other routines that don't accept 16 bit images. For most applications, you will want to shift it 4 bits during conversion so the most significant bits are preserved.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Using Labview to save image from PCO camera(12 bit images)

    Hello,
     I have labview 8.5 version in my Winxp. I have PCO camera (pixelfly). So far I know that it saves 12 bit images. I used normal save pattern of labviewas png,tiff or jpeg. As .pngit saves the images as 32 bit and as bmp it takes 8 bit images. But the picture quality is not good. I used IMAQ to take single picture and to save it I used IMAQ Write File 2. I used the following mechanism.
    1) IMAQ ImageTo Array--> To unsigned word integer--->IMAQ ArrayToImage--->IMAQ Write File 2---> save it as .png file.
    Please inform where I made the problem. Why the picture is not as like as 12 bit images of PCO Camera.
    Thanks,
    Stuttgart University,Germany.

    IMAQ Create.vi supports Grayscale(I16) and RGB (U64). Both should be suitable for 12Bit Greyscale.
    Documentation of "IMAG Write File 2.vi" says:
    IMAQ Write TIFF File 2
    Writes an image to a file in TIFF format.
    Note  16-bit monochrome images and 64-bit RGB images are nonstandard extensions of the TIFF standard. Most third-party applications cannot read 16-bit monochrome or 64-bit RGB TIFF files. For compatibility with most applications, write 16-bit monochrome images or 64-bit RGB images into PNG files.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

Maybe you are looking for

  • Two computers/users. One iTunes account. Different question.

    My husband and I share an iTunes account but 90% of the tunes in each of our libraries are specific to our own computers and we'd like to keep it that way. I set up iTunes match via mine, if I set it up on his (using the same ITunes store account) wi

  • Ref. monitor for pal,ntsc and HD

    hey there, i am working more and more on my own edit station. so i want to make it more efficient. i need a monitor or TV to see my edits on a bigger scale, something like a reference screen!! and i need a pci card to connect it, too. but here is the

  • Why did you break my phone w/ kitkat?

    Last week I loved my phone.  Since 4.4.2 update I'm about ready to throw it away. There are so many backward steps in the kit kat update I don't know where to begin... Someone decided customers would accept Swype substitutes.  I disagree.  Google key

  • Adobe Crashing when clicking on Book Marks.

    1. Open a file in Adobe Acobat XI Pro. 2. Go to the Bookmark section. 3. Click on eac hindividula bookmark to see if the "destination has set". 4. Adobe Acrobat XI Pro suddenly closes out entirely. 5. Unsaved documents is lost.

  • Classic Workspace in Dreamweaver CC

    In Adobe videos about Dreamweaver CC it states we should use the Classic Workspace. However I have noticed the Classicc WS has been replaced by Compact and Expanded. How do I either bring back Classic or make a custom workspace as there is no instruc