32 Bit Image to Image Array

I am attempting to get an image array from a 32 Bit image.  I
attempted to use IMAQ ImageToArray.  This did not work when
passing in a 32bit RGB image.  It works fine after I convert the
image to 8 or 16 bit image, but this is a step I am attempting to
remove.  So, my main questions is there a way to get an Array of
an image directly from a 32 Bit Image?

In the Color Utilities there is a function called IMAQ Color Image to
Array.  That is the one you want to use.  Hopefully you have the Vision
Development module or you may not have access to this vi.
Randall Pursley

Similar Messages

  • Fail to index out images from an array of images!

    Hi all,
    I encountered this problem lately. I am indexing a number of images in an array using a for loop. Next the array of images (16 bit) is used somewhere else in the program; it is indexed and the images are to be processed and displayed. The problem is; when trying to index the images from the arrays using the index array the result is the same image regardless of the index!
    Can anyone explain that for me?
    Thanks in advance
    Solved!
    Go to Solution.

    When you used the IMAQ create VI you specified each image to use the same name of "image".  Each image has to have a unique name.  I edited your VI to give a unique name for each image and I was able to view three different images in three different viewing panes.
    Attachments:
    Image Array Reworked.vi ‏19 KB

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • Can I convert 3D image to an array of pixels in LabVIEW?

    Hi all;
    I am still new with labview. I has 1 question, can I convert 3D image to an array of pixels using labview?
    Most of the examples I found they only convert 2D image. Hope anyone can give me some hint.
    Thank You

    look at this thread.
    It has links to other threads where the 3D graphs were used.
    You should also search for "gif reader" to find threads where images are read from gif files.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Create image from byte[]array on server side

    Hello everyone..
    I'm developing an application which will take snapshots from a mobile device, and send it to my pc via bluetooth. I have my own midlet which uses the phone camera to take the snapshot, i want to transfer that snapshot to my pc.
    The snapshot is taken is stored in an array byte.
    The image can be created on the phone itself with no problem using : image.createImage(byte[])
    my problem is that when i send the array byte via bluetooth, and receive it on the server, i cannot create the image using the :image.createImage() code
    The connection is good since i have tested by writing the content of the array in a text file.
    Piece of midlet code:
                try{
                     stream = (StreamConnection)Connector.open(url);
                     OutputStream ggt = stream.openOutputStream();
                     ggt.write(str);
                     ggt.close();
                }catch(Exception e){
                     err1  = e.getMessage();
                }where str is my array byte containing the snapshot
    And on my server side:
    Thread th = new Thread(){
                   public void run(){
                        try{
                             while(true){
                                  byte[] b = new byte[in.read()];
                                  int x=0;
                                  System.out.println("reading");
                                  r = in.read(b,0,b.length);
                                  if (r!=0){
                                       System.out.println(r);     
                                       img = Image.createImage(b, 0, r);
                                                            //other codes
                                       i get this error message:
    Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: javax.microedition.lcdui.ImmutableImage.decodeImage([BII)V
         at javax.microedition.lcdui.ImmutableImage.decodeImage(Native Method)
         at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:906)
         at javax.microedition.lcdui.Image.createImage(Image.java:367)
         at picserv2$1.run(picserv2.java:70)
    Please anyone can help me here? is this the way to create the image on the server side? thx a lot

    here is exactly how i did it :
    while(true){
                                  byte[] b = new byte[in.read()];
                                  System.out.println("reading");
                                  r = in.read(b, 0, b.length);
                                  if (r!=0){
                                       Toolkit toolkit = Toolkit.getDefaultToolkit();
                                       Image img = toolkit.createImage(b, 0, b.length);
                                       JLabel label = new JLabel(new ImageIcon(img) );
                                       BufferedImage bImage = new BufferedImage(img.getWidth(label),img.getHeight(label),BufferedImage.TYPE_INT_RGB);
                                       bImage.createGraphics().drawImage(img, 0,0,null);
                                       File xd = new File("D:/file.jpg");
                                       ImageIO.write(bImage, "jpg", xd);
                                       System.out.println("image sent");
                             }Edited by: jin_a on Mar 22, 2008 9:58 AM

  • Is possible to Convert a 1 bit B&W Tiff image to a 16 Bit Greyscale Tiff image?

    Hi there,
    I am trying to convert a 1 bit Black & White Tiff image to a 16 Bit Greyscale Tiff image, Anyone out there know if it is possible and how it may be done? We are using Adobe Acrobat 9 Pro Extended.
    Any help would be appreciated.
    Cheers, Chris

    Almost any graphic editor can do it, but it doesn't make a sense. The picture information remain the same - 1 bit. It has nothing to do with Acrobat.

  • Display image from byte array

    Hello Everybody,
    I need to display an image given in a byte array, how can I show this image in a JFrame?
    1. I tryied saving the image in a .jpg file,
         File file1 = new File("Path to my destination image");2. then I use a FileOutputStream to save the image in the path:
            FileOutputStream fos1 = new FileOutputStream(docu);
            fos1.write(ImageInbyteArray);
            fos1.close();3. Once I have the image in a file I'm trying to load it using a JButton, but the JButton doesn't display the image. I think that for some unknown (at least for me ;-) reason the file isn't still available to be used in the ImageIcon, this is my code:
            imgIconDocu = new ImageIcon("Path to my destination image");
            jBtnDocu = new JButton(imgIconDocu);What's wrong here?
    Thanks a lot

    Does the byte array contain a JPEG image? Where did
    you get the contents of the byte array?yes the array contains the JPEG image, I have a database in PostgreSQL, and the images are stored in blob in the database. I have to call a service in the server and in return it gives me the 3 images as byte arrays, that's the reason I only have the byte arrays. so I tryed saving the images as jpeg files in my hard disk to show them, but it appears that they are not available to show them in Swing after saving them. I can only show the images if I close my application and start it again :-(
    I tryed flushing and closing the FileOutputStream after the writting process (fos.write(bytearrayImage);
    fos.flush();
    fos.close();)
    Y also tryed:
    fos.write(bytearrayImage);
    fos.close();
    fos.flush();But it doesn't work either :-(
    What do you recommend me?.
    Thanks a lot,
    Johnny G L

  • Which bit rate for image to use?

    How is image quality affected by an 8-bit image with 256 levels of brightness VS. a 12-bit with 4,096 levels? Is there a reason to not want the extra levels of brightness? Does this affect how colors are represented or just their brightness levels?

    StanWelks wrote:
    How is image quality affected by an 8-bit image with 256 levels of brightness VS. a 12-bit with 4,096 levels? Is there a reason to not want the extra levels of brightness? Does this affect how colors are represented or just their brightness levels?
    Bit rate is not the proper term in this context, and what I think you wanted to ask about is bit depth. Bit rate is the number of bits/second at which the image is sampled. A slow readout (low bit rate) enhances image quality. In scientific imaging systems the bit rate can be adjusted, but with most regular cameras it is fixed.  One needs a sufficient number of levels so that the difference in adjacent levels will not be apparent to the eye (posterization). The number of required levels varies with the gamma of the image, and bits are lost when going from a linear raw image to a gamma 2.2 image. See Bruce Lindbloom's levels calculator. When rendered to a 2.2 gamma space a 12 bit raw file goes from 4096 levels to only 249 levels.
    If you don't edit images, 8 bits is usually sufficient. With a wide gamut space such as ProPhotoRGB, the distance between adjacent color levels is greater, and posterization of colors may result if the image is edited to any extent. This posterization is often most evident in smooth areas such as sky. With an sRGB image (average gamma of 2.2) 8 bits per pixel is usually sufficient of you don't do extensive editing. With ProPhotoRGB or when extensive editing is contemplated, 16 bpc is a good choice.

  • How do I reduce the bit depth of images to 1-bit within Acrobat 9?

    I am hoping a simple solution exists within Acrobat 9 for reducing the bit-depth of images to 1-bit.
    I know of two methods that both seem more like workarounds. One, edit the image using Photoshop. Two, without Photoshop, export the page as a 1-bit PNG and recreate the page in Acrobat. It seems like one of the preflight fixups should be able to get it done with the right settings. But, it's a labyrinth of unfamiliarity.

    There's no predefined 1-bit conversion in Preflight because it doesn't make sense. Preflight will not dither bitmaps, so most images will become black squares. Extreme color conversion is only intended for text/vector objects.
    If you want to try it anyway, you can create a custom Fixup if you have a  1-bit ICC profile.
    Preflight > Single Fixups
    Options menu > Create new Preflight Fixup
    Name it something like "Convert all to 1-bit BW"
    Search for "Convert colors" in the type of fixup box and add it
    Destination tab > Destination > your ICC profile for 1-bit black
    Uncheck "use destination from Output Intent"
    Keep everything else as default, though I'd suggest using "Embed as output intent for PDF/X" if you're making PDF/X documents
    Conversion Settings tab > All Objects + Any Color (except spot) + Convert to destination + Use rendering intent
    Press the + key to duplicate this step, and change the second copy to "Spot Color(s)"
    Press + again and change the third copy to "Registration color"
    Save the fixup and run it.
    In case you don't have a 1-bit  ICC profile installed, I've attached one.

  • Store a 12-bit gray scale image

    I'm using a video camera to acquire images. This camera delivers 12-bit gray scale images so 4096 levels of grey. However, when I store these images on my HD on PNG format, the maximum value of a pixel is 256. Which is normal because the 3 colors R, V, B are coded onto 8 bits each. How is it possible to keep the signal dynamic of the image delivered by the camera? Does it exist an image format which would allow me to store the pixel values onto 12 bits ?

    I'm using the IMAQ function "IMAQ Write PNG file" to store the images. But then when you open these stored images with a basic software (such as Paint) each pixel is coded onto 256 levels. Do you think I should turn "Use bit depth?" option to True ?

  • Converting a PNG image to an array of bytes and vice versa..

    hi all,
    i need to convert a PNG image to an array of bytes ,then converting back this array of bytes to The PNG image again ,i read this can be done using output streams but i feel like a dump and i can't fix the whole thingy out ! ,can anybody help me in this ,by explaining how can this be established????
    Regards,
    D.Roth

    hi all,
    i need to convert a PNG image to an array of bytes ,then converting back this array of bytes to The PNG image again ,i read this can be done using output streams but i feel like a dump and i can't fix the whole thingy out ! ,can anybody help me in this ,by explaining how can this be established????
    Regards,
    D.Roth

  • Place images in an array in java?

    I am creating a card game applet where the card game is called 'snap'. The way to play is that i want 2 cards(already drawn and saved as jpegs) to display on the applet and there are 2 buttons - 'snap' and 'next'. the user will press 'snap' when they see both cards which look the same and next if they dont. Very simple. the first problemthat i am having is how to place the images in an array. and the randomly show 2 cards on the applet. this is how far i got, and the other thing is i have to use this template.
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.*;
    public class CardGame extends Applet implements ActionListener     /*NB other interfaces may be added*/
    //int MAX= some_value;               
    //MyObj myObjects[];
         public void start()
              ///Declaration///////
         Button bsnap,bnext,bgame;
              //myObjects=new MyObj[MAX];
              //instantiate objects here
              MyObj MyObjs[] = new MyObj[8];
         //instantiate buttons
              bsnap = new Button ("SNAP!");
              bnext = new Button ("NEXT");
              bgame = new Button ("NEW GAME");
              setLayout(null);
              //add to current container
              add(bsnap);
              add(bnext);
              add(bgame);
              bsnap.setBounds(20,100,70,25);
              bnext.setBounds(95,100,70,25);
              bgame.setBounds(170,100,110,25);                                        
              //delegate listener
              bsnap.addActionListener(this);
              bnext.addActionListener(this);
              bgame.addActionListener(this);
         public void actionPerformed(ActionEvent e)
         public void paint(Graphics g)
    class MyObj {
         MyObj(/*some_arguments*/) {
    as you can see i have already declared the array which can save 9 data items.

    Do you hhave a s[ecific question - like why does my array only hold 8 images and not 9 - no-one is going to write this for you                                                                                                                                                                                                                                                               

  • Can a 256 bit encrypted disk image be read by Tiger?

    I have computers running Leopard, Tiger and Panther.
    If I create a 256 bit encrypted disk image in Leopard, will the image be able to mount and used for reading and writing in Tiger and or Panther?
    Or should I use 128 bit encryption in a mixed OS X environment?
    TIA,
    Bill

    Hello Bill,
    A 256 bit encrypted disk image created in Leopard can be opened in Panther, and presumably Tiger, though I don't have Tiger.
    It cannot however, be written to, only read.
    So if you want to add to the disk image on Panther, and possibly Tiger, use 128 bit. But if you only want *read only* on the other machines you could use 256 bit.

  • Threshold image to D array

    Hello
    I have included 2 Visa. The first one called 'scale image' introduces a picture and converts it to a resolution on 100x100. Is there a way I can export this picture into the second VI which includes IMAQ to threshold the image. 
    I didn't create the second VI it is an example. But from what I Understand it produces the picture into binary. Is there a way I could produce an array with this information on it where the blacks are 1 and the white 0 or visa versa.
    Thanks Craig
    Attachments:
    ScaleImageExample.vi ‏12 KB
    binary.vi ‏43 KB

    Hello Craig
    I am the applications engineer who will be supporting you with this question, as I understand you are looking for alternative methods for displaying image data once you have used the threshold function. Thank you for your thread and including your vi's, this allowed me to look at your code and come up with some ideas without asking you a number of tedious questions.
    Firstly yes you can display your image as an array of binary data, either LED's or 0and1's I have created a project for you which includes your vi's and some additional examples, the additional examples show the new method which you will want to implement.
    Secondly, I created a project so that you can easily pass data between vi's using shared variables, I have created one just to show you, to use the variable just select and drag from the project to your block diagram.
    If you have any further questions or would like any additional examples regarding the conversion of images please get in touch and I will be happy to help. The attached files are in LabVIEW 2010 so if you cannot open them I can down convert them for you.
    Thank you
    Stephanie L
    Applications Engineer
    National Instruments UK and Ireland
    Attachments:
    CraigForum.zip ‏96 KB

  • How can I save the 12-bits gray scale image ?

    Software & Hardware
    NI-IMAQ Vision 6.0
    NI-IMAQ for 1394 2.0.0
    Hamamatsu C4742-95
    I acqured the 12-bits gray scale image (Format7 , 640X512 size , 12bits) successfully.
    And CWIMAQViewer display the correct image of which the range is from 0(black) to 4096(white).
    But, I don't find the way to save this image with 12-bits format T.T
    Always, CWIMAQVision object save this image to 8-bit format.
    I tested all formats - tiff, bmp, aip, png.
    I think there are two possible problems.
    1. I dont't know the way to save the 12bits gray scale image. :{
    2. I dont't know the way to read the 12bits gray scale image that saved correctly.
    How can I save and load the 12-bits gray scale image ?
    What is the solution for this problem T.T ?

    Hello,
    I would recommend taking a look at the "ReadImage" Visual Basic project for more information on setting the image type and saving the image to file.  When you run the program, make sure you select 16 bit for your image.  You can also add another button to this example for saving the image.  Within the click subroutine for the button, you can add the line:
    CWIMAQVision1.WritePNGFile CWIMAQViewer1.Image, "C://image.png"
    This method will save the image in the viewer as a png file.  As long as it was loaded as a 16 bit image, it should save all of the 12 bit information into the file.  You could then test the new image by loading it using the example (you can see the pixel values by right-clicking on the viewer and selecting Settings>>Show Image Info.  The pixel value displayed in the info bar corresponds to the mouse position.
    Best Regards,
    Jesse D.
    Applications Engineering
    National Instruments

  • Converting image into byte array

    Hi all,
    How to convert an integer array image into byte array ?
    here i have a image like this :
    private static int pixelArray[] = {
    0xff000000, 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
    0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
    From this one i create image like this one :
    Image image = Image.createRGBImage(pixelArray, width, height, true);
    Now i want to convert that pixelArray into byte array ? how to do this
    additionally i want to send this byte array to servlet .
    thanks in advance.

    Hi,
    If you want to convert your int array to a byte array you should
    split each integer into 4 bytes to avoid losing information. You can
    rebuild your integer array later if you need to. I think this code
    will work (i havent tested it):
    byte[] pixel= new byte[pixelArray.length<< 2];
    for (int i= pixelArray.length- 1; i>= 0; i--) {
      int aux= i<< 2;  // i* 4 = i<< 2
      pixel[aux]=    (byte) (pixelArray>> 32);
    pixel[aux+ 1]= (byte) (pixelArray[i]>>> 16);
    pixel[aux+ 2]= (byte) (pixelArray[i]>>> 8);
    pixel[aux+ 3]= (byte) pixelArray[i];
    Greets.

Maybe you are looking for